131
State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on Intelligent Systems Marco Filipe Correia dos Reis Thesis to obtain the Master of Science Degree in Electrical and Computer Engineering Supervisor: Dr. Paulo José da Costa Branco Examination Committee Chairperson: Dra. Maria Eduarda de Sampaio Pinto de Almeida Pedro Supervisor: Dr. Paulo José da Costa Branco Members of the Committee: Susana Margarida da Silva Vieira September 2014

State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

Embed Size (px)

Citation preview

Page 1: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

State-of-Charge (SOC) Prediction of Lithium Iron

Phosphate (LiFePO4) Batteries for Automotive

Application Based on Intelligent Systems

Marco Filipe Correia dos Reis

Thesis to obtain the Master of Science Degree in

Electrical and Computer Engineering

Supervisor: Dr. Paulo José da Costa Branco

Examination Committee

Chairperson: Dra. Maria Eduarda de Sampaio Pinto de Almeida Pedro

Supervisor: Dr. Paulo José da Costa Branco

Members of the Committee: Susana Margarida da Silva Vieira

September 2014

Page 2: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

ii

Page 3: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

iii

Acknowledgments

I would like to express my gratitude and appreciation to the supervisor of this work, Prof. Paulo Branco

for his guidance and encouragement. As well, I would like to thank my father, Luis Reis, and two very

special friends Valentin Plyusnin and Diogo Santos. And a very special thanks for my girlfriend Joana

Bicudo, I couldn't have done it so well without you.

Page 4: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

iv

Abstract

Lithium-ion traction batteries are one of the most important components of Hybrid Electric Vehicles

(HEVs). The degradation of those batteries during usage will affect the performance and safety of the

whole vehicle. Thus, studies on life issues of traction Lithium-ion batteries, namely the novel LiFePO4,

are urgent and prioritary. This work will first review the research progresses on life studies of lithium-ion

batteries, including those of some basic definitions, mechanisms of performance degradation and

affecting factors during ageing, life test procedures and life prediction models.

This thesis will use a dataset acquired recently from the unit Energy Technology at VITO Belgium

company (http://www.vito.be/VITO/EN/HomepageAdmin/Home/WetenschappelijkOnderzoek/Energietechnologie/), which is currently

making tests with the promising LiFePO4 batteries for automotive application. An intelligent fuzzy

systems approach will be used for predicting the state-of-charge (SOC) of the batteries. The

methodology involves the use of intelligent data analysis techniques to select the set of variables that

can better summarize battery conditions by giving its SOC value.

In that context, this thesis takes into account two points: a) Review of the life studies on Lithium-ion

batteries for Hybrid Electric Vehicles (HEV); and b) an automatic battery SOC estimation.

The first method introduced in this thesis, is based on a discrete SOC estimation algorithm. However,

this method only allows the estimation of predefined SOCs. Afterwards a continuous SOC estimation

algorithm is presented. The operation of the first method is performed applying a Fuzzy Inference

System and, for the second method, a linear interpolation. Finally, the last chapter describes an on-line

method used for the prediction of the future Impedance Spectra data, i.e. the respective battery

impedance profiles instead measured by electrochemical impedance spectroscopy technique they are

predicted using Fuzzy Inference Systems.

Page 5: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

v

Abstrato

Baterias de tração de iões de lítio são um dos componentes mais importantes dos veículos elétricos

híbridos (HEVs). A degradação dessas baterias durante o uso afetará o desempenho e segurança do

veículo completo. Assim, os estudos sobre as questões da vida de baterias de iões de lítio de tração,

nomeadamente as recentes LiFePO4, são urgentes e prioritários. Este trabalho irá primeiro analisar os

progressos feitos em estudos de vida útil das baterias de iões de lítio, incluindo os de algumas

definições básicas, mecanismos de degradação de desempenho e fatores afetantes durante o

envelhecimento, procedimentos de teste de vida e modelos de previsão de vida.

Esta tese irá usar um conjunto de dados adquiridos recentemente da unidade de Tecnologia de Energia

da empresa VITO na Bélgica (http://www.vito.be/VITO/EN/HomepageAdmin/Home/WetenschappelijkOnderzoek/Energietechnologie/),

que está neste momento a fazer testes com as promissoras baterias LiFePO4 para aplicação

automóvel. Uma abordagem com sistemas inteligentes com lógica Fuzzy irá ser utilizado para prever a

taxa de estado-de-carga (SOC) dos sistemas de baterias. A metodologia envolve a utilização de

técnicas de análise inteligente de dados para selecionar o conjunto de variáveis que podem melhor

resumir as condições da bateria, dando o seu valor SOC.

Nesse contexto, esta tese de mestrado considera dois pontos: a) revisão dos estudos de vida em

baterias de iões de lítio para os veículos elétricos híbridos (HEV); e b) uma estimativa automática SOC

da bateria.

O primeiro método introduzido nesta tese baseia-se num algoritmo de estimativa de SOC discreta. No

entanto, este método apenas permite a estimativa de SOCs predefinidos. Depois, um algoritmo de

estimativa de SOC contínua é apresentada. A operação do primeiro método é realizado através da

aplicação de um sistema de inferência com lógica Fuzzy e, para o segundo método, uma interpolação

linear. Finalmente, o último capítulo descreve um método on-line usado para a predição do futuro dos

dados dos perfis de impedância, ou seja, os respetivos perfis de impedância da bateria em vez medidos

pela técnica de espectroscopia de impedância eletroquímica são previstas usando sistemas de

inferência Fuzzy.

Keywords

LiFePO4, state of charge, open circuit voltage, fuzzy inference system, electrochemical impedance

spectroscopy, impedance spectroscopy prediction

Page 6: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

vi

List of Figures

FIGURE 2.1 - CHARGE AND DISCHARGE MECHANISMS OF LITHIUM ION RECHARGEABLE BATTERIES (TAKEN FROM [17]). ................... 5

FIGURE 2.2 - CHARGE AND DISCHARGE MECHANISMS OF LITHIUM ION RECHARGEABLE BATTERIES (TAKEN FROM [17]). ................... 8

FIGURE 2.3 – SCHEMATIC ILLUSTRATION OF THE CHARGE AND DISCHARGE ............................................................................ 10

PROCESSES OF A LICOO2 BATTERY WITH A LIXC6 GRAPHITE ANODE [18]. ............................................................................. 10

FIGURE 2.4 - THE OPEN CIRCUIT VOLTAGE OF A COMMERCIAL LICOO2 ELECTRODE RECORDED AGAINST METALLIC LITHIUM AS A

FUNCTION OF THE DEGREE OF LITHIUM INTERCALATION (25°C) [19]. ........................................................................... 11

FIGURE 2.5 - THE CHARGE-DISCHARGE CURVE FOR THE DELITHIATION OF LIFEPO4 [22]. ......................................................... 11

FIGURE 2.6 - CHARGE–DISCHARGE PROFILE OF LIXC6 ELECTRODE [23]. ............................................................................... 12

FIGURE 2.7 - RELEASE OF ENERGY EVOLUTION OF LITHIUM ION BATTERIES WITH TEMPERATURE [3]. ........................................... 14

FIGURE 3.1 - PLOT OF OCV IN FUNCTION OF SOC. [9] ..................................................................................................... 17

FIGURE 3.2 - OPEN CIRCUIT VOLTAGE IN FUNCTION OF SOC FOR DIFFERENT TEMPERATURES [10]. ............................................ 18

FIGURE 3.3 - OPEN CIRCUIT VOLTAGE IN FUNCTION OF SOC FOR DIFFERENT CYCLES [11]. ........................................................ 18

FIGURE 3.4 - OCV AFTER DISCHARGING AND CHARGING [12]. ............................................................................................ 19

FIGURE 3.5 - EIS FOR 25% (RED), 50% (YELLOW), 75% (CYAN) AND 100% (BLUE) OF SOC. (0ºC, 1𝑠𝑡MONTH) ....................... 21

FIGURE 3.6 - EIS FOR 25% (RED), 50% (YELLOW), 75% (CYAN) AND 100% (BLUE) OF SOC. (0ºC, 2𝑛𝑑MONTH) ...................... 22

FIGURE 4.1 - PLOT 𝑦 = 𝑥2. ........................................................................................................................................ 24

FIGURE 4.2 - DISCRETE PLOT OF 𝑦 = 𝑥2. ...................................................................................................................... 24

FIGURE 4.3 - FUZZY MODULATION OF 𝑦 = 𝑥2. ............................................................................................................... 25

FIGURE 4.4 - OUPUT OF THE LINGUISTIC FUZZY LOGIC SYSTEM. ........................................................................................... 25

FIGURE 4.5 - REPRESENTATION OF THE OPERATION DOMAIN OF THE SYSTEM USING TRIANGULAR MEMBERSHIP FUNCTIONS AND THE

RESPECTIVE SINGLETONS. ..................................................................................................................................... 28

FIGURE 4.6 - REPRESENTATION OF THE DOMAIN PARTITIONS OF THE SYSTEM USING TRIANGULAR MEMBERSHIP FUNCTIONS. ........... 29

FIGURE 4.7 - GRAPHICAL REPRESENTATION OF RULE SYMBOLIZED BY THE WHITE RECTANGLE. .................................................... 30

FIGURE 4.8 - SET OF EXAMPLES RELATING TO EXTRACTION OF THE RULE WHOSE ANTECEDENT PART IS DEFINED BY THE FUZZY SETS

MEMBERSHIP FUNCTION 4 [X1] AND MEMBERSHIP FUNCTION 2 [X2]. ........................................................................ 31

FIGURE 4.9 - REPRESENTATION OF THE MEMBERSHIP FUNCTION INDUCED AND 𝜔(ℓ), WHICH IS THE VALUE EXTRACTED AS CONCLUSION

OF THE 𝑅𝑢𝑙𝑒ℓ. .................................................................................................................................................. 31

FIGURE 5.1 - GAUSSIAN CURVE MEMBERSHIP FUNCTION (µ = 5 AND Σ = 2). .......................................................................... 34

FIGURE 5.2 - MEMBERSHIP FUNCTIONS OF THE INPUTS VARIABLES “RE(Z)[OHMS]” AND “IMG(Z)[OHMS]”. .............................. 35

FIGURE 5.3 - THE INTERCEPTED AREA (RECTANGLES) OF EACH MEMBERSHIP FUNCTION [0.5,1] BETWEEN THE INPUTS RE(Z)[OHMS]

AND IMG(Z)[OHMS]. EIS OF THE BATTERY FOR 25% (RED DOTS), 50% (YELLOW DOTS), 75% (CYAN DOTS) AND 100% (BLUE

DOTS) OF SOC). ................................................................................................................................................ 35

FIGURE 5.4 - FUZZY SYSTEM OUTPUT ERROR, THE DEFINED OUTPUT (BLUE CIRCLES) AND THE ACTUAL OUTPUT (RED ASTERISKS). ...... 37

FIGURE 5.5 - THE INTERCEPTED AREA (RECTANGLES) OF EACH MEMBERSHIP FUNCTION IN THE INTERVAL [0.5,1] BETWEEN THE INPUTS

RE(Z)[OHMS] AND IMG(Z)[OHMS]. EIS OF THE BATTERY FOR 25% (RED DOTS), 50% (YELLOW DOTS), 75% (CYAN DOTS) AND

100% (BLUE DOTS) OF SOC). .............................................................................................................................. 38

Page 7: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

vii

FIGURE 5.6 – THE 50 X 50 FUZZY SYSTEM OUTPUT SOCS, THE DEFINED SOCS (BLUE CIRCLES) AND THE ESTIMATED SOCS FROM THE

NEW FUZZY MODEL (RED ASTERISKS). ..................................................................................................................... 39

FIGURE 5.7 - ILLUSTRATION OF THE MEMBERSHIP FUNCTIONS OF THE SYSTEM GIVEN AS AN EXAMPLE (6×6 MEMBERSHIP FUNCTIONS).

...................................................................................................................................................................... 40

FIGURE 5.8 - ILLUSTRATION OF REGION COVERED BY THE RULES (GREY SQUARES) OF THE SYSTEM GIVEN AS AN EXAMPLE (6×6

MEMBERSHIP FUNCTIONS). .................................................................................................................................. 41

FIGURE 5.9 - ILLUSTRATION OF THE MEMBERSHIP FUNCTIONS OF THE SYSTEM GIVEN AS AN EXAMPLE (18×18 MEMBERSHIP

FUNCTIONS). ..................................................................................................................................................... 41

FIGURE 5.10 - ILLUSTRATION OF REGION COVERED BY THE RULES (GREY SQUARES) OF THE SYSTEM GIVEN AS AN EXAMPLE (18×18

MEMBERSHIP FUNCTIONS). .................................................................................................................................. 42

FIGURE 5.11 - EIS OF THE BATTERY WITH 50 AND 75% OF SOC (BLACK AND GREEN DOTS, RESPECTIVELY) AND THE SIMULATED INPUT

PROFILES (RED, YELLOW AND BLUE ASTERISKS). ........................................................................................................ 43

FIGURE 5.12 - EIS OF THE BATTERY (BLACK DOTS) AND THE SIMULATED EIS (RED DOTS) FOR A BATTERY WITH 50% OF SOC. ......... 45

FIGURE 5.13 - EIS OF THE BATTERY (BLACK DOTS) AND THE SIMULATED EIS (RED DOTS) FOR A BATTERY WITH 75% OF SOC. ......... 45

FIGURE 5.14 - EIS OF THE BATTERY (BLACK DOTS) AND THE SIMULATED EIS (WITH HIGHER DIFFERENTIATION, REPRESENTED WITH RED

DOTS) FOR A BATTERY WITH 50% OF SOC. ............................................................................................................. 46

FIGURE 5.15 - EIS OF THE BATTERY (BLACK DOTS) AND THE SIMULATED EIS (WITH HIGHER DIFFERENTIATION, REPRESENTED WITH RED

DOTS) FOR A BATTERY WITH 75% OF SOC. ............................................................................................................. 46

FIGURE 5.16 – ILLUSTRATED EXAMPLE OF THE ALGORITHM FOR THE ESTIMATION OF SOC. ....................................................... 48

FIGURE 5.17 - THE INTERCEPTED AREA (RECTANGLES) OF EACH MEMBERSHIP FUNCTION IN THE INTERVAL [0.5,1] BETWEEN THE

INPUTS RE(Z)[OHMS] AND IMG(Z)[OHMS]. EIS OF THE BATTERY FOR 25% (RED DOTS), 50% (YELLOW DOTS), 75% (CYAN

DOTS) AND 100% (BLUE DOTS) OF SOC). ............................................................................................................... 49

FIGURE 5.18 - FUZZY SYSTEM OUTPUT USING THE AVERAGE IMPEDANCE PROFILE, THE REAL SOC (BLUE CIRCLES) AND THE ESTIMATED

SOC (RED ASTERISKS). ........................................................................................................................................ 50

FIGURE 5.19 - EIS OF THE BATTERY WITH 50% AND 75% OF SOC (BLACK AND GREEN DOTS RESPECTIVELY) AND THE PROFILES USED AS

INPUTS (ASTERISKS). ........................................................................................................................................... 51

FIGURE 5.20 - DEFINING A RULE OF A FUZZY SYSTEM WITH ONLY ONE POINT.......................................................................... 53

FIGURE 5.21 - DEFINING A RULE OF A FUZZY SYSTEM WITH TWO POINTS. .............................................................................. 54

FIGURE 6.1 - EIS OF THE BATTERY FOR 25% (RED DOTS), 50% (YELLOW DOTS), 75% (CYAN DOTS) AND 100% (BLUE DOTS) OF SOC

IN: (A) MONTH 1, (B) MONTH 2, (C) MONTH 3, (D) MONTH 4, (E) MONTH 5 AND (F) MONTH 6. ....................................... 57

FIGURE 6.2 - CENTER OF GRAVITY OF EACH IMPEDANCE SPECTROSCOPY OF THE BATTERY (MONTH 2), WITH 25% (RED DOTS), 50%

(YELLOW DOTS), 75% (CYAN DOTS) AND 100% (BLUE DOTS) OF SOC, REPRESENTED BY CIRCLES WITH THE SAME COLOR. ...... 57

FIGURE 6.3 - ASSUMED PATH OF THE EVOLUTION OF THE CENTERS OF GRAVITY REPRESENTED WITH A GREEN LINE, 25% (RED DOTS),

50% (YELLOW DOTS), 75% (CYAN DOTS), 100% (BLUE DOTS=,(MONTH 2). ................................................................. 58

FIGURE 6.4 - BILINEAR INTERPOLATION. THE RECTANGLE ABCD IS PARTITIONED INTO FOUR AREAS BY THE LINES X = X2 AND Y = Y2

[14]. ............................................................................................................................................................... 59

FIGURE 6.5 - LINEAR INTERPOLATION MODEL COMPUTED WITH 4 IMPEDANCE CENTROIDS OF THE BATTERY WITH: 25%, 50%, 75%

AND 100% OF SOC RESPECTIVELY. (MONTH 2) ....................................................................................................... 60

Page 8: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

viii

FIGURE 6.6 – ALGORITHM THAT, GIVEN A CENTROID VALUE OUTSIDE THE AREA COVERED BY INTERPOLATION, COMPUTES THE CLOSEST

POINT OF THE AREA COVERED BY INTERPOLATION TO THE RESPECTIVE CENTROID. (MONTH 2) ............................................ 61

FIGURE 6.7 - INTERMEDIATE IMPEDANCE (BLACK DOTS) BETWEEN IMPEDANCE PROFILES OF THE BATTERY WITH 25% (RED DOTS) AND

50% (YELLOW DOTS) WITH THE RESPECTIVE CENTROIDS REPRESENTED WITH A CIRCLE WITH THE SAME COLOR. (MONTH 2) ..... 62

FIGURE 6.8 - INTERMEDIATE IMPEDANCE (BLACK DOTS) BETWEEN IMPEDANCE PROFILES OF THE BATTERY WITH 50% (YELLOW DOTS)

AND 75% (LIGHT BLUE DOTS) WITH THE RESPECTIVE CENTROIDS REPRESENTED WITH A CIRCLE WITH THE SAME COLOR. (MONTH

2) ................................................................................................................................................................... 62

FIGURE 6.9 - INTERMEDIATE IMPEDANCE (BLACK DOTS) BETWEEN IMPEDANCE PROFILES OF THE BATTERY WITH 75% (LIGHT BLUE

DOTS) AND 100% (BLUE DOTS) WITH THE RESPECTIVE CENTROIDS REPRESENTED WITH A CIRCLE WITH THE SAME COLOR. (MONTH

2) ................................................................................................................................................................... 63

FIGURE 6.10 - REPRESENTATION OF THE OUTPUT OF THE INTERPOLATION MODEL FOR THE INTERMEDIATE CENTROIDS: (A) 37.5%, (B)

62.5% AND (C) 87.5%. OF SOC. ......................................................................................................................... 64

FIGURE 6.11 - EIS OF THE BATTERY WITH 25% OF SOC WITHOUT NOISE (BLACK DOTS) AND WITH NOISE ADDED (RED DOTS) WITH THE

RESPECTIVE CENTROIDS REPRESENTED BY CIRCLES. ..................................................................................................... 65

FIGURE 6.12 - INTERMEDIATE COMPUTED IMPEDANCE OF A BATTERY WITH AN ASSUMED INTERMEDIATE SOC OF 37.5% WITHOUT

NOISE (BLACK DOTS) AND WITH NOISE ADDED (RED DOTS) WITH THE RESPECTIVE CENTROIDS REPRESENTED BY CIRCLES. .......... 66

FIGURE 6.13 - EIS OF THE BATTERY WITH 50% OF SOC WITHOUT NOISE (BLACK DOTS) AND WITH NOISE ADDED (RED DOTS) WITH THE

RESPECTIVE CENTROIDS REPRESENTED BY CIRCLES. ..................................................................................................... 66

FIGURE 6.14 - INTERMEDIATE COMPUTED IMPEDANCE OF A BATTERY WITH AN ASSUMED INTERMEDIATE SOC OF 62,5% WITHOUT

NOISE (BLACK DOTS) AND WITH NOISE ADDED (RED DOTS) WITH THE RESPECTIVE CENTROIDS REPRESENTED BY CIRCLES. .......... 67

FIGURE 6.15 - EIS OF THE BATTERY WITH 75% OF SOC WITHOUT NOISE (BLACK DOTS) AND WITH NOISE ADDED (RED DOTS) WITH THE

RESPECTIVE CENTROIDS REPRESENTED BY CIRCLES. ..................................................................................................... 67

FIGURE 6.16 - INTERMEDIATE COMPUTED IMPEDANCE OF A BATTERY WITH AN ASSUMED INTERMEDIATE SOC OF 87.5% WITHOUT

NOISE (BLACK DOTS) AND WITH NOISE ADDED (RED DOTS) WITH THE RESPECTIVE CENTROIDS REPRESENTED BY CIRCLES. .......... 68

FIGURE 6.17 - EIS OF THE BATTERY WITH 100% OF SOC WITHOUT NOISE (BLACK DOTS) AND WITH NOISE ADDED (RED DOTS) WITH

THE RESPECTIVE CENTROIDS REPRESENTED BY CIRCLES. ............................................................................................... 68

FIGURE 6.18 - INPUTS WITH AN OFFSET ADDED AND THE RESPECTIVE CENTROIDS REPRESENTED BY CIRCLES (RED DOTS) AND WITHOUT

THE OFFSET (BLACK DOTS). (A) 25%, (B) 37.5%, (C) 50%, (D) 62.5%, (E) 75%, (F) 87.5% AND (G) 100%. .................... 71

FIGURE 7.1 – PATTERN EXAMPLE. ................................................................................................................................. 73

FIGURE 7.2 - NEXT POINT EXPECTED (BLUE CIRCLE) ACCORDING WITH THE PATTERN (RED CIRCLES). ............................................ 74

FIGURE 7.3 – INPUTS AND OUTPUTS REPRESENTING THE THREE RULES FOR PATTERN RECOGNITION. ........................................... 74

FIGURE 7.4 – VARIATIONS AS INPUTS AND OUTPUTS OF THE RULE-BASED MODEL FOR PATTERN RECOGNITION. ............................. 75

FIGURE 7.5 - EIS (REAL PART ONLY) OF THE BATTERY WITH 25 (RED DOTS), 50 (YELLOW DOTS) AND 100% (BLUE DOTS) OF SOC AT

FIRST MONTH (A) AND SECOND MONTH (B) AND THE IMPEDANCE DIFFERENCE BETWEEN THOSE MONTHS REPRESENTED IN (C). 76

FIGURE 7.6 - EIS (IMAGINARY PART ONLY) OF THE BATTERY WITH 25 (RED DOTS), 50 (YELLOW DOTS) AND 100% (BLUE DOTS) OF

SOC AT FIRST MONTH (A) AND SECOND MONTH (B) AND THE IMPEDANCE DIFFERENCE BETWEEN THOSE MONTHS REPRESENTED IN

(C). ................................................................................................................................................................. 77

FIGURE 7.7 - INPUT MEMBERSHIP FUNCTIONS USED TO DEFINE THE THREE VARIABLES FOR FIS_REAL. ........................................ 79

Page 9: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

ix

FIGURE 7.8 - PREDICTION OF THE REAL PART OF THE IMPEDANCE PROFILE OF NEXT MONTH FOR 25%, 50% AND 100% OF SOC OF

THE BATTERY (RED DOTS) AND THE ACTUAL IMPEDANCE (BLUE DOTS). ........................................................................... 80

FIGURE 7.9 - PREDICTION OF THE IMAGINARY PART OF THE IMPEDANCE PROFILE OF NEXT MONTH FOR 25%, 50% AND 100% OF SOC

OF THE BATTERY (RED DOTS) AND THE ACTUAL IMAGINARY IMPEDANCE (BLUE DOTS). ...................................................... 81

FIGURE 7.10 - REAL PART OF THE INTERMEDIATE IMPEDANCE PROFILE (RED DOTS) BETWEEN EIS OF THE BATTERY WITH 100% OF SOC

PERFORMED IN MONTH 1 (BLUE DOTS) AND MONTH 2 (BLACK DOTS)............................................................................ 83

FIGURE 7.11 - IMAGINARY PART OF THE INTERMEDIATE IMPEDANCE PROFILE (RED DOTS) BETWEEN EIS OF THE BATTERY WITH 100%

OF SOC PERFORMED IN MONTH 1 (BLUE DOTS) AND MONTH 2 (BLACK DOTS). ............................................................... 83

FIGURE 7.12 - INPUT MEMBERSHIP FUNCTIONS PLOTS. ..................................................................................................... 84

FIGURE 7.13 - PREDICTION OF THE REAL PART OF THE IMPEDANCE PROFILE FOR 25%, 50% AND 100% OF THE BATTERY SOC (RED

DOTS) AND THE ACTUAL IMPEDANCE PROFILE (BLUE DOTS) FOR MONTH 10. ................................................................... 85

FIGURE 7.14 - PREDICTION OF THE IMAGINARY PART OF THE IMPEDANCE PROFILE FOR 25%, 50% AND 100% OF SOC OF THE

BATTERY (RED DOTS) AND THE ACTUAL IMPEDANCE (BLUE DOTS) FOR MONTH 10............................................................ 86

Page 10: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

x

List of tables

TABLE 1.1 – BATTERY TECHNOLOGIC COMPARISON [21]. .................................................................................................... 1

TABLE 2.1 – OPEN CIRCUIT VOLTAGE CALCULATION OF A LI(X)COO2 BATTERY. ........................................................................ 12

TABLE 2.2 - VOLTAGE CALCULATION OF A LIXFEPO4BATTERY. ............................................................................................. 12

TABLE 2.3 - COMPARISON BETWEEN LICOO2 AND LIFEPO4 CATHODES (THEORETICAL VALUES). .............................................. 13

TABLE 5.1 - INPUTS AND OUTPUTS OF THE FUZZY SYSTEM WITH 30 MEMBERSHIP FUNCTIONS EACH VARIABLE. ............................. 36

TABLE 5.2 – AVERAGE AND VARIANCE OF THE OUTPUTS OF THE FUZZY SYSTEM WITH 30 MEMBERSHIP FUNCTIONS EACH VARIABLE. . 37

TABLE 5.3 - AVERAGE AND VARIANCE OF THE OUTPUTS OF THE FUZZY SYSTEM WITH 50 MEMBERSHIP FUNCTIONS EACH VARIABLE. .. 39

TABLE 5.4 – AVERAGE AND VARIANCE OF THE SOC VALUES ESTIMATED BY THE FUZZY SYSTEM WHEN USING THE INPUT PROFILES

INDICATED IN FIGURE 5.11. ................................................................................................................................. 44

TABLE 5.5 – AVERAGE AND VARIANCE OF THE OUTPUTS OF THE FUZZY SYSTEM WITH SIMULATED INPUTS. ................................... 45

TABLE 5.6 – AVERAGE AND VARIANCE OF THE OUTPUTS OF THE FUZZY SYSTEM WITH SIMULATED INPUTS (WITH HIGHER

DIFFERENTIATION). ............................................................................................................................................. 47

TABLE 5.7 – EXAMPLE OF SETTING LIMITS FOR THE AVERAGE AND VARIANCE FOR THE SOC ESTIMATION ALGORITHM..................... 48

TABLE 5.8 – AVERAGE AND VARIANCE OF THE OUTPUTS OF THE FUZZY SYSTEM WITH 30 MEMBERSHIP FUNCTIONS EACH VARIABLE (FIS

CONSTRUCTED WITH IMPEDANCE SPECTRUMS AVERAGE DATA). ................................................................................... 50

TABLE 5.9 – AVERAGE AND VARIANCE OF THE ESTIMATED SOC VALUES OF THE FUZZY MODEL OF THE INPUTS INDICATED IN FIGURE

5.19. .............................................................................................................................................................. 52

TABLE 5.10 - AVERAGE AND VARIANCE OF THE OUTPUTS OF THE FUZZY SYSTEM WITH SIMULATED INPUTS. (FIS CONSTRUCTED WITH

THE IMPEDANCE PROFILES AVERAGE). ..................................................................................................................... 52

TABLE 6.1 – OUTPUT AND ERROR OF THE ALGORITHM FOR IMPEDANCE SPECTRUM CENTROIDS OF THE BATTERY WITH A SOC OF 25,

37.5, 50, 62.5, 75, 87.5 AND 100%, AS INPUTS. .................................................................................................. 64

TABLE 6.2 - OUTPUT AND ERROR OF THE ALGORITHM FOR IMPEDANCE SPECTRUM CENTROIDS OF THE BATTERY WITH A SOC OF 25%,

37.5%, 50%, 62.5%, 75%, 87.5% AND 100%, AS INPUTS WITH NOISE ADDED. ......................................................... 69

TABLE 6.3 - OUTPUT AND ERROR OF THE ALGORITHM FOR IMPEDANCE SPECTRUM CENTROIDS OF THE BATTERY WITH A SOC OF 25%,

37.5%, 50%, 62.5%, 75%, 87.5% AND 100%, AS INPUTS WITH AN OFFSET ADDED. ................................................... 71

TABLE 7.1 - INPUTS AND THE RESPECTIVE OUTPUTS OF THE FIS. .......................................................................................... 77

TABLE 7.2 –FIS_REAL INPUTS AND OUTPUT (REAL PART OF THE COMPLEX IMPEDANCE PROFILE). .............................................. 78

TABLE 7.3 – FIS_IMG INPUTS AND OUTPUT (IMAGINARY PART OF THE COMPLEX IMPEDANCE PROFILE). ...................................... 80

TABLE 7.4 – MEAN ABSOLUTE ERROR OF THE REAL PART OF THE IMPEDANCE PROFILE PREDICTION. ............................................ 81

TABLE 7.5 – MEAN ABSOLUTE ERROR OF THE IMAGINARY PART OF THE IMPEDANCE SPECTRUM PREDICTION. ............................... 82

TABLE 7.6 - FIS INPUTS AND OUTPUT (REAL PART OF THE COMPLEX IMPEDANCE PROFILE). ....................................................... 85

TABLE 7.7 - FIS INPUTS AND OUTPUT (IMAGINARY PART OF THE COMPLEX IMPEDANCE PROFILE). .............................................. 85

TABLE 7.8 - MEAN ABSOLUTE ERROR OF THE REAL PART OF THE IMPEDANCE PREDICTION. ........................................................ 86

TABLE 7.9 - MEAN ABSOLUTE ERROR OF THE IMAGINARY PART OF THE IMPEDANCE PREDICTION. ............................................... 86

Page 11: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

xi

List of symbols

LiCoO2 – Lithium Cobalt Oxide

A – Electrochemical specie

B – Electrochemical specie

C – Electrochemical specie

D – Electrochemical specie

a – Number of molecules of specie A

b – Number of molecules of specie B

c – Number of molecules of specie C

d – Number of molecules of specie D

n – Number of electrons

ΔG0 – Standard free energy [J/mol]

F – Faraday’s constant [C.mol-1]

E0 – Standard electromotive force [V]

E – Electromotive force [V]

R – Universal gas constant [JK-1mol-1]

T – Absolute temperature [K]

X – Electrochemical specie’s concentration [kg/m3]

LiFePO4 – Lithium Iron Phosphate

R – Electrical resistance [Ohm]

i – Electrical current [A]

A – Area [m2]

k – Rate constant

𝐶𝑂 – Concentrations of oxidized elements [kg/m3]

𝐶𝑅 – Concentrations of reduced elements [kg/m3]

α – transfer coefficient

𝐼𝑎𝑐 – Current that flows from the anode to the cathode [A]

𝐼𝑐𝑎 – Current that flows from the cathode to the anode [A]

J – Diffusion flux [mol.m-2.s-1]

D – Diffusion coefficient [m2.s-1]

f – Substance’s concentration [mol.m-3]

Li+ - lithium ion

LiC6 – Lithiated graphite

C6 – carbon

Rionic – Ionic resistance of the electrolyte and electrodes/current collectors [Ohm]

Relectronic – electronic resistance of the electrolyte and electrodes/current collectors [Ohm]

Rint – Ionic and electronic resistance of the electrolyte and electrodes/current collectors [Ohm]

τ – Time constant [s]

𝑆𝑂𝐶0 - Initial SOC

Page 12: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

xii

𝜂 - Coulombic Efficiency

𝐶𝑛 - Battery estimated capacity

Z – Complex impedance

Re(Z) – Real part of complex impedance

Img(Z) – Imaginary part of complex impedance

𝑦 - Numerical value of the output variable of the system

𝑥 - Numerical value of the input variable of the system

𝑅𝑢𝑙𝑒(ℓ) - Rule number ℓ

𝑥𝑗 - Antecedent variable j

𝐴𝑗(ℓ) - Linguistic term assigned to the variable 𝑥𝑗 in rule ℓ

𝐵(ℓ) - Linguistic term assigned to the variable y in rule ℓ

A1(ℓ)× …× An

(ℓ) - Cartesian product between the membership functions of the antecedent part of the rule

µ𝐴𝑗(ℓ)(𝑥𝑗) - Membership function assigned to the linguistic term 𝐴𝑗

(ℓ)

µ𝐵(ℓ)(𝑥𝑗) - Membership function assigned to the linguistic term 𝐵(ℓ)

µ(ℓ)If->Then (x,y) - Membership function to the proposition If-Then

µ( Rule(ℓ) ) - Activation degree of the rule ℓ

𝑥1, 𝑥2, … , 𝑥𝑛- Antecedent variables of each rule

𝑥1′, 𝑥2′, … , 𝑥𝑛′ - Numerical values of the correspondent input variables of the system

ω(ℓ) - Numerical value assigned to the variable in the consequent rule

𝑥𝑖(𝑘) - Vector composed of a set of degrees of membership obtained from the variable 𝑥𝑖 at time k

Y - Inferred value of the fuzzy model

List of abbreviations

SOC – State of Charge

OCV – Open circuit voltage

EIS – Electrochemical impedance spectroscopy

FIS - Fuzzy inference system

Page 13: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

xiii

Index

1 - Introduction .......................................................................................................................... 1

1.1 - Motivation and problem definition ............................................................................................2

1.2 - Objectives ...............................................................................................................................3

1.3 - Main contributions ...................................................................................................................3

2 - Batteries: Basic Principles .................................................................................................... 4

2.1 - Basic Concepts .......................................................................................................................4

2.2 - Operation of a cell – Charge and Discharge Procedures .........................................................5

2.3 - Thermodynamic Background ..................................................................................................6

2.4 - Internal resistance ..................................................................................................................6

2.5 - Charge transfer – electrodes ...................................................................................................7

2.6 - Mass transfer ..........................................................................................................................7

2.7 - Redox Equations ....................................................................................................................8

2.7.1 - Redox equations - Lithium Cobalt Oxide Battery ..............................................................8

2.7.2 - Redox equations - Lithium Iron Phosphate Battery ...........................................................9

2.8 - Comparative Analysis between LiFePO4 and LiCoO2 Batteries .............................................. 10

2.9 - Stability Comparative Analysis: LiFePO4 x LiCoO2 ................................................................ 13

2.10 - Conclusion .......................................................................................................................... 15

3 - The State of Charge (SOC) Estimating Methods ................................................................ 16

3.1 - The state of charge ............................................................................................................... 16

3.2 - Relationship between SOC and OCV .................................................................................... 17

3.2.1 - Main disadvantage estimating SOC using OCV value .................................................... 18

3.3 - Electrochemical impedance spectroscopy (EIS) .................................................................... 20

3.3.1 - Relationship between battery’s SOC and its impedance spectrum .................................. 21

4 - Fuzzy Inference System ..................................................................................................... 23

4.1 - Introduction ........................................................................................................................... 23

4.2 - Characteristics of the fuzzy model ......................................................................................... 23

4.3 - Types of fuzzy models .......................................................................................................... 26

4.3.1 - Linguistic approach ........................................................................................................ 26

4.3.2 - Hybrid approach ............................................................................................................ 26

4.4 - The rules and their grammatical structure in fuzzy logic ......................................................... 26

Page 14: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

xiv

4.5 - Inference Mechanism ............................................................................................................ 28

4.6 - Learning by examples using fuzzy logic ................................................................................ 29

4.7 - Basic steps of the algorithm .................................................................................................. 32

5 - SOC estimation method (Impedance profile comparative analysis) applying a Fuzzy Inference

System ................................................................................................................................... 33

5.1 - Construction of FISs with the EISs impedance data .............................................................. 33

5.1.1 - FIS rule-base: initial testing ............................................................................................ 36

5.1.2 - SOC estimation error X number of membership functions .............................................. 37

5.1.3 - Accuracy limit of the fuzzy model ................................................................................... 39

5.1.4 - Offline SOC estimation method and noise analysis ........................................................ 42

5.2 - FIS construction using the average impedance magnitude of the impedance profile .............. 49

5.2.1 - FIS testing ..................................................................................................................... 49

5.2.2 - Offline SOC estimation method and noise analysis (Simplified fuzzy by using the previous

average of the impedance profiles) ........................................................................................... 51

5.3 - Conclusion ............................................................................................................................ 55

6 - Online SOC estimation method .......................................................................................... 56

6.1 - On-line SOC estimation Algorithm ......................................................................................... 57

6.2 - Testing the algorithm ............................................................................................................ 61

6.2.1 - Noise Analysis ............................................................................................................... 65

6.3 - Conclusion ............................................................................................................................ 72

7 - Estimation of impedance profiles ........................................................................................ 73

7.1 - Prediction of impedance profiles ........................................................................................... 75

7.2 - Impedance profiles prediction using data interpolation ........................................................... 82

7.3 - Conclusion ............................................................................................................................ 88

8 - Future Work ....................................................................................................................... 89

Bibliography ............................................................................................................................ 90

Annex 1 .................................................................................................................................. 92

Annex 2 .................................................................................................................................. 94

Annex 3 .................................................................................................................................. 95

Annex 4 𝐌𝐚𝐭𝐥𝐚𝐛® code .......................................................................................................... 97

Data load ...................................................................................................................................... 97

Chapter 5 ..................................................................................................................................... 98

Page 15: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

xv

Chapter 6 ................................................................................................................................... 102

Chapter 7 ................................................................................................................................... 110

Page 16: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

1

1 - Introduction

Lithium-ion batteries are members of a family of rechargeable battery types in which lithium

ions move from the negative electrode to the positive electrode during discharge and back when

charging.

Lithium-ion batteries nowadays are used in many sectors like electronics, military, electric

vehicles and aerospace applications. In the table 1.1, basic characteristics of lithium-ion and other vastly

used batteries are presented.

Lithium-ion batteries

Specifications Lead-Acid NiCd NiMH Cobalt Manganese Phosphate

Specific energy

density (Wh/Kg) 30-50 45-80 60-120 150-190 100-135 90-120

Self-

discharge/month

(room temp.)

5-15% 20% 30% <5% <5% <5%

Cell voltage 2.0 1.2 1.2 3.6 3.8 3.3

Table 1.1 – Battery technologic comparison [21].

Lithium-ion batteries have high energy densities, high cell voltage and a slow loss of charge when not

in use, when compared with another types of batteries.

Nowadays a great part of lithium-ion batteries are based on lithium cobalt oxide (LiCoO2), which offers

high energy density but presents safety risks, especially when damaged (namely combustion, when

overcharged or overheated). Lithium iron phosphate batteries (LFP batteries) present a lower energy

density, but last longer and exhibit a higher inherent safety.

Chapter 2 shows a more detailed comparative study between a vastly used battery, the lithium

cobalt oxide, and a more recent type of Li-ion battery, the lithium iron phosphate oxide (LiFePO4). This

study will focus on significant battery characteristics like open circuit voltage, capacity and stability.

Analyzing these characteristics will allow us to understand the advantages and disadvantages of using

iron phosphate oxide batteries and justify the use of this type of batteries instead of other commercial

lithium-ion based batteries.

Most existing battery models are impractical for automotive system designers and require extensive

background knowledge of electrochemistry to be implemented. Furthermore, many models do not take

the effect of battery’s temperature operation into account and are obtained from testing only fully

charged batteries. However, in real‐life conditions electric vehicles are not always fully charged and run

with different temperature conditions. To obtain practical battery experimental data based on real

Page 17: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

2

operating conditions and to model its state of charge (SOC), two LiFePO4 cells have been initially tested

under possible operating conditions.

This thesis will use a recently dataset acquired from the unit Energy Technology at VITO Belgium

company

(http://www.vito.be/VITO/EN/HomepageAdmin/Home/WetenschappelijkOnderzoek/Energietechnologie

/), which is currently making tests with the promising LiFePO4 batteries for automotive application. An

intelligent fuzzy systems approach will be used for predicting the state-of-charge (SOC) of the battery

systems. The methodology involves the use of intelligent data analysis techniques to select the set of

variables that can better summarize battery conditions by giving its SOC value.

1.1 - Motivation and problem definition

Battery usage has been growing, making them important storage of energy devices, therefore justifying

their development. The batteries are currently used in various industry sectors, from small mobile

devices as mobile phones or mp3s to electric vehicles. The batteries are also used for fixed devices

such as UPS or as energy storage for buildings or even for the power grid.

The bigger the devices, the greater the number of batteries used. Each battery has a value of State of

Charge “SOC” however, when used in groups, normally their SOC differ, which is not detected by any

SOC measuring instruments. Although a set of the same batteries are theoretically identical, one of the

causes for unbalanced SOCs of the batteries is that in practice they always show minor differences

between each other, which could result in slightly different capacities or specific energy. Even if they are

physically identical, the exposure to different working conditions can cause SOC’s unbalance. For

example in a pack of batteries, those located more in the center are usually hotter than at the periphery.

Unbalance of SOCs between batteries and the inaccuracy of the traditional SOC measuring instruments

can result in two situations:

A shorter life of the battery pack in question because some batteries of the pack can suffer over-

charging or even under-charging, reducing their lifetime and therefore the life time of the pack;

A second critical situation results in different usage times for each battery that can also result in

diminished life times for the batteries with a higher usage. The most frequent use of some

batteries in the pack can lead to rapid aging and thus result in the destruction of the batteries

thereby decreasing the longevity of the pack.

These unbalances can be eliminated with the use of measuring devices and SOC balancing between

batteries [15]. A problem with these tools is their lack of precision and tendency to be out of adjustment

over time, i.e. the measured value of battery SOC becomes increasingly inaccurate [8].

Page 18: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

3

1.2 - Objectives

This thesis aims to provide a solution for these problems through the implementation and development

of more accurate techniques for the measurement of the battery’s SOC and techniques that self-update

over time maintaining the accuracy of the instruments.

1) The selections of the inputs that allow the best SOC estimation: analysis and testing.

2) Develop an intelligent system to predict the battery SOC’s value.

3) Development and testing of intelligent systems to predict the battery characteristics allowing an

accurate SOC estimating.

1.3 - Main contributions

The fact that this project involves the use and understanding of batteries, more specifically Lithium Iron

Phosphate Batteries, it requires the merge of knowledge from different areas such as Applied

Electromagnetism, Energy Conversion and Matlab for software implementation to create a complex and

interdisciplinary project. An intelligent fuzzy systems approach will be used for predicting the state-of-

charge (SOC) of the battery systems. The methodology involves the use of intelligent data analysis

techniques to select the set of variables that can better summarize battery conditions by giving its SOC

value.

The study presented on this dissertation introduces methods that will allow the estimation of the state

of charge of Lithium Iron Phosphate Battery batteries with a higher precision and accuracy than the

typical methods nowadays. The superior quality of state of charge measurement will contribute for the

increase of life span and for a more efficient use of the respective batteries.

Page 19: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

4

2 - Batteries: Basic Principles

2.1 - Basic Concepts

An electric battery is a device consisting of one or more electrochemical cells that convert stored

chemical energy into electrical energy. The conversion of chemical to electrical energy is performed in

accordance with the redox equations. Each battery cell is composed with: a positive terminal or cathode,

a negative terminal or anode, an electrolyte, a separator, and two current collectors.

The cathode (positive electrode) during the discharge of the cell accepts electrons electrochemical

reduction taking place in it. As current flows, electrons from the circuit and cations from the electrolytic

solution in the device move toward the cathode.

The anode provides them, while for rechargeable batteries the previous procedure is inverted during the

charging of the battery. The constituent material of the anode is usually carbon or graphite due its very

low electrical resistivity. For the cathode of Li-ion batteries, numerous commercial materials that undergo

reversible Lithium ions intercalation have been used as, for example, LiCoO2, LiMn2O4 (LMO),

LiNi1/3Co1/3Mn1/3O2 and LiFePO4. The choice of cathode greatly affects the performance and cost of

a Li-ion battery. Traction applications are particularly sensitive to cost, performance, and abuse-

tolerance requirements. Reduction of cost has been one of the primary driving forces for the

investigation of new cathode materials to replace expensive LiCoO2, particularly for vehicular

applications. These considerations have led to the development of several different types of cathode

materials. Because there is not yet one ideal material that can meet requirements for all applications,

research into cathodes for Li-ion batteries is a very active field.

The electrolyte solution provides the medium transfer for ions inside the cell between the anode and

cathode, resulting then in a current in the electric circuit between the terminals of the battery. Electrolyte

plays a great importance on the performances of lithium-ion batteries, such as cyclability, safety, etc.

Lithium batteries use organic type electrolytes since they make possible the use of Li as the anodic

active material, resulting in the high power and energy densities of Li-ion batteries. However, organic

electrolytes have high flammability and volatility, posing serious safety issues when exposed to elevated

temperatures and voltages. Within these conditions, the electrolyte can react with the electrode

materials, liberating gas that can interact with air-containing enclosure producing a high flammable

solvent vapor.

The most used electrolyte in Li-ion batteries has been the LiPF6 one. Recent results [16] indicated that

it is around 150-200ºC that that electrolyte breakdown with high rate of flammable vapors. It has to be

noticed that the energy released by electrolyte combustion is much larger than the electric energy stored

Page 20: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

5

in a battery. Generally, retardant additives are introduced but in a very small percentage (<10%) to not

decrease battery performance.

The separator is a critical component of a battery, its main function is to prevent physical contact of the

electrodes while permitting ions to flow freely and avoiding the possibility of short-circuits. For high

energy and power densities, the separator is required to be very thin and highly porous, while it adversely

affects the safety and cycle life of the battery as a result of the reduced mechanical strength. According

to the current material prices and Li-ion technology [17], the cost of the separator can be over 20% of

the total cost of a Li-ion battery. Reducing the separator thickness increases battery energy and power

densities, but it inevitably lowers the mechanical strength of the separator. In practical applications, the

requirements above should be appropriately weighed among the performance (low ionic resistance),

safety and cost.

2.2 - Operation of a cell – Charge and Discharge Procedures

During the discharge process of a cell connected to an external load, which can be seen on the left side

of Figure 2.1, there is a flow of electrons from the anode to the cathode. The electric circuit is closed

through the electrolyte with the flow of cations (positive ions), from the anode to the cathode.

In the process of charging, presented in right of Figure 2.1 an external source is connected to the cell

that will change the direction of the current flow reversing the chemical reactions.

Figure 2.1 - Charge and discharge mechanisms of lithium ion rechargeable batteries (taken from [17]).

(a) (b)

Page 21: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

6

2.3 - Thermodynamic Background

Considering a standard cell, the reaction at the cathode can be

𝑎𝐴 + 𝑛𝑒 ⇌ 𝑐𝐶 (2.1)

where 𝑎 is the number of molecules of specie 𝐴, 𝑛 is the number of electrons and 𝑐 is the number of

molecules of specie 𝐶. At the anode, the reaction can be represented as

𝑏𝐵 − 𝑛𝑒 ⇌ 𝑑𝐷 (2.2)

where 𝑏, 𝐵, 𝑛, 𝐷 and 𝑑 have the same analogous meaning. Hence, the overall reaction in the cell is

𝑎𝐴 + 𝑏𝐵 ⇌ 𝑐𝐶 + 𝑑𝐷 (2.3)

The change in the standard free energy ΔG0 of a cell reaction is the leading force which enables a

battery to deliver electrical energy to an external load, and is expressed as

∆𝐺0 = −𝑛𝐹𝐸0 (2.4)

where, 𝐹 is Faraday’s constant (96,487 coulombs) and 𝐸0 is the standard electromotive force. [4]

The potential 𝐸 of a cell is given by the Nernst equation,

𝐸 = 𝐸0 −

𝑅𝑇

𝑛𝐹ln[𝐶]𝑐[𝐷]𝑑

[𝐴]𝑎[𝐵]𝑏 (2.5)

where 𝑅 is the universal gas constant (8,314472 JK-1mol-1) and 𝑇 is the absolute temperature.

2.4 - Internal resistance

Although it is common for manufacturers to give a single value for the internal resistance 𝑅𝑖𝑛𝑡 of a battery

cell, it is not constant. It depends on temperature, age and depth of discharge, for example.

Nevertheless, its value is obtained from the sum of two components [5]: the electric 𝑅𝑒𝑙𝑒𝑐𝑡𝑟𝑖𝑐 and ionic

𝑅𝑖𝑜𝑛𝑖𝑐 resistances. The first includes the resistance of the materials of construction (active materials of

the electrodes, internal components and electrical connectors). The latter encompasses factors resulting

from the movement of ions within the cell, which include electrolyte conductivity, ionic mobility, electrode

porosity, electrode surface area, etc. Hence,

𝑅𝑖𝑛𝑡 = 𝑅𝑖𝑜𝑛𝑖𝑐 + 𝑅𝑒𝑙𝑒𝑐𝑡𝑟𝑖𝑐 (2.6)

Page 22: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

7

2.5 - Charge transfer – electrodes

Considering equation 2.5 and a kinetic analysis, current flowing through the electrodes comes from the

difference between two currents: one originated from the reduction reaction and the other originated

from the oxidation reaction,

𝑖 = 𝑛𝐹𝐴𝑘𝐶𝑂𝑒𝑥𝑝

−𝛼𝑛𝐹𝐸𝑐0

𝑅𝑇⏟ 𝐼𝑎𝑐

− 𝑛𝐹𝐴𝑘𝐶𝑅𝑒𝑥𝑝(1 − 𝛼)𝐹𝐸𝑐

0

𝑅𝑇⏟ 𝐼𝑐𝑎

(2.7)

where 𝐴 is the area of the electrode, 𝑘 the rate constant, 𝐶𝑂 and 𝐶𝑅 are the concentrations of oxidized

and reduced elements, respectively, at the surface of the electrode, 𝐸𝑐0 the formal standard potential

and 𝛼 is the transfer coefficient. [6]

Hence, 𝐼𝑎𝑐 is the current that goes from the anode to the cathode and 𝐼𝑐𝑎 the current that goes from the

cathode to the anode.

2.6 - Mass transfer

The transfer of matter from the electrolyte to the electrode and vice versa is designated by mass transfer.

It can occur in three different ways: convection, electrical migration and mass diffusion. [7]

Convection

This phenomenon is related to the movement of materials under the effect of a temperature gradient or

mechanical agitation.

Electrical migration

The electrical field established in the electrodes is an important part of the mass transfer. It is known

that an electrical field exerts an electric force to charged particles. Therefore, those particles acquire

acceleration, which means, they start moving.

Diffusion

It is typically the dominant process in batteries. Diffusion is the movement of particles under the effect

of a concentration gradient, whose expression is given by Fick’s first law:

Page 23: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

8

𝐽(𝑥, 𝑡) = −𝐷

𝜕𝐶(𝑥, 𝑡)

𝜕𝑥 (2.8)

where 𝐽 is the diffusion flux, 𝐷 the diffusion coefficient and 𝐶 the substance’s concentration.

2.7 - Redox Equations

2.7.1 - Redox equations - Lithium Cobalt Oxide Battery

Figure 2.2 - Charge and discharge mechanisms of lithium ion rechargeable batteries (taken from [17]).

A typical Lithium Cobalt Oxide battery is comprised of a graphite negative electrode (anode), a non-

aqueous liquid electrolyte, and a positive electrode (cathode) formed from layered LiCoO2 (Figure 2.2).

During charging, lithium ions are extracted from the layered LiCoO2, the intercalation host, pass through

the electrolyte, and intercalate between the graphite layers in the anode. Discharge is the reverse of this

process. The electrons pass through the external circuit.

Cathode: LiCoO2

Anode: C6

Cathode reactions

𝐿𝑖𝐶𝑜𝑂2

𝐶ℎ𝑎𝑟𝑔𝑒→←

𝐷𝑖𝑠𝑐ℎ𝑎𝑟𝑔𝑒

𝑥𝐿𝑖+ + 𝑥𝑒− + 𝐿𝑖1−𝑥𝐶𝑜𝑂2 (2.9)

Page 24: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

9

Anode reactions

𝐶6 + 𝑥𝐿𝑖

+ + 𝑥𝑒−

𝐶ℎ𝑎𝑟𝑔𝑒→←

𝐷𝑖𝑠𝑐ℎ𝑎𝑟𝑔𝑒

𝐿𝑖𝑥𝐶6 (2.10)

Global reaction

𝐿𝑖𝐶𝑜𝑂2 + 𝐶6

𝐶ℎ𝑎𝑟𝑔𝑒→←

𝐷𝑖𝑠𝑐ℎ𝑎𝑟𝑔𝑒

𝐿𝑖1−𝑥𝐶𝑜𝑂2 + 𝐿𝑖𝑥𝐶6 (2.11)

When the battery is overcharged some lithium ions that are extracted from the layered LiCoO2 are lost,

i.e. leading to an irreversible reaction (2.12), destroying the layer of the active material of the cathode.

Overcharge up to 5.2V: LiCoO2 → L𝑖+ + CoO2 (2.12)

2.7.2 - Redox equations - Lithium Iron Phosphate Battery

The charging/discharging cycle of the Lithium Iron Phosphate Battery is the same of the Lithium Cobalt

Oxide battery, previously explained, but now the lithium ions are extracted from the layered LiFePO4,

Cathode: LiFePO4

Anode: C6

Cathode reactions

𝐿𝑖𝐹𝑒𝑃𝑂4

𝐶ℎ𝑎𝑟𝑔𝑒→←

𝐷𝑖𝑠𝑐ℎ𝑎𝑟𝑔𝑒

𝑥𝐿𝑖+ + 𝑥𝑒− + 𝐿𝑖1−𝑥𝐹𝑒𝑃𝑂4 (2.13)

Anode reactions

𝐶6 + 𝑥𝐿𝑖

+ + 𝑥𝑒−

𝐶ℎ𝑎𝑟𝑔𝑒→←

𝐷𝑖𝑠𝑐ℎ𝑎𝑟𝑔𝑒

𝐿𝑖𝑥𝐶6 (2.14)

Global reaction

𝐿𝑖𝐹𝑒𝑃𝑂4 + 𝐶6

𝐶ℎ𝑎𝑟𝑔𝑒→←

𝐷𝑖𝑠𝑐ℎ𝑎𝑟𝑔𝑒

𝐿𝑖1−𝑥𝐹𝑒𝑃𝑂4 + 𝐿𝑖𝑥𝐶6 (2.15)

Page 25: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

10

2.8 - Comparative Analysis between LiFePO4 and LiCoO2 Batteries

There is a considerable energy associated to the lithium intercalation reaction in LixCoO2 or

LixFePO4 against metallic lithium. The reverse process, recharging the battery, requires more energy

and is only achieved, without huge losses (heat production), thanks to the discovery of intercalation

materials as LixC6 Graphite, for example (Figure 2.3). These materials can host lithium without any major

structural changes, which increases their life cycles number.

Figure 2.3 – Schematic illustration of the charge and discharge

processes of a LiCoO2 battery with a LixC6 Graphite anode [18].

Generally, lithium is oxidized (i.e., loses electrons), creating a potential at that electrode. The

released energy in the oxidation process is consumed in an external load during the discharge of the

cell. However, the formation of basic lithium oxide (Li2O) cannot be reversed electrochemically without

destroying the battery. Therefore, instead of direct oxidation, the lithium is ‘incorporated’ in an

intercalation host material (CoO2 or FePO4) of the positive electrode, as illustrated in Figure 2.3. The

advantage of this process is its reversibility: during charging of the cell where the lithium is extracted

from its host, while the basic CoO2 or FePO4 lattice structure remains intact. Upon the following cell

discharge, the lithium is again re-intercalated.

The amount of lithium that can be intercalated reversibly into the electrode determines the capacity of

the battery. In case of a LixCoO2 cathode, the limit for a reversible intercalation is x = 0.55. Figure 2.4

shows how the Open Circuit Voltage (OCV) of LixCoO2 electrode (against metallic lithium) varies with

the lithium concentration x and that its reversible intercalation range stays around [0.52, 0,98].

Page 26: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

11

Figure 2.4 - The Open Circuit Voltage of a commercial LiCoO2 electrode recorded against metallic lithium as a function of the degree of lithium intercalation (25°C) [19].

In the case of a LiFePO4 cathode, results in Figure 2.5 indicate that its maximum reversible

intercalation range stays around [0.45, 0,98], which is more than the LixCoO2 battery, around 60%.

Figure 2.5 - The charge-discharge curve for the delithiation of LiFePO4 [22].

The use of metallic lithium for anodes in commercial batteries is considered hazardous. For this reason,

it has been replaced by another intercalation material, lithiated graphite, which exhibits an energy level

close to the one of metallic lithium as shown in Figure 2.6., i.e. LiC6 (~0.1V vs. Li for x > 0.5).

Page 27: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

12

Figure 2.6 - Charge–discharge profile of LixC6 electrode [23].

During charge-discharge cycling of the cell, lithium ions are transferred from the negative intercalation

host to the positive host and vice versa. This cell type is known as ‘lithium-ion’ battery.

Assuming a percentage of 50% to 60% of the amount of lithium (x = 0.5 to x = 0.6) for batteries with

LixCoO2 cathode, which can be intercalated reversibly into the electrode, one can estimate the open

circuit voltage of the battery. As indicated on table 2.1, it can be obtained an electrical potential difference

between 4.13 to 4.25 volts.

Cathode

Li(x)CoO2

Anode

Li(1-x)C6

Cathode

E0, V

Anode

E0, V

Battery

E0, V

x = 0.6 1-x = 0.4 4.03 V ~0.1 V 4.13 V

x = 0.5 1-x = 0.5 4.15 V ~0.1 V 4.25 V

Table 2.1 – Open circuit voltage calculation of a Li(x)CoO2 battery.

Assuming a delithiation of the LixFePO4 cathode to an x = 50% to 60%, it is possible to calculate

an estimated open circuit voltage of a battery with this type of cathode. As indicated on table 2.2, it is

obtained an electrical potential difference of 3.473 to 3.475 volts.

Cathode

Li(x)FePO4

Anode

Li(1-x)C6

Cathode

E0, V

Anode

E0, V

Battery

E0, V

x = 0.5 1-x = 0.5 3.373 V ~0.1 V 3.473 V

x = 0.4 1-x = 0.6 3.375 V ~0.1 V 3.475V

Table 2.2 - Voltage calculation of a LixFePO4battery.

Page 28: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

13

LiCoO2 battery cells are by far much more used in electrical traction vehicles than the LiFePO4 ones,

since the latter appeared posterior. However this is changing mostly because LiFePO4 batteries offer a

major advantage: higher thermal stability and consequently lower risk of fire/explosion when compared

to LiCoO2 batteries. Another great advantage is the cheaper cost of iron comparing to cobalt, since it is

abundant in the earth crust. In addition, LiFePO4 cell batteries are environmentally friendly, unlike

LiCoO2 ones since cobalt is very toxic.

When it comes to battery characteristics such as voltage [13], cathode’s specific capacity [13], cell’s

specific energy and cell’s specific capacity, table 2.3 resumes those specifications for both materials:

LiCoO2 and LiFePO4. Note that those values are often only theoretical values. Practical ones tend to be

lower.

Cathode Cell’s Voltage

[V]

Cathode’s

specific capacity

[mAh/g]

Cell’s specific

capacity [mAh/g]

(1)

Cell’s specific

Energy [Wh/Kg]

(1)

LiCoO2 3,9 274 158 616.2

LiFePO4 3,5 169 116 406

Table 2.3 - Comparison between LiCoO2 and LiFePO4 cathodes (theoretical values).

(1) Considering the negative electrode is the same (LiC6) and has a specific capacity of 2,69 g/(Ah), cell’s specific

capacity and specific capacity and energy for both electrodes (cell) were obtained.

As indicated in the previous table, the batteries with both cathodes present similar values, except for the

cathode’s specific capacity, which is greater for the LiCoO2 cathode which will result in a battery with a

higher specific energy.

2.9 - Stability Comparative Analysis: LiFePO4 x LiCoO2

LiFePO4’s stability comes from its decomposition reaction when exposed to high temperature. Oxygen

is not released, at least for temperatures up to 350oC as it can be seen in Figure 2.7. Therefore, there

is a low risk of fire. On the other hand, in LiCoO2’s decomposition reaction [1] there is oxygen released

(2.16), which make this compound unsafe for temperatures above 200 oC, as it can be seen in Figure

2.7 [2]. This happens because of the strong P-O bond in the LiFePO4. The necessary energy to break

this link is approximately 62% higher than the energy needed to disrupt the Co-O bond in LiCoO2 [3].

Therefore, there is less chances for LiFePO4 batteries to release oxygen than LiCoO2 for the same

temperature, which makes the first ones much safer. The LiFePO4’s batteries becomes extremely stable

in overcharge and short circuit conditions, unlike LiCoO2’s batteries.

Page 29: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

14

𝐿𝑖𝑥𝐶𝑜𝑂2 → 𝑥𝐿𝑖𝐶𝑜𝑂2 + (

1 − 𝑥

3)𝐶𝑜3𝑂4 + (

1 − 𝑥

3)𝑂2 (2.16)

Figure 2.7 - Release of energy evolution of lithium ion batteries with temperature [3].

Page 30: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

15

2.10 - Conclusion

Basically the purpose of this chapter is to introduce the basic principles of operation of lithium batteries

and justify the replacement of the LiCoO2’s batteries, one of the most common batteries types for

portable and isolated applications, by the LiFePO4’s batteries submitted under study in this thesis.

As demonstrated, these batteries have very similar characteristics, with almost identical operation. The

LiFePO4’s batteries present a slightly lower open circuit voltage and a lower capacity, which can be

important due to the nature of the application for which the batteries are used, for example in electric

vehicles, for an equal capacity, more weight is needed in LiFePO4’s than LiCoO2’s batteries, presenting

a disadvantage. But an important factor which prevails the priors, is the thermal stability of the LiFePO4

battery which is much superior than the one of the LiCoO2 battery. The LiFePO4 battery is extremely

stable, unlike the LiCoO2 battery, it can work safely for a wide range of temperatures which represents

a major advantage, since portable and isolated applications normally are submitted to a wide range of

temperatures, making those batteries more secure which is an extremely important requirement for this

type of applications.

Page 31: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

16

3 - The State of Charge (SOC) Estimating Methods

3.1 - The state of charge

The SOC of a battery is a measure of the amount of its stored electrical energy. The prediction

of the state of charge can be performed by invasive methods and non-invasive methods. Invasive

methods are based on the chemical oxidation state of the active materials and are performed in

laboratories. This method requires the batteries to be offline.

Nowadays, the existence of mobile systems with batteries such as electric vehicles, battery operated

power tools, or temporary storage systems for renewable energy sources, therefore sealed batteries

technology, it requires the prediction/estimation of the state of charge with non-invasive methods. Thus,

the research for non-invasive and instantaneous methods for SOC determination is becoming dominant.

Main techniques for SOC estimation are based on: coulomb counting, voltage or current pulse response,

open circuit voltage and battery impedance measure.

The coulomb counting technique simply indicates the remaining capacity of the battery by using

electric current integration according with the coulomb counting equation (3.1) [8]: initial SOC

(𝑆𝑂𝐶0), coulombic efficiency (𝜂), battery estimated capacity (𝐶𝑛) and current (𝑖(𝑡)).

SOCt = 𝑆𝑂𝐶0 − ∫

𝜂𝑖(𝑡)

𝐶𝑛

𝑡

0

𝑑𝑡 (3.1)

However, this technique lacks precision due to the inaccuracy of the initial SOC, the low

accuracy of the coulomb counting technique itself, the noise from the sensors for the acquisition

of the respective magnitudes and the increase over time of the error in the SOC estimation.

Furthermore, this model is unable to accurately match the nonlinear behavior of the battery over

its entire lifetime.

The open circuit voltage (OCV) of a battery declines with the decrease of SOC [9].

Consequently, its value can be used to estimate the battery SOC. The main disadvantages of

this technique is that it requires a long waiting time for the batteries OCV to reach a steady-state

condition after use and mainly its measurement can only be effectuated while the battery is

offline.

Another alternative for SOC estimation is through the analysis of the electric current or voltage

of the battery [8]. This technique is usually performed using Kalman filters or other heavy

computational on-line parameter-estimation methods. Eventually, if the characteristics of the

battery change due to drastic changes this method does not always follow the “new” battery

model since that technique is a model-based one.

Page 32: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

17

Battery impedance measure: acquiring in an off-line way various impedance measures over a

wide range of frequencies and for several different SOCs, technique referred as electrochemical

impedance spectroscopy (EIS), one can identify a relationship between the battery SOC and

respective impedance. With this, the battery’s SOC can be estimated through a comparative

analyses of impedance battery curves (pattern recognition).

3.2 - Relationship between SOC and OCV

The OCV of a standard LiFePO4battery in function of SOC can be visualized in Figure 3.1.

This relationship between OCV and SOC makes it a very simple way to estimate a battery’s SOC. There

are only a few factors that can change the value of OCV for each defined battery SOC, hence changing

the initial OCV-SOC relation. The main factors are temperature and the number of cycles

(charge/discharge) of the battery. When these parameters change, a small variation of OCV is observed.

This variation is often neglected since the variation is very small.

The relationship between OCV and the previous factors is trivial since the variation is almost linear.

Figures 3.2 and 3.3 show, respectively, the variation of SOC with temperature and with the number of

battery cycles.

Figure 3.1 - Plot of OCV in function of SOC. [9]

Page 33: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

18

Figure 3.2 - Open circuit voltage in function of SOC for different temperatures [10].

3.2.1 - Main disadvantage estimating SOC using OCV value

The main disadvantage of estimating SOC through the OCV is that when the battery is either discharging

or charging, the operating voltage can be different from the OCV. Operating voltage depends on the

characteristics of the respective battery and the load. Therefore, after disconnecting the battery from the

load or charging source, it requires a period of time for the OCV to reestablish its normal values. This

characteristic can be observed in Figure 3.4 where this period of time stayed around 10 minutes

Figure 3.3 - Open circuit voltage in function of SOC for different cycles [11].

Page 34: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

19

Figure 3.4 - OCV after discharging and charging [12].

To estimate the SOC in function of OCV, the battery needs to be offline and requires a period

of time for the voltage to reach a steady state condition after use, making impossible instantaneous SOC

measuring. As observed in the previous Figure 3.4, the OCV of the battery after discharging (time: t1)

and after charging (time: t3) requires a period of time to reach a steady state condition. This interval of

time will depends on how the battery has been used and mainly on its capacity.

3.2.1.1 - Solution

Given that disadvantage, a solution is developed in this thesis to solve this problem. Instead of

estimating the SOC directly with the measure of the OCV, which requires the battery to be disconnected

during a pre-defined period of time, an impedance spectra database of the battery is created for certain

SOC values.

For a number of values of OCV an EIS is performed and this data is saved on a “database of

impedance spectra and the respective OCV”. Since the OCV relationship with SOC is clear as observed

in Figure 3.1, this solution enables the calculation of SOC with the comparison of the current battery

impedance characteristic and the impedance characteristic curves in the database. This pattern

recognition technique allows SOC estimation without needing to disconnect the battery and wait for the

OCV to reach a steady state condition. To measure the battery impedance through an EIS (explained

on the next sub chapter), the battery does not need to be unplugged. This can be done online while the

battery is charging or discharging without modifying the respective battery’s characteristics while the

EIS is performed. The only time it is required to unplug the battery is when the impedance database is

created and when it needs to be updated since the battery impedance varies because of certain factors

as, for example, number of cycles, as it will be explained in further chapters.

Page 35: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

20

Concerning the creation of the database of impedance spectrums with their respective OCV,

this procedure begins with the battery discharged and waiting a necessary time interval for the voltage

to reach a state of rest. The OCV is then measured and an EIS measurement is performed. Through

the battery charging for a fraction of time and repetition of the previous procedure until the battery is

charged, one can obtain an initial database of impedance spectrums and respective OCV for a set of

SOC values like 25%, 50%, 75% and 100%, for example. This type of procedure would only be done to

create the initial impedance database and mainly when it needs to be updated.

The increase of the number of impedance spectrum measurements during the charging process causes

the battery to take longer to charge because of the time interval needed for its voltage to reach a state

of rest. Taking into account that the battery impedance varies with increasing number of cycles, this

database needs to be updated periodically. In our study, the database of impedance spectrums at the

respective OCV (with corresponding SOCs) has been updated every month.

Regarding the selection of SOC values for the database, it is preferable to have them equally spaced

and the criterion for choosing this number of selected SOCs has to be based in the analysis of the

compromise between battery charging time and the number of outputs (method analyzed in Chapter 5)

or accuracy of SOC estimation (method analyzed in Chapter 6). The greater the desired precision, the

more impedance spectrum measurements are needed, subsequently longer battery charging, also

taking into account the OCV relaxation time.

For example, from the data supplied by VITO, consider the four impedance spectrums shown in Figure

3.5 for 25%, 50%, 75% and 100% values of SOC.

Performing during a normal usage of the battery and in a regular way an EIS experiment to

acquire the current impedance spectrum of the battery, , and matching it with those ones already in the

database, the battery SOC can be estimated. In this thesis, this matching between EIS with the database

of impedances has been performed using fuzzy logic, which will be explained in Chapter 5.

3.3 - Electrochemical impedance spectroscopy (EIS)

EIS is also an experimental technique for characterizing electrochemical systems. This

technique acquires the impedance of a system over a wide range of frequencies, and thus the frequency

response of the system. Often, data obtained by EIS is expressed graphically in a Bode plot or a Nyquist

plot.

EIS is a very sensitive technique, since the perturbing AC signal is set very small, with the resultant

polarization of the electrode staying in a linear potential region, so there is no destructive damage of the

electrode.

Page 36: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

21

3.3.1 - Relationship between battery’s SOC and its impedance spectrum

In this dissertation, the impedance data analyzed and studied of LiFePO4 batteries with a

capacity of 7 Ah each one, was provided by VITO, the Flemish Institute for Technological Research.

The frequency range used on all EIS is between 0,05 Hz and 10019,5 Hz (indicated in annex 1), with

each range performed twice for each SOC.

Figure 3.5 plots the impedance spectra measurements acquired by EIS technique for a battery

with one month of use, 0ºC of ambient temperature and four SOCs: 25% (red), 50% (yellow), 75% (cyan)

and 100% (blue). It can be observed a relationship between the impedance curve profile and its SOC

value.

According to VITO, the impedance spectra of the battery has been obtained with a periodic interval of

one month. To show how the impedance changes over time, Figure 3.6 plots the impedance spectrum

of the battery after two month of use. Comparing the impedance for 100% SOC (blue curve) at the first

month of use (Fig. 3.5) with that one in the second month (Fig. 3.6) a significant change of impedance

is observed.

1.5 2 2.5 3 3.5 4 4.5 5 5.5 6

x 10-3

-4

-3

-2

-1

0

1

2

3x 10

-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

Figure 3.5 - EIS for 25% (red), 50% (yellow), 75% (cyan) and 100% (blue) of SOC. (0ºC, 1𝑠𝑡month)

Page 37: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

22

.

As the impedance of the battery varies over time (real battery model), it is difficult to implement a fixed

model, which simulates the battery’s behavior, that unequivocally allows the reading of the battery SOC

as a function of the respective impedance profile. Notice that impedance variation is not linear, which

presents a major pattern recognition problem. It is in this context that in further chapters are presented

a set of methodologies to estimate SOC in function of impedance. Those methodologies combine

important techniques as: EIS, SOC estimation through OCV measuring and a fuzzy inference system

(Chapter 5) or linear interpolation (Chapter 6).

Figure 3.6 - EIS for 25% (red), 50% (yellow), 75% (cyan) and 100% (blue) of SOC. (0ºC, 2𝑛𝑑month)

Page 38: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

23

4 - Fuzzy Inference System

4.1 - Introduction

This chapter is based on the PhD thesis of Paulo José da Costa Branco, ”Aprendizagem por exemplos

utilizando lógica “fuzzy” na modelização e controlo de um accionamento electrohidráulico”.

The modeling techniques for nonlinear systems use nowadays differential equations, difference

equations or partial differential equations. The establishment of these mathematical models with those

techniques causes a too limited representation of the behavior of the physical system, reducing the

overall performance of the designed controller.

The main disadvantages of the referred modeling techniques are:

They are unable to include further information acquired through experimental discovery and

invention and to solve problems through experience (own experience or observed).

More complex systems sometimes present nonlinear relations that are not included in the

model set.

They don’t represent the time variability that might exist for some variables.

With conventional techniques it is, in certain cases, difficult to obtain the mathematical model of certain

systems, for this type of cases neural networks and linguistic systems, fuzzy systems, have been used.

The first type of technique can be identified as an identification method type “black box”. The information

contained in these systems is hardly interpreted, preventing proper addition of other information, such

as knowledge acquired by experience. The second type of technique in modeling systems using

methodologies based on fuzzy logic, information on dynamic behavior of the system is expressed

through a set of rules that make up a linguistic model. With this type of model it’s possible to generalize,

add or change information when necessary.

This section is reserved to the presentation of the main features of linguistic models in the description

of systems and the set of mathematical formalisms based on fuzzy logic that will make up its structure.

4.2 - Characteristics of the fuzzy model

In this section are presented the characteristics of fuzzy models. In order to show the ability of this

type of models, a simple functional relation in order to understand the characteristics and potential of

the model is presented.

Page 39: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

24

For our model example, the function 𝑦 = 𝑥2 is considered, which relates the input (variable x) with the

output (variable y), for each value of x, only one value of the domain y is defined, as shown in Figure

4.1.

Figure 4.1 - Plot 𝑦 = 𝑥2.

The function can be discretized over the values x = 1, 3, 5, 7 and 9, illustrated in Figure 4.2, formulating

a set of relations, referred in the literature crisp relations, which can be expressed accordingly with the

equation (4.1).

If x ϵ [0,2] Then y = (1)2

If x ϵ ]2,4] Then y = (3)2

If x ϵ ]4,6] Then y = (5)2

If x ϵ ]6,8] Then y = (7)2

If x ϵ ]8,10] Then y = (9)2

(4.1)

Figure 4.2 - Discrete plot of 𝑦 = 𝑥2.

0 1 2 3 4 5 6 7 8 9 100

10

20

30

40

50

60

70

80

90

100

x

y

Page 40: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

25

Considering that the information we have about the functional relation cannot be described in a precise

mathematical way (𝑦 = 𝑥2), but can be implemented, in a third representation, in the form of a set of

linguistic rules such as:

Rule 1: If the value of x is Low, then y also presents a low value.

Rule 2: If the value of x is Moderate, then y presents a high value.

Rule 3: If the value of x is very high, then y presents a very high value.

In this representation, rather than numeric values, are used linguistic values such as Low, Moderate,

High and Very High, represented by triangular fuzzy sets established as shown in Figure 4.3.

Figure 4.3 - Fuzzy modulation of 𝑦 = 𝑥2.

These domains, by presenting a set of linguistic values in fuzzy logic are designated by the universes

of discourse of input and output establishing the fuzzy model for the functional relation 𝑦 = 𝑥2. An output

example of a linguistic fuzzy logic system, as shown in the Figure 4.3, can be seen in Figure 4.4.

Figure 4.4 - Ouput of the linguistic fuzzy logic system.

0 1 2 3 4 5 6 7 8 9 1010

20

30

40

50

60

70

80

90

100

input: x

ou

tpu

t

Page 41: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

26

4.3 - Types of fuzzy models

There are two types of fuzzy models, each with a different approach, linguistic or hybrid approach. The

difference between those two approaches is that in the linguistic approach the output is calculated based

on the linguistic rules If-Then and in the hybrid approach the output is obtained using the linguistic rules

If-Then and numerical calculations.

4.3.1 - Linguistic approach

The fuzzy linguistic modeling can be divided into two types: natural modeling and relational modeling.

The rules for the natural modeling are based on information provided by the knowledge gained by

experience of the process.

Relational modeling establishes, through the linguistic partition assigned to each variable, both input

and output, a set of all possible rules or relations that can model the system. And a degree of truth for

each rule or relation is established, this allows the division of relations into strong or weak. A relation

can be considered inexistent or may be ignored if the degree of relation is very low.

4.3.2 - Hybrid approach

This approach uses linguistic and numerical variables. This method has two phases, first the linguistic

variables are used then the output is computed with numerical variables as a function of the inputs. This

approach allows the use of techniques such as learning algorithms, like the gradient method for the

extraction of rules that compose the model. These learning algorithms are also used in neural networks,

thus the hybrid model has been named neuro-fuzzy.

4.4 - The rules and their grammatical structure in fuzzy logic

In order to model the functional relation 𝑦 = 𝑥2, three rules were used: 𝑅𝑢𝑙𝑒(1), 𝑅𝑢𝑙𝑒(2) and 𝑅𝑢𝑙𝑒(3). The

input variable was divided in three linguistics terms, Low, Moderate and high, represented by triangular

membership functions (described in Annex 2), the same was done for the output variable divided in

three linguistics terms, low, high, and very high, also with triangular membership functions.

Page 42: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

27

The rules for the fuzzy model of the functional relation 𝑦 = 𝑥2 can be represented as follows:

𝑅𝑢𝑙𝑒(1): 𝐼𝑓 (𝑥1𝑖𝑠 𝐿𝑜𝑤⏟

𝐴1(1)

) 𝑇ℎ𝑒𝑛 𝑦 𝑖𝑠 𝐿𝑜𝑤⏟𝐵(1)

,

𝑅𝑢𝑙𝑒(2): 𝐼𝑓 (𝑥1é 𝑀𝑜𝑑𝑒𝑟𝑎𝑡𝑒⏟

𝐴1(2)

) 𝑇ℎ𝑒𝑛 𝑦 𝑖𝑠 𝐻𝑖𝑔ℎ⏟ 𝐵(2)

,

𝑅𝑢𝑙𝑒(3): 𝐼𝑓 (𝑥1é 𝐻𝑖𝑔ℎ⏟

𝐴1(3)

) 𝑇ℎ𝑒𝑛 𝑦 𝑖𝑠 𝑉𝑒𝑟𝑦 𝐻𝑖𝑔ℎ⏟ 𝐵(3)

,

(4.2)

Where each linguistic term’s antecedent and consequent parts are represented by triangular

membership functions, respectively:

𝐴1(1) = µ

𝐴1 (1)(𝑥1) , 𝐵

(1) = µ𝐵(1)(𝑦),

𝐴1(2) = µ

𝐴1 (2)(𝑥1) , 𝐵

(2) = µ𝐵(2)(𝑦),

𝐴1(3) = µ

𝐴1 (3)(𝑥1) , 𝐵

(3) = µ𝐵(3)(𝑦).

(4.3)

Each proposition If-Then will make a membership function µ If->Then (x,y) that relates each one of the

variables of the antecedent part x = [x1,x2,…,xn] with its consequent variable y. This function will set the

membership degree of implication between the two parts of each rule antecedent and consequent.

A1(ℓ)× …× An

(ℓ) → 𝐵(ℓ) (4.4)

A major drawback for a linguistic modeling when used in implementing controllers is that it requires a

high computational time and effort and does not present a simple framework for implementing an

algorithm of learning programs, making the process time consuming and complicated.

Faced with this problem, the hybrid model has a great advantage. For this model it’s possible to replace

the membership functions of the consequent variable into a numeric value that is obtained by a learning

mechanism. This value can be interpreted as a center of gravity named as singleton. The center of

gravity here is understood as the average value for the domain of each membership function as

represented in the figure 4.5 with ω(1), ω(2) and ω(3).

Page 43: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

28

Figure 4.5 - Representation of the operation domain of the system using triangular membership functions and the respective singletons.

Changing the subsequent part of the rule for singletons, the rules for the fuzzy model of the functional

relation 𝑦 = 𝑥2 can be represented as follows:

𝑅𝑢𝑙𝑒(1): 𝐼𝑓 (𝑥1𝑖𝑠 𝐿𝑜𝑤⏟

𝐴1(1)

) 𝑇ℎ𝑒𝑛 𝑦 𝑖𝑠 ω(1),

𝑅𝑢𝑙𝑒(2): 𝐼𝑓 (𝑥1𝑖𝑠 𝑀𝑜𝑑𝑒𝑟𝑎𝑡𝑒⏟

𝐴1(2)

) 𝑇ℎ𝑒𝑛 𝑦 𝑖𝑠 ω(2),

𝑅𝑢𝑙𝑒(3): 𝐼𝑓 (𝑥1𝑖𝑠 𝐻𝑖𝑔ℎ⏟

𝐴1(3)

) 𝑇ℎ𝑒𝑛 𝑦 𝑖𝑠 ω(3),

(4.5)

When the product operator for the coordinating conjunction is selected, the degree of activation of the

antecedent part is obtained by multiplication of the corresponding degrees of membership of the

linguistics terms of the rule ℓ (ℓ = 1,…,Total number of rules) in function of their numerical values 𝑥1′,

𝑥2′,…, 𝑥𝑛′. The degree of activation is then specified by the next equation.

µ( Rule (ℓ)) = µ𝐴1 (ℓ)(𝑥1′).… . µ𝐴𝑛

(ℓ)(𝑥𝑛′) (4.6)

4.5 - Inference Mechanism

In the inference mechanism, all rules are "activated" by the parallel input signals 𝑥1′, 𝑥2′, … , 𝑥𝑛′.

Therefore, a certain degree of activation is attributed to each rule, µ( Rule(ℓ) ), calculated by the product

of the degrees of membership for each linguistic term, (4.6).

The inference process involves the response of each ω(ℓ) weighted by the respective degree rule

activation µ( Rule(ℓ) ), and the sum of all the normalized responses as shown in equation (4.7). In this

y

x

ω(1)

ω(2)

ω(3)

𝐴1(1) 𝐴1

(2) 𝐴1(3)

𝐵(1)

𝐵(2)

𝐵(3)

Page 44: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

29

expression, the variable c represents the total number of rules used in the inference, and Y is the

numerical value inferred in the model.

Y = ∑ µ( Rule(ℓ)).ω(ℓ)𝑐ℓ=1

∑ µ( Rule(ℓ))𝑐ℓ=1

(4.7)

4.6 - Learning by examples using fuzzy logic

The construction of a system with fuzzy logic by human operator, through the IF-THEN rules, is not

always the most accurate method.

An improved system with fuzzy logic can be constructed using quantitative observations about the

functioning of the system instead of setting the rules IF-THEN using a human operator. It can be

obtained either through the collection of numerical values of the variables considered most

representative of the behavior of the system or the simulation results using an approximate

mathematical system for the study of the behavior model.

A great tool for the extraction of a model with fuzzy logic through quantitative observations about the

functioning of the system is named Simplified fuzzy algorithm. The operation of such algorithm is shown

trough a basic example using only two variables, each one with its domain divided into 5 membership

functions as it can be observed in Figure 4.6.

Figure 4.6 - Representation of the domain partitions of the system using triangular membership functions.

X2

X1

Membership

function 1

Membership

function 2

Membership

function 3

Membership

function 4

Membership

function 5

Me

mb

ers

hip

fun

ctio

n 1

Me

mb

ers

hip

fun

ctio

n 2

Me

mb

ers

hip

fun

ctio

n 3

Me

mb

ers

hip

fun

ctio

n 4

Me

mb

ers

hip

fun

ctio

n 5

Page 45: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

30

By combining the membership functions of each variable we obtain the different rules of the system. For

example rule is obtained combining the membership function 4 of the variable X1 with the membership

function 2 of the variable X2, shown on Figure 4.7.

Figure 4.7 - Graphical representation of rule symbolized by the white rectangle.

The goal will be to calculate the fuzzy singleton or "center of gravity" of each rule using qualitative

observations as displayed in Figure 4.8. For example, to calculate the singleton for the previous rule,

the only used data is the one present at the intersection of the domain of the two membership functions

as shown in the same figure, represented by black dots.

X2X

1

Membership

function 1

Membership

function 2

Membership

function 3

Membership

function 4

Membership

function 5M

em

be

rsh

ip

fun

ctio

n 1

Me

mb

ers

hip

fun

ctio

n 2

Me

mb

ers

hip

fun

ctio

n 3

Me

mb

ers

hip

fun

ctio

n 4

Me

mb

ers

hip

fun

ctio

n 5

Rule

Page 46: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

31

Figure 4.8 - Set of examples relating to extraction of the rule whose antecedent part is defined by the fuzzy sets Membership function 4 [X1] and Membership function 2 [X2].

For each point we have an output (𝑥1′, 𝑥2′) y’, this output is in function of each membership

function as shown in the next equation:

µ𝑀𝑒𝑚𝑏𝑒𝑟𝑠ℎ𝑖𝑝 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 4(𝑥1′). µ𝑀𝑒𝑚𝑏𝑒𝑟𝑠ℎ𝑖𝑝 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 2(𝑥2′) = 𝑦′

(4.8)

Calculating this output for all black points, we obtain several values for the variable y, for example:

Figure 4.9 - Representation of the membership function induced and 𝜔(ℓ), which is the value extracted as

conclusion of the 𝑅𝑢𝑙𝑒(ℓ).

In the previous example it is possible to observe a maximum which is used as singleton or center of

gravity for this rule.

X2

X1

Membership

function 1

Membership

function 2

Membership

function 3

Membership

function 4

Membership

function 5

Me

mb

ers

hip

fun

ctio

n 1

Me

mb

ers

hip

fun

ctio

n 2

Me

mb

ers

hip

fun

ctio

n 3

Me

mb

ers

hip

fun

ctio

n 4

Me

mb

ers

hip

fun

ctio

n 5

1

y

Page 47: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

32

4.7 - Basic steps of the algorithm

The simplified fuzzy algorithm can be divided into 8 steps:

Step 1 - Set the number, the type (for example triangular or Gaussian) and the limits of membership

functions for each variable of the fuzzy system.

Step 2 - For each observation k the output is collected as indicated by the expression:

(𝑥1′(𝑘), 𝑥2′(𝑘), … , 𝑥𝑛′(𝑘)) ⟶ 𝑦′(𝑘)

(4.9)

Step 3 - For each input and output is constructed one vector, 𝑥𝑖(𝑘) and 𝑦(𝑘) respectively, each variable

contains the membership degree of all observations, accordingly with the expressions [4.10], where the

terms ni and ny designate the number of fuzzy sets assigned to the variable 𝑥𝑖 and variable 𝑦(𝑘)

respectively.

𝑥𝑖(𝑘) = [𝐴1(ℓ)𝐴2(ℓ)…𝐴𝑛𝑖

(ℓ)]

𝑦(𝑘) = [𝐵1(ℓ)𝐵2(ℓ)…𝐵𝑛𝑦

(ℓ)]

(4.10)

Step 4 - For each observation point and for each variable (i) is calculated the highest membership

degree using the operator max (.) on the vectors 𝑥𝑖(𝑘) and 𝑦(𝑘).

Step 5 - The implication degree is calculated using the maximum values of step4 accordingly with the

next expression:

Implication degree = [𝑥1(𝑘)]𝑚𝑎𝑥 .… . [𝑥𝑛(𝑘)]𝑚𝑎𝑥 . [𝑦(𝑘)]𝑚𝑎𝑥 (4.11)

Step 6 - By step 4, only the samples with a degree of membership greater than 0.5 in the linguistic

antecedent part of the rule are used. For each observation point inside the same region, that is the same

linguistic rule, the implication degrees are compared one after the other, to extract the final numerical

value for the respective subsequent part ω(𝑙)(𝑘).

{𝜇(𝑅(ℓ)(𝑘))

𝐴1(ℓ)×…×𝐴𝑛

(ℓ)→ 𝐵(ℓ)> 𝜇(𝑅(ℓ)(𝑘 − 1))

𝐴1(ℓ)×…×𝐴𝑛

(ℓ)→ 𝐵(𝑙) ⇒ 𝜔(ℓ)(𝑘) = 𝑦′(𝑘)

𝜇(𝑅(ℓ)(𝑘))𝐴1(ℓ)×…×𝐴𝑛

(ℓ)→ 𝐵(ℓ)< 𝜇(𝑅(ℓ)(𝑘 − 1))

𝐴1(ℓ)×…×𝐴𝑛

(ℓ)→ 𝐵(ℓ) ⇒ 𝜔(ℓ)(𝑘) = 𝜔(ℓ)(𝑘 − 1)

(4.12)

Step 7 – When there are observation points, for a given rule, with the same antecedent linguistic terms

but with a different linguistic term in the consequent part of the rule they are said to be in conflict. To

solve this problem, we choose the rule with the highest degree of implication.

Step 8 - It is verified that all observation points were analyzed in this algorithm, it does not return to the

step 2.

Page 48: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

33

5 - SOC estimation method (Impedance profile comparative

analysis) applying a Fuzzy Inference System

In this chapter a first SOC estimation method is proposed. This estimation is based on a comparative

analysis of impedance profiles.

The method is not online since it does not permit a continuous estimation of the battery’s SOC for the

entire range of SOC (0% to 100%). This method allows the estimation of SOC but only for a set of

predefined SOCs, for which was previously made an EIS experiment. The method compares the current

battery impedance with previously impedances measures and, when a match exists, the output is the

SOC of the respective matched impedance of the database. This match making is performed with FISs,

as it will be described in the following sections.

5.1 - Construction of FISs with the EISs impedance data

The impedance spectrum for each SOC is obtained through EIS. This chapter presents a

methodology to estimate the battery’s SOC through comparative analysis of its actual impedance

spectrum (current battery condition) with the impedance spectrum previously built with the EIS technique

and stored in the database. This database will be composed of several impedance spectrum

measurements and the respective SOC.

Assuming that the database has already been created with four EIS made for different random*

battery SOC's equally spaced, more precisely for 25, 50, 75 and 100%, thereby obtaining the impedance

spectra, it is possible to construct the comparison system of impedances. This comparative analysis is

done through a fuzzy system that uses only two input variables: the real part of complex impedance

(resistance) and its imaginary part (reactance). The output of the fuzzy system will be the battery’s SOC.

Using the same experimental data of impedance as used before (EIS of the battery with a SOC of 25%,

50%, 75% and 100%, Chapter 3 - Figure 3.5), the domain of each input variable was divided into

membership functions. Instead of triangular membership functions, Gaussian ones were used. The

Gaussian function, expressed in equation 5.1, depends on two parameters: standard deviation

represented by σ and mean or expectation value given by µ. For example, for µ = 5 and σ = 2, 𝑓(𝑥, 2,5)

as illustrated in Figure 5.1.

* In this thesis, EIS data used in this method was provided and performed by VITO Institute for

fixed SOC values. The proposed method operates equally for other SOC values.

Page 49: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

34

𝑓(𝑥, σ, µ) = 𝑒−(𝑥−µ)2

2σ2 (5.1)

Figure 5.1 - Gaussian curve membership function (µ = 5 and σ = 2).

Analyzing previously the impedance spectrum of the battery in Figure 5.3, it’s observable that these

impedance spectrums occupy roughly 20%-30% of the respective referential space (-Img (Z) × Re (Z)).

To build a fuzzy system able to distinguish each different SOC impedance spectroscopy, it is necessary

to create several rules in a way that they can separate each different impedance spectroscopy of each

SOC with enough precision. The required number of rules that can ensure an accurate and correct

system is approximately half the number of data points in the system itself, i.e. one rule for every two

measurements of the same frequency for each SOC. In our case, each impedance spectroscopy is

composed of 38 impedance measurements (each one with different frequencies, indicated in Annex 1),

and for each SOC there are two impedance spectrums. Since there are 5 different SOCs, a total number

of 380 data points have been obtained. Since 30 membership functions for each input result in a total

number of 900 rules, and because the respective impedance spectrums occupy 20 to 30% of the space,

from 900 rules only 180 to 270 are included in that space, which is approximately half of the total number

of measurement points in the system. This justifies the use of 30 membership functions equally spaced

for each input variable, as shown in Figure 5.2.

0 1 2 3 4 5 6 7 8 9 100

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Page 50: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

35

Figure 5.3 shows, using a grid representation, how the fuzzy rules cover the space. Each rectangular

area signifies the intercepted area of each membership function, in the interval [0.5, 1], between both

inputs.

Figure 5.3 - The intercepted area (rectangles) of each membership function [0.5,1] between the inputs Re(Z)[Ohms] and Img(Z)[Ohms]. EIS of the battery for 25% (red dots), 50% (yellow dots), 75% (cyan dots) and

100% (blue dots) of SOC).

1.5 2 2.5 3 3.5 4 4.5 5 5.5 6

x 10-3

-4

-3

-2

-1

0

1

2

3x 10

-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

Figure 5.2 - Membership functions of the inputs variables “Re(Z)[Ohms]” and “Img(Z)[Ohms]”.

(a) Input Variable “Re(Z)[Ohms]”

(b) Input Variable “Img(Z)[Ohms]”

Page 51: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

36

5.1.1 - FIS rule-base: initial testing

Figure 5.3 shows using a graphic representation the initial set of rules that will compose the fuzzy

system. This is initially evaluated using the same data (usually called training data) used to construct

the rule base, that is, the data points forming the impedance spectrum of the four SOC levels.

Let’s start inserting as input to the fuzzy system the 25% EIS curve of the battery, that is, the resistance

and reactance data for 25% of SOC consisting of two impedance spectrums (each EIS consists of 38

impedance measurements for different frequencies, performed twice). Table 5.1 lists the estimated SOC

values (one output per each set of inputs, the resistance and reactance).

Table 5.1 also includes the results for 50%, 75% and 100% of SOC:

Table 5.1 - Inputs and outputs of the Fuzzy system with 30 membership functions each variable.

The results shown in the previous table are plotted in the Figure 5.4. The red asterisks represent the

estimated SOCs from the fuzzy system, while the blue circles are the real SOC of the input data, i.e. the

Input

variables

Input

variables

25.0 31.7 25.0 36.5 50.0 34.9 50.0 32.0

25.0 43.4 25.0 46.8 50.0 36.9 50.0 36.5

25.1 54.1 25.0 52.8 49.9 57.9 50.0 59.4

24.2 49.4 25.9 52.3 50.0 72.3 50.1 60.6

28.5 35.3 22.5 35.3 48.8 36.3 50.8 40.6

29.8 24.5 22.5 27.5 52.3 40.5 46.6 40.7

26.1 22.7 20.7 26.5 50.6 51.6 47.3 49.4

30.5 31.1 27.8 33.4 52.2 59.8 49.7 74.2

25.1 42.8 20.5 9.8 50.5 82.8 46.7 63.1

26.8 24.7 25.7 25.3 52.6 46.7 48.4 50.2

31.7 16.6 30.6 48.0 49.1 53.3 46.3 46.7

27.2 38.5 27.0 24.4 47.4 47.6 45.1 54.2

36.7 27.4 42.7 25.5 42.7 66.3 39.1 47.9

55.9 25.2 59.3 24.8 36.1 54.6 40.7 48.8

51.2 25.0 49.2 25.0 48.0 52.7 53.4 47.8

40.5 25.0 40.0 25.0 53.4 51.1 52.2 46.0

36.1 25.0 34.2 25.0 45.2 49.8 42.5 50.2

30.5 25.0 28.8 25.0 39.7 49.9 38.3 50.0

28.3 25.0 29.5 25.0 37.2 50.0 35.4 50.0

75.0 74.2 75.0 78.7 100.0 101.6 100.0 77.3

75.0 69.3 75.0 71.1 100.0 106.7 100.0 70.2

75.0 62.5 75.0 62.9 100.0 106.5 99.9 84.9

75.0 76.8 75.0 79.2 100.1 113.9 99.8 95.4

75.0 92.6 75.0 90.6 100.6 108.2 99.3 99.4

75.0 88.8 75.0 87.1 100.1 82.3 99.9 57.7

75.0 89.0 75.0 89.8 100.2 55.5 100.0 70.2

75.0 85.9 75.0 87.7 98.7 67.3 100.8 87.7

74.8 67.7 75.4 76.5 102.0 93.9 96.9 92.0

74.2 76.1 74.8 74.8 101.2 101.4 98.9 88.0

76.7 75.2 77.7 73.9 99.0 96.3 101.9 90.8

73.9 75.5 75.2 75.6 99.3 86.1 100.7 92.2

72.3 74.5 73.7 74.2 101.5 86.4 96.4 99.6

72.2 72.3 72.9 81.5 100.1 72.5 99.9 75.1

72.6 68.9 73.7 67.7 98.6 70.7 106.3 89.1

74.1 72.1 75.0 71.2 102.6 96.0 101.9 103.9

74.6 62.5 76.3 58.0 106.1 100.0 79.6 100.0

75.8 74.5 78.6 75.6 104.6 100.0 69.7 100.0

75.2 75.0 79.3 75.0 102.8 100.0 74.7 100.0

Output variables Output variables

EIS of the

battery

with 25%

SOC

EIS of the

battery

with 50%

SOC

EIS of the

battery

with 75%

SOC

EIS of the

battery

with

100%

SOC

Page 52: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

37

experimental data used to create de fuzzy system. The average and variance values of the results

shown in the table 5.1 can be seen in the table 5.2.

Figure 5.4 - Fuzzy system output error, the defined output (blue circles) and the actual output (red asterisks).

Input variables Output

Average

Output

Variance

Mean Output

Error

EIS of the battery with

25% SOC 31.2 100.0 6.2

EIS of the battery with

50% SOC 49.1 75.3 -0.9

EIS of the battery with

75% SOC 75.4 35.9 0.4

EIS of the battery with

100% SOC 94.3 146.3 -5.7

Table 5.2 – Average and variance of the outputs of the Fuzzy system with 30 membership functions each variable.

5.1.2 - SOC estimation error X number of membership functions

Table 5.2 shows that the highest absolute error has occurred for the inputs of 25% and 100% SOC. A

possible first solution to reduce the error is to increase the number of membership functions for each

variable, which can bring greater accuracy to the fuzzy model. For comparison with the previous 30 x

0 50 100 150 200 250 300 3500

20

40

60

80

100

120

Index

Outp

ut

Page 53: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

38

30 fuzzy partition shown in Figure 5.3, Figure 5.5 displays now for 50 x 50 fuzzy partition how the domain

is divided by the new set of fuzzy rules.

After testing the new 50 x 50 fuzzy rule-based system using again the training set of impedance profiles,

the new estimated SOC values are plotted in red in Figure 5.6, with the corresponding average and

variance error values listed in table 5.3.

Analyzing this last fuzzy model, one observe that the variance and the estimation error have decreased

considerably with the increase of the number of membership functions. For example, for an input

impedance spectroscopy with 100% SOC, the absolute error decreased from 5.7% to 2.8%, with the

variance decreasing drastically from 146.3 to 83.3. An absolute error decrease was also observed for

25% SOC from 6.2% to 3.9%.Nevertheless, In the case of 50% SOC there was a slight increase of the

absolute error but there was a high decrease of the variance which represents an improvement in the

result.

Figure 5.5 - The intercepted area (rectangles) of each membership function in the interval [0.5,1] between the inputs Re(Z)[Ohms] and Img(Z)[Ohms]. EIS of the battery for 25% (red dots), 50% (yellow dots), 75% (cyan dots)

and 100% (blue dots) of SOC).

1.5 2 2.5 3 3.5 4 4.5 5 5.5 6

x 10-3

-4

-3

-2

-1

0

1

2

3x 10

-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

Page 54: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

39

Figure 5.6 – The 50 x 50 fuzzy system output SOCs, the defined SOCs (blue circles) and the estimated SOCs from the new fuzzy model (red asterisks).

The average and variance values can be observed in the next table:

Input variables Output

Average

Output

Variance

Mean Output

Error

EIS of the battery with

25% SOC 28.9 64.6 3.9

EIS of the battery with

50% SOC 48.2 35 -1.8

EIS of the battery with

75% SOC 75.7 8.8 0.7

EIS of the battery with

100% SOC 97.2 83.3 -2.8

Table 5.3 - Average and variance of the outputs of the Fuzzy system with 50 membership functions each variable.

5.1.3 - Accuracy limit of the fuzzy model

Previously, the absolute error values and its variance decreased significantly with the increase of the

number of membership functions from 30 to 50. The model performance improves as the number of

membership functions assigned increase. However, there is a limit to the improvement of the

performance of the fuzzy model because, with the increase of the number of membership functions,

information gaps begin to occur in localized regions through the domain for which no data were

collected.

0 50 100 150 200 250 300 35020

30

40

50

60

70

80

90

100

110

120

Index

Outp

ut

Page 55: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

40

This effect will limit the number of membership functions assigned to fuzzy variables and consequently

the total number of rules that will describe the functional relation (impedances’ profiles). Follow, an

example is presented, which aims to observe the appearance of information gaps and verify their

influence on the fuzzy model performance.

In Figure 5.7, it is used a segment of an EIS curve for a given SOC as example. Both input universe of

discourses (Re(Z)[Ohms] and -Img(Z)[Ohms]) were divided by six equally spaced triangular

membership functions. The interception of the various membership functions of both input variables

results in a division of the input space into several rules, symbolized in the figure with squares.

Figure 5.7 - Illustration of the membership functions of the system given as an example (6×6 membership functions).

The respective SOC value is now defined for each rule, constituting the consequent numeric value of

each rule. In this example, it is the same SOC for every measure. An example of rules defined in this

system can be visualized in Figure 5.8.

Real(Z)[Ohms]

-Im

g(Z

)[O

hm

s]

Page 56: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

41

Figure 5.8 - Illustration of region covered by the rules (grey squares) of the system given as an example (6×6 membership functions).

For each square or squares containing a certain data point, a rule is defined. In other words, if any input

is contained in one of these squares, marked in gray color in Figure 5.8, the output will be the respective

SOC defined in each rule, in this case the same SOC value. The output associated with the rules (its

consequent value) that represented by the white squares is set with zero since there was none data

available in this area.

Next, using the same data set, it is obtained another set of fuzzy rules but, instead of 6 membership

functions for each variable, it were used 18 membership functions, as illustrated in Figure 5.9.

Figure 5.9 - Illustration of the membership functions of the system given as an example (18×18 membership functions).

Real(Z)[Ohms]

-Im

g(Z

)[O

hm

s]

Page 57: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

42

For this case, each non zero rule is defined by a grey square, as shown in Figure 5.10.

Figure 5.10 - Illustration of region covered by the rules (grey squares) of the system given as an example (18×18 membership functions).

Comparing Figures 5.8 and 5.10, it is visible that the domain region defined by each rule in Figure 5.8

is larger than now in Figure 5.10. Using an 18 x 18 fuzzy partition (Figure 5.10), there are gaps (white

squares) now appearing between each defined rule, meaning that the fuzzy-ruled base that has a larger

rule defined area will have a better tolerance (most immune) for variations in the input values for the

same SOC. Hence, it will be more “robust” in the presence of noise. On the contrary, reserving a larger

area for each rule may lead to ambiguity for impedance spectrums of different battery SOCs which

intercept in some domain regions (notice this in Figure 5.5).

Increasing the number of membership functions can thus decrease this ambiguity since a smaller area

is reserved for each rule. But, with the decrease of the areas reserved for each rule, noise tolerance of

the system decreases too.

Basically, increasing the number of membership functions will decrease the output error of the system

to a certain point, which will depend on the noise associated with the measuring instruments, in this

case the instrument for the acquisition of impedance spectrum.

5.1.4 - Offline SOC estimation method and noise analysis

The previous fuzzy system enables SOC estimation by comparing the impedance spectrum of

the battery at a given moment (performed with EIS technique), with the impedance spectrums database

for pre-defined SOCs. However, the proposed method does not allow a continuous measurement for

Page 58: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

43

the entire range of SOC since it only guarantees an estimation of SOC when the actual measured

impedance profile corresponds to one of the profiles in the database. The previous method matches the

measured impedance (EIS) with the database of impedance profiles previously loaded. The more

impedance profiles this database has, the more battery’s SOC measurements can be estimated as

output.

Following, measurements of impedance profiles near the EIS of the battery were simulated with 50 and

75% SOC, as shown in Figure 5.11. In this figure, there are three input profiles simulated represented

by red, yellow and blue asterisks. In black and green dots there are two impedance profiles of the

battery with 50 and 75% of SOC, respectively, already inserted in the database.

The intermediate impedance profiles between the battery’s impedance profile with 50% of SOC (black

dots) and:

the impedance profile of the battery with 75% of SOC(Green dots) are represented by blues

asterisks.

Blue asterisks are represented by yellow asterisks.

Yellow asterisks are represented by red asterisks.

Figure 5.11 - EIS of the battery with 50 and 75% of SOC (black and green dots, respectively) and the simulated input profiles (red, yellow and blue asterisks).

In the next simulation it is shown that for impedance spectrums not present in this database, the output

of fuzzy system presents different values than when the impedance is matched.

2 2.5 3 3.5 4 4.5 5

x 10-3

-4

-3

-2

-1

0

1

2x 10

-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

Page 59: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

44

The SOC outputs from the fuzzy model for each input profile (represented by the asterisks in Figure

5.11) have been analyzed using the resultant average and its variance, listed in table 5.4. Observing

the table, it is clear that, for input values not included in construction of the fuzzy system, e.i. for other

values of SOC that were not included in the database of impedance profiles, the averages of the outputs

are random values and variances are extremely high, discriminating the results when impedance profiles

do and do not match.

Input profiles Output

Average

Output

Variance

EIS of the battery with

50% SOC 48.2 35

Red asterisks 3.9 3.8 × 104

Yellow asterisks -87.7 2.1 × 105

Blue asterisks 25.3 1.2 × 104

EIS of the battery with

75% SOC 75.7 8.8

Table 5.4 – Average and variance of the SOC values estimated by the fuzzy system when using the input profiles indicated in Figure 5.11.

As can be observed, there is some noise in the measurement of impedances through the EIS

technique. For each SOC, two sweeps of measurements of impedances were made with the same array

of frequencies one after the other (frequencies and the respective duration of EIS are indicated in Annex

1). The two impedance profiles look slightly different due to measurement errors with the respective

technique and its equipment. So, due to these errors, the fuzzy model has been analyzed in the

presence of noise to simulate other possible incertitudes coming from the measurements of

impedances.

From the profiles already available, other possible ones have been simulated, which have taken

into account the difference of magnitudes observed between the two impedance profiles available for

each SOC.

The simulation of those impedance profiles are based on adding random noise on the respective

impedance profiles, in order to simulate the difference of magnitudes observed between the two

impedance profiles available for each SOC. Since by the observation of the impedance profiles it is not

possible to quantify the error of measure of each one, two tests are performed, one with impedance

profiles slightly differentiated and the other with further differentiated ones, ensuring that if other

impedance profiles were measured, these would be between those simulated profiles.

For example, considering the impedance profiles of the battery with 50% and 75% of SOC (two

impedance profiles for each SOC), other profiles are simulated by adding a light noise to the respective

Page 60: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

45

impedance profiles, Figures 5.12 and 5.13 respectively. Inserting those simulations as inputs in the fuzzy

model previous built the output, the estimated SOCs are obtained and its average and variance values

are listed in table 5.5.

Figure 5.12 - EIS of the battery (black dots) and the simulated EIS (red dots) for a battery with 50% of SOC.

Figure 5.13 - EIS of the battery (black dots) and the simulated EIS (red dots) for a battery with 75% of SOC.

Input profiles Output Average Output Variance

Simulated EIS of the

battery with 50% SOC 48.1 90.6

Simulated EIS of the

battery with 75% SOC 75.1 25.9

Table 5.5 – Average and variance of the outputs of the Fuzzy system with simulated inputs.

Page 61: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

46

Using the same impedance profiles of the battery with 50% and 75% of SOC, more inputs are simulated,

further differentiated than previous, as visualized in Figures 5.14 and 5.15, the results obtained are

indicated in table 5.6.

Figure 5.14 - EIS of the battery (black dots) and the simulated EIS (with higher differentiation, represented with red dots) for a battery with 50% of SOC.

Figure 5.15 - EIS of the battery (black dots) and the simulated EIS (with higher differentiation, represented with red dots) for a battery with 75% of SOC.

Page 62: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

47

Input variables Output Average Output Variance

Simulated EIS of the

battery with 50% SOC 48.16 97.37

Simulated EIS of the

battery with 75% SOC 76.14 54.10

Table 5.6 – Average and variance of the outputs of the Fuzzy system with simulated inputs (with higher differentiation).

From the previous results it is observable that with the increase of difference between the values of the

simulated inputs and the inputs used to create the database, the errors of output and variance increase.

This proves that depending on the noise of the impedance measuring instruments, the output error of

the system and the respective variance are affected.

Analyzing these two previous examples, one can conclude that this method can estimate SOCs, but

first it is necessary to determine the noise characteristics in the impedance profile measurement (EIS)

of the respective measurement tools and then defining margins of acceptance for the variance. That is,

when a minimum in variance or a value of variance specified when the system was built is detected, it

is verified if the average value of the fuzzy output obtained exists in the database and if matched , it can

be concluded that the battery’s SOC at that moment is equal to the matched SOC. This algorithm is

explained in the next sub chapter.

5.1.4.1 - Example of a possible algorithm scheme for estimating SOC.

First the system’s noise is analyzed and quantified. For example, considering a system with the same

noise ratio as the first system with simulated inputs (table 5.5), when the impedance matches one of the

profiles in the database, the average value of the output also matches one of the values in the database

with minimal error (depending on the noise of the measuring equipment) and the variance decreases

considerably.

For this method to work, noise must always be considered. Depending on the amount of noise, which

depends on the type of instruments used for measurement, the respective acceptance limits are defined.

For example, for 50% the fuzzy model is tested and as result the output average and variance is

obtained, now is possible to select limits of acceptance, in this case an acceptable limit for the average

can be with a 𝑚𝑎𝑟𝑔𝑖𝑛 =−+2% [48,52] and the variance > 90.6 (if 90.6 is a minimum value of the variance

observed by several measurements of the battery with the SOC = 50%). In table 5.7 the previous limits

for 50% and for 75% are presented as an example.

Page 63: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

48

Setting limits

Input variables Output

Average

Limits for the

mean

Output

Variance

Limits for the

variance

Simulated EIS of

the battery with

50% SOC

48.1 [48, 52] 90.6 [0, 91.1]

Simulated EIS of

the battery with

75% SOC

75.1 [74, 76] 25.9 [0, 26.4]

Table 5.7 – Example of setting limits for the average and variance for the SOC estimation algorithm.

Observing table 5.7 is possible to create an algorithm for the estimation of SOC. For example, the steps

of the algorithm can be the following:

1. Performing an EIS to the battery, to retrieve the respective impedance profile.

2. Insert the previous impedance profile as input in the fuzzy system.

3. Evaluate if the output of the Fuzzy system is between one of the limits set for each SOC.

4. If there is a match in the step 3, verify if the variance, if is between the limit set for the respective

SOC.

5. If a match exists in step 4, the output of the system is the respective SOC, therefore the output

of the algorithm.

This algorithm can be schematized as illustrated in Figure 5.16.

EIS

Fuzzy System

Output Average

Output mean ϵ [48,52] ?

Output mean ϵ [74,76] ?

No

No

Yes

Yes

Battery Impedance (Re(Z) and Im(Z))

Fuzzy System Output (SOC)

Output variance < 91.1 ?

No

Yes

Output variance < 26.4 ?

No

Yes

SOC Estimation = 50%

SOC Estimation = 75%

Figure 5.16 – Illustrated example of the algorithm for the estimation of SOC.

Page 64: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

49

5.2 - FIS construction using the average impedance magnitude of the

impedance profile

Remembering that for every EIS scans two equal sweeps of decreasing frequencies (indicated

in Annex 1) are performed, two similar nyquist curves are obtained for each SOC. The small difference

of values displayed by both curves can be due to noise or measurement errors associated to the

measuring instruments. In order to simplify the construction of the fuzzy model, instead using the two

impedance profiles, the average impedance values are calculated to obtain a new training data and a

new fuzzy model is built. The fuzzy model considers 50 Gaussian membership functions for each input

variable, as illustrated in Figure 5.17.

Figure 5.17 - The intercepted area (rectangles) of each membership function in the interval [0.5,1] between the inputs Re(Z)[Ohms] and Img(Z)[Ohms]. EIS of the battery for 25% (red dots), 50% (yellow dots), 75% (cyan dots)

and 100% (blue dots) of SOC).

5.2.1 - FIS testing

Inserting as inputs the average between both impedance profiles of each EIS with SOCs of

25%, 50%, 75% and 100% the outputs can be observed Figure 5.18.

1.5 2 2.5 3 3.5 4 4.5 5 5.5 6

x 10-3

-4

-3

-2

-1

0

1

2

3x 10

-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

Page 65: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

50

Figure 5.18 - Fuzzy system output using the average impedance profile, the real SOC (blue circles) and the estimated SOC (red asterisks).

Table 5.8 list the error analysis from SOCs estimation. It shows that a decrease in error and variance is

noticed. This happens due to two main reasons:

The reduction to one impedance profile instead of two, i.e. reduction of the number points to

half, simplifies the fuzzy system (decreasing the number of rules required to maintain the

accuracy of the system).

At the intersection of impedance spectrums of different SOC´s, where there is more ambiguity

when defining the fuzzy rules, the number of points decreases to half, lowering the ambiguity,

which contributes to greater simplicity in these regions.

Input variables Output

Average

Output

Variance

Output Error

EIS of the battery with

25% SOC 26.9 23 1.9

EIS of the battery with

50% SOC 48.1 21.1 -1.9

EIS of the battery with

75% SOC 75 2.2 0

EIS of the battery with

100% SOC 99.9 0.951 0.1

Table 5.8 – Average and variance of the outputs of the Fuzzy system with 30 membership functions each variable (FIS constructed with impedance spectrums average data).

0 20 40 60 80 100 120 140 16020

30

40

50

60

70

80

90

100

110

Index

Outp

ut

Page 66: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

51

5.2.2 - Offline SOC estimation method and noise analysis (Simplified fuzzy by using the previous

average of the impedance profiles)

Introducing the same procedure previously performed (sub chapter 5.1.4) with the objective of

observing, for impedance profiles not included in the database, that (since those are not matched) the

output of the fuzzy system estimates different SOC values than when a match occurs. In this section,

instead of building the fuzzy model with both impedance profiles for each SOC, the average of these

impedance profiles will be used (in attempt to decrease the error as explained before).

The impedance profiles for 50% and 75% SOCs have been used to build this fuzzy model

(averaging of the impedance profiles of each SOC as shown in Figure 5.11 by black and green dots

respectively). Figure 5.19 plots these two averaged impedance profiles (50% in black dots and 75% in

green dots). In the same figure, it has been again represented the profiles (plotted using asterisks) that

will be used as test inputs to the fuzzy model.

Figure 5.19 - EIS of the battery with 50% and 75% of SOC (black and green dots respectively) and the profiles used as inputs (asterisks).

The estimated SOC values obtained from the new fuzzy model, with the same number of membership

functions (50 Gaussian membership functions each variable) for each input illustrated in Figure 5.19 are

presented in the table 5.9.

2 2.5 3 3.5 4 4.5 5

x 10-3

-4

-3

-2

-1

0

1

2x 10

-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

Page 67: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

52

Input variables Output

Average

Output

Variance

EIS of the battery with

50% SOC 48.1 21.1

Red asterisks 21.5 1.8 × 103

Yellow asterisks 2.4 7.9 × 103

Blue asterisks 11.9 1.0 × 104

EIS of the battery with

75% SOC 75 2.2

Table 5.9 – Average and variance of the estimated SOC values of the fuzzy model of the inputs indicated in figure 5.19.

Observing the table, it is clear that, for impedance profiles not included in the database and inserted as

input in the fuzzy system, the averages of the outputs are random values and variances are extremely

high, distinguishing the results when impedance profiles do and do not match.

The same input noise (light) as previously added was used for comparative analysis, illustrated in

Figures 5.12 and 5.13, for each input training profile of the new system. This comparison allowed us to

assess which fuzzy model is more robust in terms of getting better SOC estimations for profiles with the

same amount of added noise. Adding this noise to the inputs illustrated in Figure 5.17 and inserting

these inputs in the Fuzzy system, constructed with the impedance profiles average, the output is

obtained and listed in table 5.10.

Input variables Output

Average

Output

Variance

Simulated EIS of the

battery with 50% SOC

45.4 1.1 × 102

Simulated EIS of the

battery with 75% SOC

77.2 1.9 × 102

Table 5.10 - Average and variance of the outputs of the Fuzzy system with simulated inputs. (FIS constructed with the impedance profiles average).

Comparing the output analysis listed in table 5.10 with that one in table 5.5, higher values of variance

are noticed. This shows that for input profiles with noise, this method does not provide acceptable results

Page 68: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

53

since the variance of the output presents significant values. The previous fuzzy model constructed with

both impedance spectrums of each SOC presents a lower variance, which means that the system is

more robust when submitted to noise. A simple justification for this result is: when the fuzzy model is

constructed with 2 impedance profiles for each SOC, more space in the domain is assigned when

creating the fuzzy rules. When the impedance profile used as a test input presents small variations, it

intercepts the region assigned with the same rule, allowing a better noise filtration. This result can also

be explained with a simple example illustrated by Figures 5.20 and 5.21.

Figure 5.20 - Defining a rule of a fuzzy system with only one point.

Figure 5.20 shows that for one point with the output corresponding to rule i, the assigned space is the

area intercepted between membership function 4 (X1) and function 2 (X2), as illustrated in the picture

with a grey square.

X2

X1

Membership

function 1

Membership

function 2

Membership

function 3

Membership

function 4

Membership

function 5

Me

mb

ers

hip

fun

ctio

n 1

Me

mb

ers

hip

fun

ctio

n 2

Me

mb

ers

hip

fun

ctio

n 3

Me

mb

ers

hip

fun

ctio

n 4

Me

mb

ers

hip

fun

ctio

n 5

Rule i

Page 69: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

54

Figure 5.21 - Defining a rule of a fuzzy system with two points.

In Figure 5.21, for two training points with same output, the space assigned, in this case, is bigger since

corresponds to the area intercepted between function 4 (X1) and functions 2 and 3 (X2), as represented

in grey. When a training input is located inside the grey area, the output will have the same rule, since

the second example presents a wider area the input may vary more without changing the output’s rule.

X2

X1

Membership

function 1

Membership

function 2

Membership

function 3

Membership

function 4

Membership

function 5

Me

mb

ers

hip

fun

ctio

n 1

Me

mb

ers

hip

fun

ctio

n 2

Me

mb

ers

hip

fun

ctio

n 3

Me

mb

ers

hip

fun

ctio

n 4

Me

mb

ers

hip

fun

ctio

n 5

Rule i

Page 70: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

55

5.3 - Conclusion

The method analyzed in this chapter, only enables the estimation of the predefined SOCs. The higher

the number required of outputs, SOC estimations, the higher the number of predefined SOCs are

necessary and the more time will be required for the construction of the database of impedance

spectrums and corresponding SOCs.

Relatively to other types of methods that perform a continuous estimation / measurement of SOC for

the entire range of SOC, 0 to 100% this method presents a higher accuracy for the predefined SOCs

enabling their updating/correction. In other words, this method has a high accuracy for estimating only

the predefined SOCs and can be used to update / correct the traditional continuous methods, for

example the coulomb counting technique, mentioned in chapter 3. It was also observed that the fuzzy

system presents more accuracy when built with more than one impedance spectroscopy for each SOC,

because of the error of reading/measurement associated with the instruments used in EIS technique.

This method will include several advantages of various techniques without their disadvantages, i.e.

nowadays the most accurate and simple battery SOC measurement is performed through measuring

the OCV, but in order to perform this measurement it is necessary to wait for a longer period of time,

while the battery is offline, so that the OCV can reach its steady state value.

Nowadays many highly complex techniques aim to estimate the OVC through the working voltages and

currents and to estimate posteriorly the battery’s SOC. These techniques are usually made using

Kalman filters, which can be complex to program. On the other hand, the EIS technique can be

performed while the battery in under load without the need to disconnect it, which represents a major

advantage. The method presented in this chapter combines this last advantage of the EIS technique

with the precision of the SOC measure through OCV without disconnecting the battery.

Another major advantage of this method is the possibility to update of the impedance spectrums

database making it possible to obtain accurate and precise SOC values over time, unlike other SOC

measuring methods that obtain outdated results, increasing the output error over time.

Page 71: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

56

6 - Online SOC estimation method

In the previous chapter, a method that estimates the SOC through impedance comparative analysis has

been presented. The biggest drawback of that method is that it does not allow a continuous estimation

of the battery’s SOC for its entire range of 0-100%, only matching impedance spectrums with those ones

previously included in the fuzzy rule base. Therefore, a method that allows the estimation for the entire

range of SOC is presented as solution. This method, since it incorporates the entire range of SOCs as

output, is an online method that continuously provides an estimation of the battery’s SOC, as result.

As already mentioned, the impedance profile of the battery varies with its SOC and also with the number

of discharge/charge cycles already experienced by the battery. This presents a major difficulty for an

online SOC estimation through the impedance comparative analysis. Figure 6.1 shows the impedance

profiles taken by the battery for 25%, 50%, 75% and 100% of SOC from one month to the sixth month

of use. Between months the battery was subjected to four discharge/charge cycles.

(a) – month 1 (0 cycles) (b) – month 2 (4 cycles)

(c) - month 3 (8 cycles) (d) – month 4 (12 cycles)

Page 72: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

57

Figure 6.1 - EIS of the battery for 25% (red dots), 50% (yellow dots), 75% (cyan dots) and 100% (blue dots) of SOC in: (a) month 1, (b) month 2, (c) month 3, (d) month 4, (e) month 5 and (f) month 6.

As mentioned before, the shorter the time interval between measurements of impedances, EISs, the

smaller the impedance profile variation between these time intervals. In our case, the available

laboratorial measurements from VITO were done with a time interval of 1 month. Given these

characteristics, follow an online SOC estimation algorithm is proposed which fuzzy rules are updated

when new impedance spectrums are obtained.

6.1 - On-line SOC estimation Algorithm

The battery impedance profiles changes with its SOC, using a more compacted way, each impedance

profile has been represented by its centroid. Figure 6.2 shows the centroid associated with each SOC

using the same color of its impedance curve.

Figure 6.2 - Center of gravity of each impedance spectroscopy of the battery (month 2), with 25% (red dots), 50% (yellow dots), 75% (cyan dots) and 100% (blue dots) of SOC, represented by circles with the same color.

(e) – month 5 (16 cycles) (f) – month 6 (20 cycles)

Page 73: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

58

Assuming that the impedance spectrums evolve accordingly with a certain order, one can represent this

evolution looking the "path" taken by centroids run as SOC changes. Figure 6.3 at right contains a green

line connecting the centroids to indicate their evolution from 25% red to 100% blue.

Figure 6.3 - Assumed path of the evolution of the centers of gravity represented with a green line, 25% (red dots), 50% (yellow dots), 75% (cyan dots), 100% (blue dots=,(month 2).

Interpolating the previous data not only for a 2D “path” but for a 3D region, it is possible to fit a surface

using only the impedance centroids. This fitting method is named bilinear interpolation [14].

Suppose we have a nearly or exactly planar function:

𝑧 = 𝑓(𝑥, 𝑦) (6.1)

and we are given four points, A, B, C, and D defining a rectangle as shown below in Figure 6.4

Page 74: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

59

Figure 6.4 - Bilinear interpolation. The rectangle ABCD is partitioned into four areas by the lines x = x2 and y = y2 [14].

The rectangle ABCD is partitioned into four areas by the lines x = x2 and y = y2. To interpolate the value

(z4) of 𝑓 at point E (given at x2 and y2) we first find the normalized areas of the partitions of the rectangle

ABCD. The four areas are normalized by dividing them each by the area of rectangle ABCD.

The four normalized areas, Na, Nb, Nc, and Nd, each diagonally opposite from its naming rectangle

vertex, are given by:

𝑁𝑎 = (𝑥1 − 𝑥2). (𝑦2 − 𝑦0)

(𝑥1 − 𝑥0). (𝑦1 − 𝑦0)

𝑁𝑏 = (𝑥2 − 𝑥0). (𝑦2 − 𝑦0)

(𝑥1 − 𝑥0). (𝑦1 − 𝑦0)

𝑁𝑐 = (𝑥1 − 𝑥2). (𝑦1 − 𝑦2)

(𝑥1 − 𝑥0). (𝑦1 − 𝑦0)

𝑁𝑑 = (𝑥2 − 𝑥0). (𝑦1 − 𝑦2)

(𝑥1 − 𝑥0). (𝑦1 − 𝑦0)

(6.2)

Then z4 is computed by the equation:

𝑧 = 𝑧0. 𝑁𝑎 + 𝑧1. 𝑁𝑏 + 𝑧2. 𝑁𝑐 + 𝑧3. 𝑁𝑑 (6.3)

Page 75: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

60

As a result of the linear interpolation of the centroids of the impedances, a 3D function with 3 coordinates

as SOC, Re[Z] and –Im[Z] is constructed. Figure 6.5 displays this function where each light blue dot

represents the impedance centroids from Figure 6.3. This method of interpolation allows the construction

of new data points within the range of a discrete set of known data points. A model was built with this

method, which calculates the battery’s SOC based on the values of the centroids of the known

impedance profile.

Figure 6.5 - Linear Interpolation model computed with 4 impedance centroids of the battery with: 25%, 50%, 75% and 100% of SOC respectively. (month 2)

For the estimation of SOC using this model, some centroids of the actual impedance profile of the battery

may be located outside the surface covered by interpolation and as solution, an algorithm was

implemented. The algorithm computes the closest point of the surface covered by interpolation of the

respective centroid. In Figure 6.6, it is possible to observe an example of the execution of the algorithm.

Page 76: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

61

Figure 6.6 – Algorithm that, given a centroid value outside the area covered by interpolation, computes the closest point of the area covered by interpolation to the respective centroid. (month 2)

6.2 - Testing the algorithm

The first test for the fuzzy model built using the previous interpolation technique will be to use

intermediate impedance profiles as input data, and to analyze the output of the model, verifying if it

corresponds to the expected SOC.

Assuming that the impedance profile variation is linear between the known impedances, intermediate

impedances between 25%-50%, 50%-75%, and 75%-100% are projected.

Figure 6.7 plots the 25% (red) and 50% (yellow) impedance profiles, being the intermediate SOC of

37.5% is plotted in black. This will be the expected SOC to be estimated by the fuzzy model when test

data, the intermediate impedance profile centroid, is inserted as inputs. In the same figure, centroids of

each impedance profile are also plotted.

Figures 6.8 plots the 50% (light blue) and 75% (yellow) impedance profiles, and in black the intermediate

SOC of 62.5%. Centroids of each impedance profile have been also plotted.

Last, Figures 6.9 plots the 75% (light blue) and 100% (yellow) impedance profiles, and in black the

intermediate SOC of 87.5%. Centroids have been plotted again.

Page 77: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

62

Figure 6.7 - Intermediate impedance (black dots) between impedance profiles of the battery with 25% (red dots) and 50% (yellow dots) with the respective centroids represented with a circle with the same color. (month 2)

Figure 6.8 - Intermediate impedance (black dots) between impedance profiles of the battery with 50% (yellow dots) and 75% (light blue dots) with the respective centroids represented with a circle with the same color. (month

2)

1.5 2 2.5 3 3.5 4 4.5 5 5.5 6

x 10-3

-1

-0.5

0

0.5

1

1.5

2

2.5

3x 10

-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

1.5 2 2.5 3 3.5 4 4.5 5 5.5

x 10-3

-1

-0.5

0

0.5

1

1.5

2x 10

-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

Page 78: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

63

Figure 6.9 - Intermediate impedance (black dots) between impedance profiles of the battery with 75% (light blue dots) and 100% (blue dots) with the respective centroids represented with a circle with the same color. (month 2)

Figure 6.10 (a) to (c) displays the output of the interpolation model with the estimated impedance

centroids from each result of Figures 6.7, 6.8 and 6.9. Estimation error for each case is listed in Table

6.1.

1.5 2 2.5 3 3.5 4

x 10-3

-1.5

-1

-0.5

0

0.5

1

1.5

2

2.5

3

3.5

x 10-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

(a) (b)

Page 79: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

64

Figure 6.10 - Representation of the output of the interpolation model for the intermediate centroids: (a) 37.5%, (b) 62.5% and (c) 87.5%. of SOC.

Inputs Output (%) Output Error (%)

Impedance spectrum centroid of

the battery with 25% (*) 25 0

Impedance spectrum centroid of

the battery with 37.5% of

expected SOC

37.50 0

Impedance spectrum centroid of

the battery with 50% (*) 50 0

Impedance spectrum centroid of

the battery with 62.5% of

expected SOC

60.16 -2.34

Impedance spectrum centroid of

the battery with 75% (*) 75 0

Impedance spectrum centroid of

the battery with 87.5% of

expected SOC

85.78 -1.72

Impedance spectrum centroid of

the battery with 100% (*) 100 0

Table 6.1 – Output and error of the algorithm for impedance spectrum centroids of the battery with a SOC of 25, 37.5, 50, 62.5, 75, 87.5 and 100%, as inputs.

(*) Centroids used in the construction of the interpolation model.

The highest observable absolute error for these entries was 2.34%, which represents a very good result,

in the error boundaries of SOC estimation.

(c)

Page 80: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

65

6.2.1 - Noise Analysis

The model has been tested with the presence of noise at the inputs. As shown in the next figures, ±10%

white noise added to each variable (different noise vectors for each variable), real and imaginary parts

of the impedance respectively, and the output of the model was obtained as shown in table 6.2.

Figure 6.11 - EIS of the battery with 25% of SOC without noise (black dots) and with noise added (red dots) with the respective centroids represented by circles.

2 2.5 3 3.5 4 4.5 5 5.5

x 10-3

-0.5

0

0.5

1

1.5

2

2.5

x 10-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

Page 81: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

66

Figure 6.12 - Intermediate computed impedance of a battery with an assumed intermediate SOC of 37.5% without noise (black dots) and with noise added (red dots) with the respective centroids represented by circles.

Figure 6.13 - EIS of the battery with 50% of SOC without noise (black dots) and with noise added (red dots) with the respective centroids represented by circles.

2 2.5 3 3.5 4 4.5 5

x 10-3

-5

0

5

10

15

20

x 10-4

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

2 2.5 3 3.5 4 4.5 5

x 10-3

-5

0

5

10

15

20

x 10-4

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

Page 82: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

67

Figure 6.14 - Intermediate computed impedance of a battery with an assumed intermediate SOC of 62,5% without noise (black dots) and with noise added (red dots) with the respective centroids represented by circles.

Figure 6.15 - EIS of the battery with 75% of SOC without noise (black dots) and with noise added (red dots) with the respective centroids represented by circles.

2 2.5 3 3.5 4

x 10-3

-5

0

5

10

15

x 10-4

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

1.8 2 2.2 2.4 2.6 2.8 3 3.2 3.4

x 10-3

-6

-4

-2

0

2

4

6

8

10

12

14

x 10-4

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

Page 83: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

68

Figure 6.16 - Intermediate computed impedance of a battery with an assumed intermediate SOC of 87.5% without noise (black dots) and with noise added (red dots) with the respective centroids represented by circles.

Figure 6.17 - EIS of the battery with 100% of SOC without noise (black dots) and with noise added (red dots) with the respective centroids represented by circles.

1 2 3 4 5 6 7 8

x 10-3

-2

-1

0

1

2

3

4

5

6

7x 10

-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

2 3 4 5 6 7 8 9

x 10-3

-1

0

1

2

3

4

5

6

7

8

9

x 10-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

Page 84: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

69

The white noise added with each impedance profile will slightly influence the position of the respective

centroids, as observed in the previous figures. The outputs of the system are presented below with

±10% white noise added to the inputs (Different noise vectors for each variable).

Inputs Output (%) Output Error (%)

Centroid of the Impedance of

the battery with 25% 25.87 0,87

Centroid of the Impedance of

the battery with 37.5% of

expected SOC

38.42 0,92

Centroid of the Impedance of

the battery with 50% 49.44 -0,56

Centroid of the Impedance of

the battery with 62.5% of

expected SOC

62.16 -0,34

Centroid of the Impedance of

the battery with 75% of

expected SOC

74.58 -0,42

Centroid of the Impedance of

the battery with 87.5% of

expected SOC

87.57 0,07

Centroid of the Impedance of

the battery with 100% 99.33 -0,67

Table 6.2 - Output and error of the algorithm for impedance spectrum centroids of the battery with a SOC of 25%, 37.5%, 50%, 62.5%, 75%, 87.5% and 100%, as inputs with noise added.

Since the noise does not significantly alter the position of the centroids, the output of the model will vary

slightly as observed by comparing table 6.1 and 6.2.

The previous noise, added to the inputs of the system, slightly changed the centroids position which

may not always happen, depending on the noise type, therefore another important test that must be

performed consists in verifying how the error of the output of the model is altered if an offset is added to

the inputs. In this case a positive offset, more precisely, more 1% of the maximum impedance measure

value of each variable for each SOC (25%, 37.5%, 50%, 62.5%, 75%, 87.5% or 100%):

Impedance Measures with offset = Impedance Measures + 1% of maximum (Impedance

Measures )

This procedure is made for the real and imaginary part of the complex impedance in separate, leading

to a slight alteration of the position of the centroids as observed in Figures 6.18 (a) to (g).

Page 85: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

70

2 2.5 3 3.5 4 4.5 5 5.5

x 10-3

-0.5

0

0.5

1

1.5

2

2.5

x 10-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

1.5 2 2.5 3 3.5 4 4.5 5 5.5

x 10-3

-0.5

0

0.5

1

1.5

2

2.5x 10

-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

2 2.5 3 3.5 4 4.5 5 5.5

x 10-3

-1

-0.5

0

0.5

1

1.5

2

2.5x 10

-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

2 2.5 3 3.5 4 4.5

x 10-3

-5

0

5

10

15

x 10-4

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

2 2.2 2.4 2.6 2.8 3 3.2

x 10-3

-6

-4

-2

0

2

4

6

8

10

x 10-4

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7

x 10-3

-1

0

1

2

3

4

5

6

x 10-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

(a) (b)

(d) (c)

(f) (e)

Page 86: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

71

Figure 6.18 - Inputs with an offset added and the respective centroids represented by circles (red dots) and without the offset (black dots). (a) 25%, (b) 37.5%, (c) 50%, (d) 62.5%, (e) 75%, (f) 87.5% and (g) 100%.

The results obtained using the previous centroids, which were calculated adding an offset to the inputs,

may be found in table 6.3

Inputs Output (%) Output Error (%)

Centroid of the Impedance of

the battery with 25% 30.63 5,63

Centroid of the Impedance of

the battery with 37.5% of

expected SOC

42.94 5,44

Centroid of the Impedance of

the battery with 50% 51.37 1.37

Centroid of the Impedance of

the battery with 62.5% of

expected SOC

60.50 -2

Centroid of the Impedance of

the battery with 75% of

expected SOC

73.34 -1,66

Centroid of the Impedance of

the battery with 87.5% of

expected SOC

82.27 -5,23

Centroid of the Impedance of

the battery with 100% 99.33 -0,67

Table 6.3 - Output and error of the algorithm for impedance spectrum centroids of the battery with a SOC of 25%, 37.5%, 50%, 62.5%, 75%, 87.5% and 100%, as inputs with an offset added.

The greater error observed is 5.63 which is already a significant error. The cause for this significant

increase of the error is due to alteration of the position of the centroids since the output of the

interpolation model only depends on this feature.

2 3 4 5 6 7 8 9 10 11

x 10-3

0

2

4

6

8

10

x 10-3

Re(Z)[Ohms]

-Im

(Z)[

Ohm

s]

(g)

Page 87: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

72

6.3 - Conclusion

The proposed technique, as demonstrated, has the capability to estimate continuously the battery’s

SOC, resulting then in an on-line SOC estimation. For the execution of proposed technique, the same

impedance spectrums database are used as the previous method from Chapter 5.

In this Chapter, instead of doing the comparative analysis of the impedance spectrums applying a fuzzy

systems approach, a linear interpolation of the centroids of the database is performed and the centroid

of the actual battery’s impedance spectrum is inserted as input, finally, through the linear interpolation,

the SOC’s output/estimation is calculated.

The advantages of this method are estimating SOC indirectly and almost instantaneous through the

OCV without the need to unplug the battery and the option of update of the impedance spectrums

database making it possible to obtain accurate and precise SOC values over time, plus the ability of an

on-line SOC estimation. One of the disadvantages of this technique is the increase of the charging time

when the database is updated, since new impedance spectrums measurements are performed and as

previously explained to perform those measures the battery needs to be unplug for a certain interval of

time enough for the OCV to reach a steady state. Another disadvantage, demonstrated in the last sub-

Chapter, is the lack of precision when the inputs are submitted with noise that adds an offset.

Depending on the user needs, now two options of the SOC estimation methods are available:

Chapter 5 – The offline SOC estimation method. This method allows the estimation of SOC but

only for a set of predefined SOCs, for which was previously made an EIS experiment.

Chapter 6 – The online SOC estimation method, yet also needs the EIS measurements

performed.

Page 88: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

73

7 - Estimation of impedance profiles

In the previous chapters, it have been proposed two main methodologies to estimate the battery’s SOC

with the creation of an impedance profiles database for various SOC values. The impedance profiles

were obtained using the EIS technique at VITO. Using that data, two models have been established to

SOC estimation: a fuzzy rule-based model and an offline SOC estimation method based on a linear

interpolation model. In these two models, the current impedance profile of the battery, or the centroid of

the current impedance profile of the battery, were used as input data of the model to result as output the

respective estimated SOC.

Battery’s impedance profile changes with time and, related with these changes, its SOC also changes.

So the accuracy of models will depend on the time needed to update the impedance profiles database.

The shorter it is, more accurate are the models. However, increasing precision by decreasing the

update’s time interval, will cause a lengthier charging, as mentioned in Chapter 3, which can be seen

as a problem, depending on how the battery will operate.

As a solution, in this chapter, a technique is proposed to predict the impedance profile of the battery for

several SOC values. The technique will allow the prediction of the impedance profiles instead of

effectuating the impedance profiles measure during charging, which could be a lengthy process.

In terms of battery data supplied by VITO, the time interval considered for performing EIS experiments

of the battery for different SOCs (25%, 50% and 100%) was 1 month for a period of 10 months of tests.

Our goal will be to analyze this "past information" and to predict the next month’s impedance profile that,

without any estimating algorithm could have been obtained through EIS experiments for each SOC.

The prediction of the impedances profile will be obtained applying a fuzzy rule-based system as before.

For the fuzzy rules construction, with the goal to predict future impedance profiles, all the information

available from VITO obtained through EIS was used. The fuzzy model has 3 input variables: the real

and imaginary impedance values, and their corresponding frequency. It has to be noticed that the first

two inputs are variations of impedance and not only absolute values, as it is explained next through a

simple one dimensional example.

Consider Figure 7.1 that represents an input variable x that can take integer values between 0 and 10.

A certain sequence of input values numbered from 1 to 4 is represented by red circles from left to right.

1 2 3 4 5 6 7 8 9 10 x0

nº1 nº2 nº3 nº4

Figure 7.1 – Pattern example.

It is clear that a pattern is observable in the sequence of Figure 7.1, which allow us to predict that the

next circle will be at x = 7, as shown in the Figure 7.2, illustrated with a blue circle.

Page 89: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

74

1 2 3 4 5 6 7 8 9 10 x0

nº1 nº2 nº3 nº4 nº5

Figure 7.2 - Next point expected (blue circle) according with the pattern (red circles).

The main objective is thus to create a fuzzy model for this example in which the output of each rule is

computed as a function of the inputs. Here, the output will be the blue circle. Let’s continue with this

example creating a fuzzy model where a set of three rules characterize the system evolution. They are:

If input = 1 Then Output = 2.

If input = 2 Then Output = 4

If input = 4 Then Output = 5

This previous rules define the data points plotted in Figure 7.3.

0 1 2 3 4 5 6 7 8 9 10

Input

1

2

3

4

5

6

7

Output

8

9

10

Figure 7.3 – Inputs and outputs representing the three rules for pattern recognition.

The previous created set of rules does not “recognize” the previously referred pattern, i.e., for the input

= 5 the output is not defined in this model. When input = 5 is inserted, it causes an error in system’s

output. The only defined inputs are 1, 2 and 4 that, when inserted, result in their respective outputs.

For the model to recognize the pattern, instead using absolute values the model will have input

variations. This solution is exemplified next.

Using the same inputs illustrated in Figure 7.1, the model can be constructed using the following two

rules:

Page 90: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

75

2º point – If input variation= 1 (1º to 2º point) then output variation = 2 (2º to 3º point).

3º point – If input variation= 2 (2º to 3º point) then output variation = 1 (3º to 4º point).

Since there is no input variation when there is only one point, the rules are created when there are two

points or more.

The previous two increment rules are illustrated in Figure 7.4

0 1 2 3 4 5 6 7 8 9 10

Input

Variation

1

2

3

4

5

6

7

Output

Variation

8

9

10

Figure 7.4 – Variations as inputs and outputs of the rule-based model for pattern recognition.

To test the increment model previously constructed, point nº5 will be predicted now. It is inserted as

input variation = 1 (point nº3 to nº4). As output, one has variation = 2. At last, adding this value to point

nº4 (x = 5 + 2 = 7), point nº5 is obtained as expected as x = 7.

7.1 - Prediction of impedance profiles

In this Chapter, only the impedance profiles for SOCs of 25%, 50% and 100% have been used to create

the model, since for 75% the measurements from VITO are incomplete, i.e., for this SOC the impedance

profiles were not obtained all months.

The FIS for impedance profile prediction will use as input the difference between the impedance of the

previous and current month. The output will be the difference between the impedance of the current

month and the next one. To isolate every measure of impedances of different frequency another input

was considered to the model, corresponding to the frequencies of the performed impedance profiles

(Indicated in Annex 1). The inputs, real and imaginary part of the complex impedance, were both

Page 91: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

76

normalized with the highest value of each one. For example an entry can be visualized in the Figures

7.5 and 7.6.

Curves in Figures 7.5 (c) and 7.6 (c), the difference value between impedance profiles between two

consecutive months, represents the input data to produce the antecedent of the fuzzy rules. On the

other hand, the difference of impedance between months two and three will form the consequents of

the rules.

Figure 7.5 - EIS (Real part only) of the battery with 25 (red dots), 50 (yellow dots) and 100% (blue dots) of SOC at first month (a) and second month (b) and the impedance difference between those months represented in (c).

Page 92: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

77

Figure 7.6 - EIS (Imaginary part only) of the battery with 25 (red dots), 50 (yellow dots) and 100% (blue dots) of SOC at first month (a) and second month (b) and the impedance difference between those months represented in

(c).

Performing the same procedure for all months, except the last one, the inputs and outputs to be used

as rule antecedents and consequents are listed in Table 7.1.

Input Output

EIS 1ºmonth - EIS 2ºmonth EIS 2ºmonth - EIS 3ºmonth

EIS 2ºmonth - EIS 3ºmonth EIS 3ºmonth - EIS 4ºmonth

EIS 3ºmonth - EIS 4ºmonth EIS 4ºmonth - EIS 5ºmonth

EIS 4ºmonth - EIS 5ºmonth EIS 5ºmonth - EIS 6ºmonth

EIS 5ºmonth - EIS 6ºmonth EIS 6ºmonth - EIS 7ºmonth

EIS 6ºmonth - EIS 7ºmonth EIS 7ºmonth - EIS 8ºmonth

EIS 7ºmonth - EIS 8ºmonth EIS 8ºmonth - EIS 9ºmonth

Table 7.1 - Inputs and the respective outputs of the FIS.

There are two main types of fuzzy systems: Mamdani type and Sugeno type [20].

Page 93: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

78

Advantages of the Mamdani Method

• It is intuitive.

• It has widespread acceptance.

• It is well suited to human input.

Advantages of the Sugeno Method

• It is computationally efficient.

• It works well with linear techniques (e.g., PID control).

• It works well with optimization and adaptive techniques.

• It has guaranteed continuity of the output surface.

• It is well suited to mathematical analysis.

For the impedance profile prediction, the method chosen for FIS was the Sugeno one because:

1) the available data is extensive and complex;

2) the relation between input and output data is not intuitive to be expressed easily by

linguistic rules, and;

3) for the prediction FIS to work it needs guaranteed continuity of the output surface, i.e.

between known output values the intermediate values will correspond to a pattern of the

impedance evolution.

Since there is only one output per fuzzy model, one FIS was built for the real part of the impedance

(FIS_Real) and another one for the imaginary part (FIS_Img).

The fuzzy model named FIS_Real has 3 input variables and one output, as shown in table 7.2.

Input variables Output variable

Real(𝑍𝑚𝑜𝑛𝑡ℎ(𝑖−1) − 𝑍𝑚𝑜𝑛𝑡ℎ(𝑖))

= Real(Δ𝑍𝑖)

Img(𝑍𝑚𝑜𝑛𝑡ℎ(𝑖−1) − 𝑍𝑚𝑜𝑛𝑡ℎ(𝑖))

= Img(Δ𝑍𝑖) Frequency

Real(𝑍𝑚𝑜𝑛𝑡ℎ(𝑖) − 𝑍𝑚𝑜𝑛𝑡ℎ(𝑖+1))

= Real(Δ𝑍𝑖+1)

Table 7.2 –FIS_Real inputs and output (Real part of the complex impedance profile).

Each input variable was divided by five triangular membership functions, symmetric and equally

spaced, as illustrated in Figure 7.7.

Page 94: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

79

-0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6

0.5

1

Real(Δzi)

[Ohms]

Input 1

MF 1

Input 1

MF 2

Input 1

MF 3

Input 1

MF 4

Input 1

MF 5

0.5

1

-Img(Δzi)

[Ohms]

Input 2

MF 1

Input 2

MF 2

Input 2

MF 3

Input 2

MF 4

Input 2

MF 5

-0.4 -0.2 0 0.2 0.4 0.6

1000 2000 9000Frequency

[Hz]

Input 3

MF 1

Input 3

MF 2

Input 3

MF 3

Input 3

MF 4

Input 3

MF 5

3000 4000 5000 6000 7000 8000 10000

0.5

1

Figure 7.7 - Input membership functions used to define the three variables for FIS_Real.

To build the fuzzy model, the impedance profiles measured of months 1 to 9 were used as training data.

To test the operation of this fuzzy model, the EIS data composing the impedance profile of month 9 was

inserted as input and the prediction of the real part of the EIS one month ahead (month 10) was obtained

as output, as illustrated in Figure 7.8.

Page 95: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

80

Figure 7.8 - Prediction of the real part of the impedance profile of next month for 25%, 50% and 100% of SOC of the battery (red dots) and the actual impedance (blue dots).

The second fuzzy model, FIS_Img, is used to predict the imaginary part of the impedance profile. Its

input variables are the same ones used for the previous fuzzy model, FIS_Real, as shown Table 7.3.

Input variables Output variable

Real(𝑍𝑚𝑜𝑛𝑡ℎ(𝑖−1) − 𝑍𝑚𝑜𝑛𝑡ℎ(𝑖))

= Real(Δ𝑍𝑖)

Img(𝑍𝑚𝑜𝑛𝑡ℎ(𝑖−1) − 𝑍𝑚𝑜𝑛𝑡ℎ(𝑖))

= Img(Δ𝑍𝑖) Frequency

Img(𝑍𝑚𝑜𝑛𝑡ℎ(𝑖) − 𝑍𝑚𝑜𝑛𝑡ℎ(𝑖+1))

= Img(Δ𝑍𝑖+1)

Table 7.3 – FIS_Img inputs and output (Imaginary part of the complex impedance profile).

Inserting the same input, the EIS data of month 9, the imaginary part of the impedance profile of month

10 is expected as output, as it can be observed in the Figure 7.9.

0 20 40 60 80 100 120

0.2

0.25

0.3

0.35

0.4

0.45

0.5

0.55

0.6

0.65

Index

Re(Z

) /

Re(Z

o)

25% 50% 100%

Page 96: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

81

Figure 7.9 - Prediction of the imaginary part of the impedance profile of next month for 25%, 50% and 100% of SOC of the battery (red dots) and the actual imaginary impedance (blue dots).

Observing the prediction of the real and imaginary part of the impedance profile of next month (10𝑡ℎ

month), Figure 7.8 and 7.9 respectively, a prediction error is noticed, i.e. a difference between the

predictions values (red dots) and the actual impedance values (blue dots). This prediction error can

cause the inaccuracy of SOC estimation methods, for example the methods presented in Chapter 5 and

Chapter 6. The mean absolute error of FIS_Real model is listed on Table 7.4.

SOC

Mean absolute error

between prediction and the

EIS

25% 0,017617

50% 0,003091

100% 0,015790

Table 7.4 – Mean absolute error of the real part of the impedance profile prediction.

The error of the prediction of the FIS_Img model, the prediction of the imaginary part of the impedance

profile, can be visualized on table 7.5.

0 20 40 60 80 100 120-0.25

-0.2

-0.15

-0.1

-0.05

0

0.05

0.1

0.15

0.2

0.25

Index

-Im

g(Z

) /

Img(Z

o)

25% 50% 100%

Page 97: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

82

SOC

Mean absolute error

between prediction and the

EIS curve

25% 0,012822

50% 0,008527

100% 0,009796

Table 7.5 – Mean absolute error of the imaginary part of the impedance spectrum prediction.

The mean absolute error of the impedance spectrum prediction of other months is listed in Annex 3.

Through the analysis of the relative error of the prediction of the real and imaginary impedance, it is

possible to observe that the prediction of the fuzzy models are not sufficiently accurate. The main two

causes of this inaccuracy are:

Insufficient experimental data in the construction of the fuzzy model: EISs were only done for

25, 50 and 100% of battery’s SOC, and only for nine periods of time during 10 months.

Experimental data was obtained through various EIS experiments with one month of interval,

which in this case is too extensive, since the variation of impedance profile is too drastic as

seen during monthly intervals. In this case, causing a loss of information about the evolution

of the battery impedance profiles over time, that is, only with this impedance data, the

recognition of a pattern is extremely difficult and inaccurate.

Introducing these reasons for the lack of precision of the fuzzy models, a method is proposed not

as a solution for:

the lack of data available for the construction of the system,

the time interval being too long between EIS measurements, or

the lack of EIS measurements for more SOCs.

The proposed method presented below takes into account that more data is needed to construct a

fuzzy model that presents an impedance profiles prediction with an admissible level of accuracy.

7.2 - Impedance profiles prediction using data interpolation

The available data for this dissertation was provided by VITO. However, this data has revealed itself

incomplete to ensure our goal of an accurate prediction of battery impedance profiles. To improve the

functionality of the fuzzy models, a new training data set was considered. Through computing

intermediate impedance profiles between months (the mean between impedance profiles), is had been

able able to duplicate the training set. Let’s assume than that this procedure could be regarded as actual

experimental data from the battery in which the EIS experiments were made every half month. For

example, using the first and second EIS to compute an intermediate EIS as shown in Figures 7.10 and

7.11 for the real and imaginary data, respectively.

Page 98: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

83

Figure 7.10 - Real part of the intermediate impedance profile (red dots) between EIS of the battery with 100% of SOC performed in month 1 (blue dots) and month 2 (black dots).

Figure 7.11 - Imaginary part of the intermediate impedance profile (red dots) between EIS of the battery with 100% of SOC performed in month 1 (blue dots) and month 2 (black dots).

The two fuzzy models FIS_Real and FIS_Img are recalculated using the new training set (EISs of the

battery with 25%, 50% and 100% SOC but made with a half month interval).

Now, the input variables now, instead being the difference between EISs that were made with an interval

of one month, it is calculated the difference between EISs with an interval of half a month. The domain

for each input was again divided in five triangular membership functions as before. The membership

functions for each input variable are shown in Figure 7.12.

0 5 10 15 20 25 30 35 400.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Index

Re(Z

) /

Re(Z

o)

0 5 10 15 20 25 30 35 40-0.2

-0.1

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

Index

-Im

g(Z

) /

Img(Z

o)

Page 99: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

84

-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2 0.25 0.3

0.5

1

Real(Δzi)

[Ohms]

Input 1

MF 1

Input 1

MF 2

Input 1

MF 3

Input 1

MF 4

Input 1

MF 5

0.5

1

-Img(Δzi)

[Ohms]

Input 2

MF 1

Input 2

MF 2

Input 2

MF 3

Input 2

MF 4

Input 2

MF 5

-0.2 -0.1 0 0.1 0.2 0.3

1000 2000 9000Frequency

[Hz]

Input 3

MF 1

Input 3

MF 2

Input 3

MF 3

Input 3

MF 4

Input 3

MF 5

3000 4000 5000 6000 7000 8000 10000

0.5

1

Figure 7.12 - Input membership functions plots.

The selection of the number of membership functions was performed through the analyses of the

impedance profiles prediction error (the number is limited by the capacity of the personal computer

performance). Several simulations were performed in order to select the number of membership

functions which presented the lowest prediction error.

Page 100: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

85

Two fuzzy models were constructed, as before, one with the real part of the prediction of the impedance

profile as output and the other one with the imaginary part. The input and output variables used in the

fuzzy models are listed in Tables 7.6 and 7.7.

Inputs Output

Real(𝑍𝑚𝑜𝑛𝑡ℎ2

(𝑖−1)− 𝑍𝑚𝑜𝑛𝑡ℎ

2 (𝑖)

)

= Real(Δ𝑍𝑖)

Img(𝑍𝑚𝑜𝑛𝑡ℎ2

(𝑖−1)− 𝑍𝑚𝑜𝑛𝑡ℎ

2 (𝑖)

)

= Img(Δ𝑍𝑖)

Frequency Real(𝑍𝑚𝑜𝑛𝑡ℎ2

( 𝑖)− 𝑍𝑚𝑜𝑛𝑡ℎ

2( 𝑖+1)

)

= Real(Δ𝑍𝑖+1)

Table 7.6 - FIS inputs and output (Real part of the complex impedance profile).

Inputs Output

Real(𝑍𝑚𝑜𝑛𝑡ℎ2

(𝑖−1)− 𝑍𝑚𝑜𝑛𝑡ℎ

2 (𝑖)

)

= Real(Δ𝑍𝑖)

Img(𝑍𝑚𝑜𝑛𝑡ℎ2

( 𝑖−1)− 𝑍𝑚𝑜𝑛𝑡ℎ

2( 𝑖)

)

= Img(Δ𝑍𝑖)

Frequency Img(𝑍𝑚𝑜𝑛𝑡ℎ2

( 𝑖)− 𝑍𝑚𝑜𝑛𝑡ℎ

2 (𝑖+1)

)

= Img(Δ𝑍𝑖+1)

Table 7.7 - FIS inputs and output (Imaginary part of the complex impedance profile).

Entering as input in the fuzzy models the intermediate EIS between month 9𝑡ℎ and 10𝑡ℎ of the battery

with 25%, 50% and 100% of SOC, the prediction of the EIS of month 10𝑡ℎ(which was excluded in the

computation of both models) is expected as output.

Figures 7.13 and 7.14 show the experimental and the predicted EIS profiles, the real and the imaginary

part respectively.

Figure 7.13 - Prediction of the real part of the impedance profile for 25%, 50% and 100% of the battery SOC (red dots) and the actual impedance profile (blue dots) for month 10.

0 20 40 60 80 100 120

0.2

0.25

0.3

0.35

0.4

0.45

0.5

0.55

0.6

0.65

Re(Z

) /

Real(Z

o)

Index

25% 50% 100%

Page 101: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

86

Figure 7.14 - Prediction of the imaginary part of the impedance profile for 25%, 50% and 100% of SOC of the battery (red dots) and the actual impedance (blue dots) for month 10.

The mean absolute errors for the prediction of the real and imaginary part of the impedance profiles can

be visualized on tables 7.8 and 7.9 respectively.

SOC

Mean absolute error

between prediction and the

EIS curve

25% 0,003408

50% 0,001678

100% 0,004260

Table 7.8 - Mean absolute error of the real part of the impedance prediction.

SOC

Mean absolute error

between prediction and the

EIS curve

25% 0,002402

50% 0,003300

100% 0,003664

Table 7.9 - Mean absolute error of the imaginary part of the impedance prediction.

The mean absolute error of the impedance spectrum prediction of other months is listed in Annex 3.

0 20 40 60 80 100 120-0.25

-0.2

-0.15

-0.1

-0.05

0

0.05

0.1

0.15

0.2

0.25

-Im

g(Z

) /

Img(Z

o)

Index

25% 50% 100%

Page 102: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

87

Comparing Figures 7.13 and 7.14 with Figures 7.8 and 7.9 a clear increase of precision is observed

between those predictions, the error is decreased, as can be observed comparing Table 7.8 with 7.4

(Error of the real part of the impedance prediction) and table 7.9 with 7.5 (Error of the imaginary part of

the impedance prediction).

Page 103: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

88

7.3 - Conclusion

The performance of the impedance spectrums prediction method will depend on the data available to

construct the FIS, i.e. if pattern of evolution between impedance spectrums for each SOC is observable.

If the time interval between EIS of the battery is too large, the impedance spectrums can present very

large variations, as a consequence this shortage in data will prevent an analysis and comprehension of

the evolution of impedance spectrums over time, during which the battery is subjected to discharge and

charge cycles. As demonstrated in this chapter, in sub chapter 7.1, with the experimental data provided

by the institute VITO, this method presents inaccurate values due to a large variations between

impedance spectrums.

In the sub chapter 7.2, it is proved that this method presents precise and accurate output values if the

variation between impedance spectrums is not too drastic. Assuming the impedance spectrums

interpolation as new data of the battery, subjected to EIS periodically, with a time interval of half month,

this method obtains good estimations of future impedance spectrums.

This prediction method enables the reduction of the negative effects of the SOC estimation methods

presented earlier, if implemented in conjunction with them. As seen in previous chapters, the main

drawback of the SOC estimation methods is the need to update of the impedance spectrums database,

which, when performed, prolongs the charging time of the respective battery. The prediction method

performs the estimation of future battery impedance spectrums, enabling SOC estimation methods,

during the battery charging when the database is being updated, not to need more EIS measurements

to obtain impedance spectrums since these are predicted, therefore not increasing the charging time.

For this prediction method to work it is necessary to perform EIS always for the same predefined

battery’s SOC, for this thesis they were performed for 25, 50 and 100%, since it is necessary to analyze

the evolution of impedance for these SOCs in order to predict future impedance spectrums for each

SOC. Contrarily to the SOC’s estimation methods this prediction method requires the EISs

measurements to be always performed for the same SOCs, this lack of flexibility presents a major

disadvantage of this method.

Page 104: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

89

8 - Future Work

The methods of SOC estimation and impedance spectrums prediction presented in this thesis are

basically theoretical projects of possible prototypes, but like any other project, there is always room for

improvement and enhancement.

The SOC estimation method presented in chapter 5, as referred in the sub chapter 5.3 – Conclusion,

when used in conjunction with other SOC estimation methods, for example the Coulomb counting

technique, can correct/update the latter. For better results it can be studied / analyzed for which output

SOC values of these conventional techniques there is a greater imprecision. Once knowing these

values, we can increase the number of SOC estimating outputs of the proposed method in order to

correct the traditional techniques of SOC estimation for a better and more accurate correction.

In chapter 6 is proposed a method capable of continuously estimating the battery’s SOC, by creating a

database of impedance profile centroids with the respective OCV (i.e. SOC). For best results it is

necessary to choose the best impedance profile centroids which will then be saved in the database.

Since the quality of the results obtained will depend on their position it is important to chose the ones

that confer the most realistic linear interpolation of the centroids (to obtain the SOC output). Assuming

that while the SOC varies, the centroids positions will describe a pattern, the intention is to chose the

centroids that will permit to describe approximately this pattern with linear interpolations between the

chosen centroids.

In this case, choosing for which OCV an EIS is performed to increase the ease of detecting a pattern of

the impedance variation with the OCV/SOC of the battery, the higher the quality of this database.

Finally in chapter 7, is introduced an impedance spectrum prediction method. As demonstrated, the

available impedance spectroscopy data is not the most suitable for this method, since the variations

between the impedance spectrums were too large, preventing the detection of a pattern evolution. And

as observed, the performance of this method also depends on the impedance spectrums database. This

database must be created in order to observe a pattern of variation of the impedance of the battery over

time, for each battery SOC. For better performance of this last method it will be necessary to conduct

further tests in order to discover which is the best time interval between EIS, in order to recognize a

pattern of evolution of the battery’s impedance spectrums.

Page 105: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

90

Bibliography

Borong Wu, Y. R. (2011). LiFePO4 Cathode Material, Electric Vehicles. The Benefits and Barriers, Dr.

Seref Soylu (Ed.), ISBN: 978-953-307-287-6, InTech, Available from:

http://www.intechopen.com/books/electric-vehicles-the-benefits.

Bouwman, P. J. (2002). LITHIUM INTERCALATION in preferentially oriented submicron LiCoO2 films.

PhD Dissertation, MESA+ Research Institute of the University of Twente and at the Philips

Research Laboratories in Eindhoven.

Kinyanjui, M. K. (2010. ). Electronic and Structural Properties of Li(1-x) FePO4 (X = 0 , 0.5 ,1). PhD

Dissertation, Faculty of Natural Sciences, University of Ulm, Karuri, Kenya.

Sethuraman, V., Laurence, H., Venkat, S., & Robert, K. (2010). Surface structural disordering in graphite

upon lithium intercalation/deintercalation. Environmental Energy Technologies Division,

Lawrence Berkeley National Laboratory, Berkeley, CA 94720-8168, USA.

Mathworks. (2014). Fuzzy Logical Tollbox, User's Guide R2014a. Retrieved from

http://www.mathworks.com/help/pdf_doc/fuzzy/fuzzy.pdf

Branco, P. J. C. (1998). Aprendizagem por Exemplos Utilizando Lógica "Fuzzy" Na Modelização

e Controlo de um Accionamento Electrohidráulico. PhD Dissertation, Instituto Superior Técnico,

Universidade Técnica de Lisboa, Portugal.

[1] Chil-Hoon Doh and Angathevar Veluchamy. (2010). Thermo-Chemical Process Associated with

Lithium Cobalt Oxide Cathode in Lithium Ion Batteries, Lithium-ion Batteries, Chong Rae Park

(Ed.), ISBN: 978-953-307-058-2, InTech. , Available from:

http://www.intechopen.com/books/lithium-ion-batteries/thermo-chemical-process-associated-

with-lithium-cobalt-oxide-cathode-in-lithium-ion-batteries.

[2] Arnold, G., Garche, J., Hemmer, R., Ströbele, S., Vogler, C., & Wohlfahrt-Mehrens, M. (2003). Fine-

particle lithium iron phosphate LiFePO4 synthesized by a new low-cost aqueous precipitation

technique. Helmholtzstraße, Germany, Journal of Power Sources 119–121 (2003) pp.247–251.

[3] Cottrell, T. L. (n.d.). The stengths of Chemical Bonds. Michigan: Butterworths Scientific Publications.

[4] Linden, D., & Reddy, T. (1995). Handbook of Batteries 3d ed. , Chapter 2, pp. 2.4.

[5] Linden, D., & Reddy, T. (1995). Handbook of Batteries 3d ed. , Chapter 8, pp. 8.30.

[6] Linden, D., & Reddy, T. (1995). Hanbook of batteries 3d ed. , Chapter 2, pp. 2.10.

[7] Linden, D., & Reddy, T. (1995). Hanbook of batteries 3d ed. , Chapter 2, pp. 2.16.

[8] Khan, M. R., Mulder, G., Mierlo, J. V. (2013). An online framework for state of charge

determination of battery systems using combined system identification approach:

Elsevier B.V.

Page 106: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

91

[9] Omar, N., Monem, M. A., Firouz, Y., Salminen, J., Smekens, J., Hegazy, O., . . . Mierlo, J. V. (2013).

Lithium iron phosphate based battery – Assessment of the aging. Belgium: Elsevier Ltd, pp

1579.

[10] Omar, N., Monem, M. A., Firouz, Y., Salminen, J., Smekens, J., Hegazy, O., . . . Mierlo, J. V. (2013).

Lithium iron phosphate based battery – Assessment of the aging. Belgium: Elsevier Ltd, pp

1579.

[11] Omar, N., Monem, M. A., Firouz, Y., Salminen, J., Smekens, J., Hegazy, O., . . . Mierlo, J. V. (2013).

Lithium iron phosphate based battery – Assessment of the aging. Belgium: Elsevier Ltd, pp

1580.

[12] Rahmoun, A.,Biechl, h. (2012) Modelling of Li-ion batteries using equivalent circuit diagrams.

University of Applied Sciences Kempten, Bahnhofstraße 61, 87435 Kempten, Germany.

[13] Borong Wu, Y. R. (2011). LiFePO4 Cathode Material, Electric Vehicles. The Benefits and Barriers,

Dr. Seref Soylu (Ed.), ISBN: 978-953-307-287-6, InTech, Available from:

http://www.intechopen.com/books/electric-vehicles-the-benefits.

[14] Wagner, R. Multi-Linear Interpolation, Available from:

http://bmia.bmt.tue.nl/people/BRomeny/Courses/8C080/Interpolation.pdf

[15] Martinez, C., Sorlien, D., Goodrich, R., Chandler, L., Magnuson, D. (2005) Using Cell Balancing to

Maximize the Capacity of Multi-cell Li-Ion Battery Packs.

[16] Roth, E. P., and Christopher J. Orendorff. (2012) How electrolytes influence battery safety.

Electrochemical Society Interface 21.2: 45-49.

[17] Zhang, S. S. (2007). A review on the separators of liquid electrolyte Li-ion batteries, Journal of

Power Sources, Volume 164, Issue 1, 10 January, Pages 351-364

[18] A. Patil V. Patil, D.W. Shin, J.W. Choi, D.D. Paik, S.J. Yoon, Materials Research Bulletin 43 (2008)

1913-1942.

[19]Bouwman, P. J. (2002). LITHIUM INTERCALATION in preferentially oriented submicron LiCoO2

films. PhD Dissertation, MESA+ Research Institute of the University of Twente and at the Philips

Research Laboratories in Eindhoven, pp 3.

[20] MathWorks® R2014a Documentation, “Comparison of Sugeno and Mamdani Systems” from:

http://www.mathworks.com/help/fuzzy/comparison-of-sugeno-and-mamdani-systems.html

[21] “The New Lithium Iron Phosphate Battery Features an Innovative Production Method” from:

http://batteryplusforlife.com/research.html

Page 107: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

92

Annex 1

Electrochemical Impedance Spectroscopy (2nd month, 75% SOC, 1st sweep)

Frequency [Hz] Date dd/mm/yyyy and time [hours:minutes:seconds]

10019.53 '03/27/2013 11:43:19.9901'

7187.216 '03/27/2013 11:43:22.2750'

5171.226 '03/27/2013 11:43:25.3154'

3715.945 '03/27/2013 11:43:28.3824'

2674.278 '03/27/2013 11:43:31.4504'

1923.077 '03/27/2013 11:43:34.5184'

1382.211 '03/27/2013 11:43:37.5864'

991.5099 '03/27/2013 11:43:38.6884'

712.4918 '03/27/2013 11:43:39.7894'

513.1934 '03/27/2013 11:43:40.8914'

368.7021 '03/27/2013 11:43:41.9935'

265.4246 '03/27/2013 11:43:43.0904'

191.2854 '03/27/2013 11:43:44.1824'

137.3291 '03/27/2013 11:43:45.2643'

98.64263 '03/27/2013 11:43:46.3755'

70.83875 '03/27/2013 11:43:47.4624'

51.12892 '03/27/2013 11:43:48.5393'

36.75235 '03/27/2013 11:43:49.3812'

26.39358 '03/27/2013 11:43:50.2182'

18.96237 '03/27/2013 11:43:51.3707'

13.62645 '03/27/2013 11:43:52.3289'

9.814698 '03/27/2013 11:43:53.2215'

7.038291 '03/27/2013 11:43:54.4360'

5.059908 '03/27/2013 11:43:56.0901'

3.637104 '03/27/2013 11:43:58.3629'

2.625167 '03/27/2013 11:44:01.4829'

1.887077 '03/27/2013 11:44:05.7951'

1.356336 '03/27/2013 11:44:11.7653'

0.975343 '03/27/2013 11:44:20.0403'

0.700045 '03/27/2013 11:44:31.5422'

0.504488 '03/27/2013 11:44:47.4767'

0.362731 '03/27/2013 11:45:09.6101'

0.259793 '03/27/2013 11:45:40.4896'

0.187566 '03/27/2013 11:46:23.2339'

0.134633 '03/27/2013 11:47:22.7607'

0.096675 '03/27/2013 11:48:45.6356'

0.069557 '03/27/2013 11:50:40.7958'

0.049989 '03/27/2013 11:53:21.0117'

Page 108: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

93

Electrochemical Impedance Spectroscopy (2nd month, 75% SOC, 2nd sweep)

Frequency [Hz] Date dd/mm/yyyy and time [hours:minutes:seconds]

10019.53 '03/27/2013 11:53:22.0156'

7187.216 '03/27/2013 11:53:24.6051'

5171.226 '03/27/2013 11:53:27.6464'

3715.945 '03/27/2013 11:53:30.7145'

2674.278 '03/27/2013 11:53:33.7825'

1923.077 '03/27/2013 11:53:36.8505'

1382.211 '03/27/2013 11:53:39.9184'

991.5099 '03/27/2013 11:53:41.0205'

712.4918 '03/27/2013 11:53:42.1225'

513.1934 '03/27/2013 11:53:43.2235'

368.7021 '03/27/2013 11:53:44.3255'

265.4246 '03/27/2013 11:53:45.4225'

191.2854 '03/27/2013 11:53:46.5144'

137.3291 '03/27/2013 11:53:47.5954'

98.64263 '03/27/2013 11:53:48.7075'

70.83875 '03/27/2013 11:53:49.7944'

51.12892 '03/27/2013 11:53:50.8714'

36.75235 '03/27/2013 11:53:51.7132'

26.39358 '03/27/2013 11:53:52.5502'

18.96237 '03/27/2013 11:53:53.7017'

13.62645 '03/27/2013 11:53:54.6599'

9.814698 '03/27/2013 11:53:55.5525'

7.038291 '03/27/2013 11:53:56.7670'

5.059908 '03/27/2013 11:53:58.4211'

3.637104 '03/27/2013 11:54:00.6939'

2.625167 '03/27/2013 11:54:03.8149'

1.887077 '03/27/2013 11:54:08.1262'

1.356336 '03/27/2013 11:54:14.0951'

0.975343 '03/27/2013 11:54:22.3713'

0.700045 '03/27/2013 11:54:33.8732'

0.504488 '03/27/2013 11:54:49.8077'

0.362731 '03/27/2013 11:55:11.9464'

0.259793 '03/27/2013 11:55:42.8260'

0.187566 '03/27/2013 11:56:25.5713'

0.134633 '03/27/2013 11:57:25.0969'

0.096675 '03/27/2013 11:58:47.9719'

0.069557 '03/27/2013 12:00:43.1330'

0.049989 '03/27/2013 12:03:23.3489'

* The frequencies and durations (deducted from the values of the right column) listed in the tables above are the

same for all of EISs used in this thesis. The frequencies are the same used in both EIS sweeps.

Page 109: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

94

Annex 2

A fuzzy set is completely characterized by its membership function. Since most fuzzy sets in use have

a universe of discourse X consisting of the real line R.

A triangular membership function is specified by three parameters {a, b, c} as follows:

Triangle(x; a, b, c) =

{

0, 𝑥 ≤ 𝑎. 𝑥−𝑎

𝑏−𝑎, 𝑎 ≤ 𝑥 ≤ 𝑏.

𝑐−𝑥

𝑐−𝑏, 𝑏 ≤ 𝑥 ≤ 𝑐.

0, 𝑐 ≤ 𝑥.

The parameters {a, b, c} (with a < b < c) determine the x coordinates of the three corners of the

underlying triangular membership functions. (http://www.bindichen.co.uk/post/AI/fuzzy-inference-

membership-function.html).

Page 110: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

95

Annex 3

Chapter 7.1

FIS computed with EIS’s performed

until month:

EIS prediction of month:

Mean error Mean absolute error

Real Part Impedance prediction

Img. Part Impedance prediction

Real Part Impedance prediction

Img. Part Impedance prediction

25% SOC

50% SOC

100% SOC

All SOC

25% SOC

50% SOC

100% SOC

All SOC

25% SOC

50% SOC

100% SOC

All SOC

25% SOC

50% SOC

100% SOC

All SOC

3 4 0,033909 0,044774 0,078030 0,052238 0,053990 0,068537 0,131772 0,084766 0,043556 0,074901 0,137774 0,085410 0,053990 0,068537 0,131772 0,084766

4 5 -

0,031578 0,001435 0,014583

-0,005187

0,106177 0,070554 0,066262 0,080998 0,055329 0,051723 0,036799 0,047950 0,106177 0,070554 0,066262 0,080998

5 6 -

0,007416 0,000309 0,025256 0,006050

-0,006483

-0,010697

0,042071 0,008297 0,016906 0,016071 0,040532 0,024503 0,014634 0,017767 0,061338 0,031246

6 7 -

0,009872 -

0,005844 -

0,002171 -

0,005962 -

0,004543 -

0,006083 0,033571 0,007648 0,027309 0,021411 0,029306 0,026008 0,031350 0,023100 0,046730 0,033727

7 8 -

0,039403 -

0,042705 0,008371

-0,024579

0,002206 0,005761 0,050390 0,019452 0,039824 0,042705 0,057433 0,046654 0,008946 0,008961 0,051462 0,023123

8 9 -

0,009563 -

0,023647 0,004908

-0,009434

0,001046 -

0,002924 0,017399 0,005174 0,010601 0,024418 0,039081 0,024700 0,009961 0,009755 0,047452 0,022389

9 10 -

0,017617 -

0,000656 -

0,015791 -

0,011355 -

0,012681 -

0,008502 -

0,009288 -

0,010157 0,017617 0,003091 0,015791 0,012166 0,012681 0,008502 0,009288 0,010157

Page 111: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

96

Chapter 7.2

FIS computed with EIS’s performed

until month:

EIS prediction of month:

Mean error Mean absolute error

Real Part Impedance prediction

Img. Part Impedance prediction

Real Part Impedance prediction

Img. Part Impedance prediction

25% SOC

50% SOC

100% SOC

All SOC

25% SOC

50% SOC

100% SOC

All SOC

25% SOC

50% SOC

100% SOC

All SOC

25% SOC

50% SOC

100% SOC

All SOC

3 4 0,006747 -

0,011706 -

0,088240 -

0,031066 -

0,014629 -

0,019041 -

0,103380 -

0,045683 0,006852 0,014040 0,088240 0,036377 0,014629 0,019041 0,103380 0,045683

4 5 0,009608 -

0,010106 -

0,037390 -

0,012629 -

0,007481 -

0,006035 -

0,039146 -

0,017554 0,009608 0,016246 0,038852 0,021569 0,007511 0,006035 0,046839 0,020129

5 6 -

0,001185 0,033817 0,057167 0,029933 0,027151 0,030171 0,063042 0,040122 0,012892 0,037904 0,060414 0,037070 0,027151 0,030171 0,063042 0,040122

6 7 -

0,006956 0,016521 0,008993 0,006186 0,046622 0,031892 0,016459 0,031658 0,020983 0,029982 0,017297 0,022754 0,046622 0,031892 0,021706 0,033407

7 8 -

0,006272 -

0,025112 -

0,009582 -

0,013655 -

0,021049 -

0,015101 0,006577

-0,009858

0,011583 0,027071 0,019364 0,019339 0,021049 0,015101 0,030716 0,022289

8 9 -

0,004947 -

0,009859 0,001610

-0,004398

-0,008919

-0,007033

0,009088 -

0,002288 0,005510 0,011072 0,012081 0,009554 0,008963 0,007033 0,021997 0,012664

9 10 0,002998 0,012293 0,008042 0,007777 0,009799 0,004850 0,006158 0,006936 0,005588 0,012293 0,009536 0,009139 0,009799 0,005174 0,011539 0,008837

10 11 0,000637 0,005478 0,005396 0,003837 0,006881 0,003940 0,013697 0,008172 0,004961 0,005478 0,006156 0,005531 0,006930 0,003966 0,013843 0,008246

11 12 -

0,005822 -

0,008965 -

0,007598 -

0,007462 -

0,008191 -

0,005322 0,004095

-0,003139

0,017176 0,014746 0,012237 0,014719 0,012064 0,009905 0,010886 0,010952

12 13 -

0,005982 -

0,006348 -

0,004609 -

0,005646 0,000342

-0,000113

0,005100 0,001776 0,010776 0,009527 0,008042 0,009448 0,005499 0,004350 0,007148 0,005665

13 14 -

0,011528 -

0,013270 0,008486

-0,005437

0,000093 0,002010 0,017065 0,006389 0,011528 0,013270 0,024137 0,016312 0,003498 0,002766 0,018451 0,008238

14 15 -

0,006572 -

0,009124 0,006920

-0,002925

-0,002810

-0,001725

0,015338 0,003601 0,006572 0,009124 0,020805 0,012167 0,002810 0,002934 0,020095 0,008613

15 16 0,002870 -

0,001453 -

0,009571 -

0,002718 0,003552 0,000533

-0,013602

-0,003173

0,003343 0,002712 0,013910 0,006655 0,003865 0,002582 0,016417 0,007621

16 17 -

0,001999 -

0,004026 -

0,000654 -

0,002226 -

0,000648 0,000187 0,000272

-0,000063

0,001999 0,004026 0,001100 0,002375 0,000781 0,002529 0,001931 0,001747

17 18 -

0,006741 0,003895

-0,006974

-0,003274

-0,005872

-0,004509

-0,005041

-0,005141

0,006741 0,004225 0,006974 0,005980 0,005872 0,004509 0,005041 0,005141

18 19 -

0,003408 0,001585

-0,004174

-0,001999

-0,002402

-0,003300

-0,003664

-0,003122

0,003408 0,001678 0,004260 0,003116 0,002402 0,003300 0,003664 0,003122

Page 112: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

97

Annex 4 𝐌𝐚𝐭𝐥𝐚𝐛® code

Data load

cell1_25 = importdata('1month25.mat'); cell1_50 = importdata('1month50.mat'); cell1_75 = importdata('1month75.mat'); cell1_100 = importdata('1month100.mat');

cell2_25 = importdata('2month25.mat'); cell2_50 = importdata('2month50.mat'); cell2_75 = importdata('2month75.mat'); cell2_100 = importdata('2month100.mat');

cell3_25 = importdata('3month25.mat'); cell3_50 = importdata('3month50.mat'); cell3_75 = importdata('3month75.mat'); cell3_100 = importdata('3month100.mat');

cell4_25 = importdata('4month25.mat'); cell4_50 = importdata('4month50.mat'); cell4_75 = importdata('4month75.mat'); cell4_100 = importdata('4month100.mat');

cell5_25 = importdata('5month25.mat'); cell5_50 = importdata('5month50.mat'); cell5_75 = importdata('5month75.mat'); cell5_100 = importdata('5month100.mat');

cell6_25 = importdata('6month25.mat'); cell6_50 = importdata('6month50.mat'); cell6_75 = importdata('6month75.mat'); cell6_100 = importdata('6month100.mat');

cell7_25 = importdata('7month25.mat'); cell7_50 = importdata('7month50.mat'); cell7_100 = importdata('7month100.mat');

cell8_25 = importdata('8month25.mat'); cell8_50 = importdata('8month50.mat'); cell8_100 = importdata('8month100.mat');

cell9_25 = importdata('9month25.mat'); cell9_50 = importdata('9month50.mat'); cell9_100 = importdata('9month100.mat');

cell10_25 = importdata('10month25.mat'); cell10_50 = importdata('10month50.mat'); cell10_100 = importdata('10month100.mat');

Page 113: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

98

Chapter 5

clear all close all clc

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Select one option for loading impedance profiles

% (a) Standard Impedance Profile data

% (b) Average Impedance Profile data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % (a) Load impedance profiles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% zReal25 = cell1_25.ReZ_Ohm; zReal50 = cell1_50.ReZ_Ohm; zReal75 = cell1_75.ReZ_Ohm; zReal100 = cell1_100.ReZ_Ohm;

zImg25 = cell1_25.neg_ImZ_Ohm; zImg50 = cell1_50.neg_ImZ_Ohm; zImg75 = cell1_75.neg_ImZ_Ohm; zImg100 = cell1_100.neg_ImZ_Ohm;

zReal = [cell1_25.ReZ_Ohm; cell1_50.ReZ_Ohm; cell1_75.ReZ_Ohm; cell1_100.ReZ_Ohm];

zImg = [ cell1_25.neg_ImZ_Ohm; cell1_50.neg_ImZ_Ohm; cell1_75.neg_ImZ_Ohm; cell1_100.neg_ImZ_Ohm];

output(1:76) = 25; output(77:152) = 50; output(153:228) = 75; output(229:304) = 100; data = [[zReal,zImg],output'];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % (b) Load impedance profiles and its average computation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% zReal25 = [(cell1_25.ReZ_Ohm(1:38)+cell1_25.ReZ_Ohm(39:76))/2]; zReal50 = [(cell1_50.ReZ_Ohm(1:38)+cell1_50.ReZ_Ohm(39:76))/2]; zReal75 = [(cell1_75.ReZ_Ohm(1:38)+cell1_75.ReZ_Ohm(39:76))/2]; zReal100 = [(cell1_100.ReZ_Ohm(1:38)+cell1_100.ReZ_Ohm(39:76))/2];

zImg25 = [(cell1_25.neg_ImZ_Ohm(1:38)+cell1_25.neg_ImZ_Ohm(39:76))/2]; zImg50 = [(cell1_50.neg_ImZ_Ohm(1:38)+cell1_50.neg_ImZ_Ohm(39:76))/2]; zImg75 = [(cell1_75.neg_ImZ_Ohm(1:38)+cell1_75.neg_ImZ_Ohm(39:76))/2]; zImg100 = [(cell1_100.neg_ImZ_Ohm(1:38)+cell1_100.neg_ImZ_Ohm(39:76))/2];

zReal = [zReal25; zReal50; zReal75; zReal100];

Page 114: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

99

zImg = [ zImg25; zImg50; zImg75; zImg100];

output(1:38) = 25; output(39:76) = 50; output(77:114) = 75; output(115:152) = 100; data = [[zReal,zImg],output'];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Generate Fuzzy Inference System structure from data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% in_fis = genfis2([zReal,zImg],output,0.2); anfisedit(in_fis);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Membership Functions Grid Drawing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% figure; hold on; nrMF = size(anfis.input(1, 2).mf); for i = 1: nrMF(1,2) if i < nrMF(1,2)

line([anfis.input(1,1).range(1,1),anfis.input(1,1).range(1,2)],[(anfis.inpu

t(1,2).mf(1,i).params(1,2)+anfis.input(1,2).mf(1,i+1).params(1,2))/2,(anfis

.input(1,2).mf(1,i).params(1,2)+anfis.input(1,2).mf(1,i+1).params(1,2))/2],

'LineWidth',0.001,'Color',[0 0 0]); else

line([anfis.input(1,1).range(1,1),anfis.input(1,1).range(1,2)],[anfis.input

(1,2).mf(1,1).params(1,2),anfis.input(1,2).mf(1,1).params(1,2)],'LineWidth'

,0.001,'Color',[0 0 0]);

line([anfis.input(1,1).range(1,1),anfis.input(1,1).range(1,2)],[anfis.input

(1,2).mf(1,i).params(1,2),anfis.input(1,2).mf(1,i).params(1,2)],'LineWidth'

,0.001,'Color',[0 0 0]); end end nrMF = size(anfis.input(1, 1).mf); for i = 1: nrMF(1,2) if i < nrMF(1,2)

line([(anfis.input(1,1).mf(1,i).params(1,2)+anfis.input(1,1).mf(1,i+1).para

ms(1,2))/2,(anfis.input(1,1).mf(1,i).params(1,2)+anfis.input(1,1).mf(1,i+1)

.params(1,2))/2],[anfis.input(1,2).range(1,1),anfis.input(1,2).range(1,2)],

'LineWidth',0.001,'Color',[0 0 0]); else

line([anfis.input(1,1).mf(1,1).params(1,2),anfis.input(1,1).mf(1,1).params(

1,2)],[anfis.input(1,2).range(1,1),anfis.input(1,2).range(1,2)],'LineWidth'

,0.001,'Color',[0 0 0]);

line([anfis.input(1,1).mf(1,i).params(1,2),anfis.input(1,1).mf(1,i).params(

1,2)],[anfis.input(1,2).range(1,1),anfis.input(1,2).range(1,2)],'LineWidth'

,0.001,'Color',[0 0 0]); end end plot(zReal25,zImg25,'r.');

Page 115: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

100

plot(zReal50,zImg50,'y.'); plot(zReal75,zImg75,'c.'); plot(zReal100,zImg100,'.'); xlabel('Re(Z)[Ohms]') ylabel('-Im(Z)[Ohms]') hold off;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Fuzzy System output test %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Y25 = evalfis([cell1_25.ReZ_Ohm,cell1_25.neg_ImZ_Ohm],anfis); Y50 = evalfis([cell1_50.ReZ_Ohm,cell1_50.neg_ImZ_Ohm],anfis); Y75 = evalfis([cell1_75.ReZ_Ohm,cell1_75.neg_ImZ_Ohm],anfis); Y100 = evalfis([cell1_100.ReZ_Ohm,cell1_100.neg_ImZ_Ohm],anfis);

figure; hold on; plot(output,'o'); plot([Y25;Y50;Y75;Y100],'r*'); xlabel('Index') ylabel('Output') hold off;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Simulated Impedance Profiles between EIS of the battery with 50% and 75% % of SOC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% figure; hold on; meanReal3 = (zReal50+zReal75)/2; meanImg3 = (zImg50+zImg75)/2; meanReal2 = (zReal50+meanReal3)/2; meanImg2 = (zImg50 +meanImg3)/2; meanReal1 = (zReal50+meanReal2)/2; meanImg1 = (zImg50 +meanImg2)/2;

plot(zReal50,zImg50,'k.'); plot(zReal75,zImg75,'g.'); plot(meanReal3,meanImg3,'*'); plot(meanReal2,meanImg2,'y*'); plot(meanReal1,meanImg1,'r*'); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); hold off;

Y1 = evalfis([meanReal1,meanImg1],anfis); Y2 = evalfis([meanReal2,meanImg2],anfis); Y3 = evalfis([meanReal3,meanImg3],anfis);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Offline SOC estimation method and noise analysis

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Select one option

% (a) Standard Impedance Profile data

% (b) Average Impedance Profile data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Page 116: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

101

% (a)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% noiseReal = wgn(76,1,1)/300000; noiseImg = wgn(76,1,1)/300000; Y50 = evalfis([zReal50+noiseReal, zImg50+noiseImg],anfis); Y75 = evalfis([zReal75+noiseReal, zImg75+noiseImg],anfis);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% (b)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% noiseReal = wgn(38,1,1)/300000; noiseImg = wgn(38,1,1)/300000; Y50 = evalfis([zReal50+noiseReal, zImg50+noiseImg],anfis); Y75 = evalfis([zReal75+noiseReal, zImg75+noiseImg],anfis);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% figure; hold on; plot(zReal50,zImg50,'k.'); plot(zReal50+noiseReal,zImg50+noiseImg,'r.'); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); hold off;

figure; hold on; plot(zReal75,zImg75,'k.'); plot(zReal75+noiseReal,zImg75+noiseImg,'r.'); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); hold off;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Simulated Impedance Profiles between EIS of the battery with 50 and 75% % of SOC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% figure; hold on; meanReal3 = (zReal50+zReal75)/2; meanImg3 = (zImg50+zImg75)/2; meanReal2 = (zReal50+meanReal3)/2; meanImg2 = (zImg50 +meanImg3)/2; meanReal1 = (zReal50+meanReal2)/2; meanImg1 = (zImg50 +meanImg2)/2;

plot(zReal50,zImg50,'k.'); plot(zReal75,zImg75,'g.'); plot(meanReal3,meanImg3,'*'); plot(meanReal2,meanImg2,'y*'); plot(meanReal1,meanImg1,'r*'); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); plot(zReal100,zImg100,'.'); xlabel('Re(Z)[Ohms]') ylabel('Im(Z)[Ohms]') hold off;

Y1 = evalfis([meanReal1,meanImg1],anfis); Y2 = evalfis([meanReal2,meanImg2],anfis); Y3 = evalfis([meanReal3,meanImg3],anfis);

Page 117: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

102

Chapter 6

clear all close all clc

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Data selection for each simulation (for example first month, i = 1) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% zReal25 = cell(i)_25.ReZ_Ohm; zReal50 = cell(i)_50.ReZ_Ohm; zReal75 = cell(i)_75.ReZ_Ohm; zReal100 = cell(i)_100.ReZ_Ohm;

zImg25 = cell(i)_25.neg_ImZ_Ohm; zImg50 = cell(i)_50.neg_ImZ_Ohm; zImg75 = cell(i)_75.neg_ImZ_Ohm; zImg100 = cell(i)_100.neg_ImZ_Ohm;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Centroids calculation for each impedance profiles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nclusters=1; [IDX,centroid25,sumd,D] = kmeans([zReal25, zImg25],nclusters); [IDX,centroid50,sumd,D] = kmeans([zReal50, zImg50],nclusters); [IDX,centroid75,sumd,D] = kmeans([zReal75, zImg75],nclusters); [IDX,centroid100,sumd,D] = kmeans([zReal100, zImg100],nclusters);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Path Computation (6.1 - Algorithm, page 64, Figure 6.3 - Assumed path of % the evolution of the centers of gravity represented with a green line % (2nd month).) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% figure; hold on; points = [centroid25(1),centroid50(1),centroid75(1),centroid100(1); centroid25(2),centroid50(2),centroid75(2),centroid100(2)]; fnplt(cscvn(points),'g',2); %plots the function in F on its basic interval% plot(zReal25,zImg25,'r.'); plot(zReal50,zImg50,'y.'); plot(zReal75,zImg75,'c.'); plot(zReal100,zImg100,'.'); xlabel('Re(Z)[Ohms]') ylabel('-Im(Z)[Ohms]')

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Centroids linear interpolation with "Curve Fitting Tool" (fittedmodel) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ReZ = [centroid25(1);centroid50(1);centroid75(1);centroid100(1)]; ImZ = [centroid25(2);centroid50(2);centroid75(2);centroid100(2)]; SOC = [25;50;75;100];

[X,Y] = meshgrid(min(ReZ)*0.95:((max(ReZ)*1.1)-

(min(ReZ)*0.95))/100:max(ReZ)*1.1,min(ImZ)*0.95:((max(ImZ)*1.1)-

(min(ImZ)*0.95))/100:max(ImZ)*1.1); Z = feval(fittedmodel,X,Y);%Centroid linear interpolation (fittedmodel) %output

Page 118: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

103

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Intermediate impedances profile centroids (6.2 - Algorithm Test) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% meanReal = (zReal25 + zReal50)/2; meanImg = (zImg25 + zImg50)/2; [IDX,centroid,sumd,D] = kmeans([meanReal, meanImg],nclusters); SOC25_50 = feval(fittedmodel,[centroid(1),centroid(2)]); %Fittedmodel, previously simulated, output if input = intermediate %impedance profiles centroids

figure; hold on; plot(zReal25,zImg25,'r.'); plot(zReal50,zImg50,'y.'); plot(meanReal,meanImg,'k.'); plot(centroid25(1),centroid25(2),'ro','LineWidth',3,'MarkerSize',8); plot(centroid50(1),centroid50(2),'yo','LineWidth',3,'MarkerSize',8); plot(centroid(1),centroid(2),'ko','LineWidth',3,'MarkerSize',8); xlabel('Re(Z)[Ohms]') ylabel('-Im(Z)[Ohms]') hold off;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Algorithm that, given a centroid value outside the area covered by %interpolation, computes the closest point of the area covered by %interpolation to the respective centroid(6.1 - Algorithm, page 66).

Function [SOC,Index] = centroidFind(SOC,centroid,X,Y,Z)

Constant = 1000000000000; aux = abs(X-centroid(1))+abs(Y-centroid(2)); for i=1:(size(X)) for j=1:(size(Y)) if aux(i,j) < Constant & Z(i,j) > 0; Constant = aux(i,j); Index = [i,j]; end j = j + 1; end i = i + 1; end SOC = Z(Index(1),Index(2));

End

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if isnan(SOC25_50)

[SOC25_50,Index] = centroidFind(SOC25_50,centroid,X,Y,Z);

end

figure; hold on; surf(X,Y,Z); colormap(flipud(colormap)); plot3(centroid(1),centroid(2),SOC25_50, 'xc','MarkerSize',10); plot3(centroid(1),centroid(2),SOC25_50,

'oc','MarkerSize',10,'LineWidth',2); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); zlabel('SOC'); %Representation of the output of the interpolation model for the %intermediate centroid as input.

Page 119: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

104

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% meanReal = (zReal50 + zReal75)/2; meanImg = (zImg50 + zImg75)/2; [IDX,centroid,sumd,D] = kmeans([meanReal, meanImg],nclusters); SOC50_75 = feval(fittedmodel,[centroid(1),centroid(2)]); %Fittedmodel, previously simulated, output if input = intermediate %impedance profiles centroids

figure; hold on; plot(zReal50,zImg50,'y.'); plot(zReal75,zImg75,'c.'); plot(centroid50(1),centroid50(2),'yo','LineWidth',3,'MarkerSize',8); plot(centroid75(1),centroid75(2),'co','LineWidth',3,'MarkerSize',8); plot(centroid(1),centroid(2),'ko','LineWidth',3,'MarkerSize',8); xlabel('Re(Z)[Ohms]') ylabel('-Im(Z)[Ohms]') hold off;

if isnan(SOC50_75) [SOC50_75,Index] = centroidFind(SOC50_75,centroid,X,Y,Z);

end

figure; hold on; surf(X,Y,Z); colormap(flipud(colormap)); plot3(centroid(1),centroid(2),SOC50_75,'oc','MarkerSize',10,'LineWidth',2); plot3(centroid(1),centroid(2),SOC50_75,'xc','MarkerSize',10); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); zlabel('SOC'); %Representation of the output of the interpolation model for the %intermediate centroid as input.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% meanReal = (zReal75 + zReal100)/2; meanImg = (zImg75 + zImg100)/2; [IDX,centroid,sumd,D] = kmeans([meanReal, meanImg],nclusters); SOC75_100 = feval(fittedmodel,[centroid(1),centroid(2)]); %Fittedmodel, previously simulated, output if input = intermediate %impedance profiles centroids

figure; hold on; plot(zReal75,zImg75,'c.'); plot(zReal100,zImg100,'.'); plot(meanReal,meanImg,'k.'); plot(centroid75(1),centroid75(2),'co','LineWidth',3,'MarkerSize',8); plot(centroid100(1),centroid100(2),'bo','LineWidth',3,'MarkerSize',8); plot(centroid(1),centroid(2),'ko','LineWidth',3,'MarkerSize',8); xlabel('Re(Z)[Ohms]') ylabel('-Im(Z)[Ohms]') hold off;

if isnan(SOC75_100) [SOC75_100,Index] = centroidFind(SOC75_100,centroid,X,Y,Z);

end

Page 120: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

105

figure; hold on; surf(X,Y,Z); colormap(flipud(colormap)); plot3(centroid(1),centroid(2),SOC75_100,'oc','MarkerSize',10,'LineWidth',2)

; plot3(centroid(1),centroid(2),SOC75_100,'xc','MarkerSize',10); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); zlabel('SOC') %Representation of the output of the interpolation model for the %intermediate centroid as input.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Noise (6.2.1 - Noise Analysis, page 70) %Selection between adding noise (a) or adding an offset (b) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %(a) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% noiseReal = wgn(76,1,1); %white Gaussian Noise% noiseReal = noiseReal/abs(max(noiseReal)); noiseImg = wgn(76,1,1); %white Gaussian Noise% noiseImg = noiseImg/abs(max(noiseImg));

a = [0.1*cell2_25.ReZ_Ohm*noiseReal']; b = [0.1*cell2_50.ReZ_Ohm*noiseReal']; c = [0.1*cell2_75.ReZ_Ohm*noiseReal']; d = [0.1*cell2_100.ReZ_Ohm*noiseReal']; e = [0.1*cell2_25.neg_ImZ_Ohm*noiseImg']; f = [0.1*cell2_50.neg_ImZ_Ohm*noiseImg']; g = [0.1*cell2_75.neg_ImZ_Ohm*noiseImg']; h = [0.1*cell2_100.neg_ImZ_Ohm*noiseImg'];

zReal25e = cell2_25.ReZ_Ohm + diag(a); zReal50e = cell2_50.ReZ_Ohm + diag(b); zReal75e = cell2_75.ReZ_Ohm + diag(c); zReal100e = cell2_100.ReZ_Ohm + diag(d); zImg25e = cell2_25.neg_ImZ_Ohm + diag(e); zImg50e = cell2_50.neg_ImZ_Ohm + diag(f); zImg75e = cell2_75.neg_ImZ_Ohm + diag(g); zImg100e = cell2_100.neg_ImZ_Ohm + diag(h); %Inputs with added noise (+-10%)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %(b) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% a = [0.01*max(cell2_25.ReZ_Ohm)]; b = [0.01*max(cell2_50.ReZ_Ohm)]; c = [0.01*max(cell2_75.ReZ_Ohm)]; d = [0.01*max(cell2_100.ReZ_Ohm)]; e = [0.01*max(cell2_25.neg_ImZ_Ohm)]; f = [0.01*max(cell2_50.neg_ImZ_Ohm)]; g = [0.01*max(cell2_75.neg_ImZ_Ohm)]; h = [0.01*max(cell2_100.neg_ImZ_Ohm)]; zReal25e = cell2_25.ReZ_Ohm + a; zReal50e = cell2_50.ReZ_Ohm + b; zReal75e = cell2_75.ReZ_Ohm + c;

Page 121: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

106

zReal100e = cell2_100.ReZ_Ohm + d; zImg25e = cell2_25.neg_ImZ_Ohm + e; zImg50e = cell2_50.neg_ImZ_Ohm + f; zImg75e = cell2_75.neg_ImZ_Ohm + g; zImg100e = cell2_100.neg_ImZ_Ohm + h;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Impedances profiles with added noise/offset centroids fittedmodel output %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [IDX,centroid25e,sumd,D] = kmeans([zReal25e, zImg25e],nclusters); [IDX,centroid50e,sumd,D] = kmeans([zReal50e, zImg50e],nclusters); [IDX,centroid75e,sumd,D] = kmeans([zReal75e, zImg75e],nclusters); [IDX,centroid100e,sumd,D] = kmeans([zReal100e, zImg100e],nclusters);

figure; hold on; plot(zReal25,zImg25,'k.'); plot(zReal25e,zImg25e,'r.'); plot(centroid25(1),centroid25(2),'ko','LineWidth',3); plot(centroid25e(1),centroid25e(2),'ro','LineWidth',3); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); hold off;

figure; hold on; plot(zReal50,zImg50,'k.'); plot(zReal50e,zImg50e,'r.'); plot(centroid50(1),centroid50(2),'ko','LineWidth',3); plot(centroid50e(1),centroid50e(2),'ro','LineWidth',3); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); hold off;

figure; hold on; plot(zReal75,zImg75,'k.'); plot(zReal75e,zImg75e,'r.'); plot(centroid75(1),centroid75(2),'ko','LineWidth',3); plot(centroid75e(1),centroid75e(2),'ro','LineWidth',3); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); hold off;

figure; hold on; plot(zReal100,zImg100,'k.'); plot(zReal100e,zImg100e,'r.'); plot(centroid100(1),centroid100(2),'ko','LineWidth',3); plot(centroid100e(1),centroid100e(2),'ro','LineWidth',3); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); hold off;

SOC25e = feval(fittedmodel,[centroid25e(1),centroid25e(2)]);

if isnan(SOC25e) [SOC25e,Index] = centroidFind(SOC25e,centroid,X,Y,Z);

end

SOC50e = feval(fittedmodel,[centroid50e(1),centroid50e(2)]);

Page 122: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

107

if isnan(SOC50e) [SOC50e,Index] = centroidFind(SOC50e,centroid,X,Y,Z);

End

SOC75e = feval(fittedmodel,[centroid75e(1),centroid75e(2)]);

if isnan(SOC75e) [SOC75e,Index] = centroidFind(SOC75e,centroid,X,Y,Z);

end

SOC100e = feval(fittedmodel,[centroid100e(1),centroid100e(2)]);

if isnan(SOC100e) [SOC100e,Index] = centroidFind(SOC100e,centroid,X,Y,Z);

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Intermediate impedances profiles with added noise/offset centroids

% fittedmodel output computation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% meanReal = (zReal25 + zReal50)/2; meanImg = (zImg25 + zImg50)/2; %Intermediate impedance profiles calculation

%Selection between adding noise (a) or adding an offset (b) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %(a) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% a = [0.1*meanReal*noiseReal']; b = [0.1*meanImg*noiseImg']; meanReal = meanReal + diag(a); meanImg = meanImg + diag(b);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %(b) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% a = [0.01*max(meanReal)]; b = [0.01*max(meanImg)]; meanReal = meanReal + a; meanImg = meanImg + b;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [IDX,centroid,sumd,D] = kmeans([meanReal, meanImg],nclusters); SOC25_50e = feval(fittedmodel,[centroid(1),centroid(2)]);

[IDX,centroid25_50,sumd,D] = kmeans([(zReal25 + zReal50)/2, (zImg25 +

zImg50)/2],nclusters);

figure; hold on; plot((zReal25 + zReal50)/2,(zImg25 + zImg50)/2,'k.'); plot(meanReal,meanImg,'r.'); plot(centroid25_50(1),centroid25_50(2),'ko','LineWidth',3); plot(centroid(1),centroid(2),'ro','LineWidth',3); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); hold off;

if isnan(SOC25_50e) [SOC25_50e,Index] = centroidFind(SOC25_50e,centroid,X,Y,Z);

Page 123: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

108

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% meanReal = (zReal50 + zReal75)/2; meanImg = (zImg50 + zImg75)/2; %Intermediate impedance profiles calculation

%Selection between adding noise (a) or adding an offset (b) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %(a) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% a = [0.1*meanReal*noiseReal']; b = [0.1*meanImg*noiseImg']; meanReal = meanReal + diag(a); meanImg = meanImg + diag(b);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %(b) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% a = [0.01*max(meanReal)]; b = [0.01*max(meanImg)]; meanReal = meanReal + a; meanImg = meanImg + b;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [IDX,centroid,sumd,D] = kmeans([meanReal, meanImg],nclusters); SOC50_75e = feval(fittedmodel,[centroid(1),centroid(2)]);

[IDX,centroid50_75,sumd,D] = kmeans([(zReal50 + zReal75)/2, (zImg50 +

zImg75)/2],nclusters);

figure; hold on; plot((zReal50 + zReal75)/2,(zImg50 + zImg75)/2,'k.'); plot(meanReal,meanImg,'r.'); plot(centroid50_75(1),centroid50_75(2),'ko','LineWidth',3); plot(centroid(1),centroid(2),'ro','LineWidth',3); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); hold off;

if isnan(SOC50_75e) [SOC50_75e,Index] = centroidFind(SOC50_75e,centroid,X,Y,Z);

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% meanReal = (zReal75 + zReal100)/2; meanImg = (zImg75 + zImg100)/2; %Intermediate impedance profiles calculation

%Selection between adding noise (a) or adding an offset (b) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %(a) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% a = [0.1*meanReal*noiseReal'];

Page 124: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

109

b = [0.1*meanImg*noiseImg']; meanReal = meanReal + diag(a); meanImg = meanImg + diag(b);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %(b) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% a = [0.01*max(meanReal)]; b = [0.01*max(meanImg)]; meanReal = meanReal + a; meanImg = meanImg + b;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Intermediate impedances profiles with added noise centroids computation %and output %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [IDX,centroid,sumd,D] = kmeans([meanReal, meanImg],nclusters); SOC75_100e = feval(fittedmodel,[centroid(1),centroid(2)]);

[IDX,centroid75_100,sumd,D] = kmeans([(zReal75 + zReal100)/2, (zImg75 +

zImg100)/2],nclusters);

figure; hold on; plot((zReal75 + zReal100)/2,(zImg75 + zImg100)/2,'k.'); plot(meanReal,meanImg,'r.'); plot(centroid75_100(1),centroid75_100(2),'ko','LineWidth',3); plot(centroid(1),centroid(2),'ro','LineWidth',3); xlabel('Re(Z)[Ohms]'); ylabel('-Im(Z)[Ohms]'); hold off;

if isnan(SOC75_100e) [SOC75_100e,Index] = centroidFind(SOC75_100e,centroid,X,Y,Z);

end

Page 125: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

110

Chapter 7

clear all close all clc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Loading Impedance Profiles into variables (real and Imaginary part of the

% complex impedance)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% z1 = [cell1_25.ReZ_Ohm(1:38); cell1_50.ReZ_Ohm(1:38); cell1_100.ReZ_Ohm(1:38)]; z2 = [cell2_25.ReZ_Ohm(1:38); cell2_50.ReZ_Ohm(1:38); cell2_100.ReZ_Ohm(1:38)]; z3 = [cell3_25.ReZ_Ohm(1:38); cell3_50.ReZ_Ohm(1:38); cell3_100.ReZ_Ohm(1:38)]; z4 = [cell4_25.ReZ_Ohm(1:38); cell4_50.ReZ_Ohm(1:38); cell4_100.ReZ_Ohm(1:38)]; z5 = [cell5_25.ReZ_Ohm(1:38); cell5_50.ReZ_Ohm(1:38); cell5_100.ReZ_Ohm(1:38)]; z6 = [cell6_25.ReZ_Ohm(1:38); cell6_50.ReZ_Ohm(1:38); cell6_100.ReZ_Ohm(1:38)]; z7 = [cell7_25.ReZ_Ohm(1:38); cell7_50.ReZ_Ohm(1:38); cell7_100.ReZ_Ohm(1:38)]; z8 = [cell8_25.ReZ_Ohm(1:38); cell8_50.ReZ_Ohm(1:38); cell8_100.ReZ_Ohm(1:38)]; z9 = [cell9_25.ReZ_Ohm(1:38); cell9_50.ReZ_Ohm(1:38); cell9_100.ReZ_Ohm(1:38)]; z10 = [cell10_25.ReZ_Ohm(1:38); cell10_50.ReZ_Ohm(1:38); cell10_100.ReZ_Ohm(1:38)];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% z11 = [ cell1_25.neg_ImZ_Ohm(1:38); cell1_50.neg_ImZ_Ohm(1:38); cell1_100.neg_ImZ_Ohm(1:38)]; z12 = [ cell2_25.neg_ImZ_Ohm(1:38); cell2_50.neg_ImZ_Ohm(1:38); cell2_100.neg_ImZ_Ohm(1:38)]; z13 = [ cell3_25.neg_ImZ_Ohm(1:38); cell3_50.neg_ImZ_Ohm(1:38); cell3_100.neg_ImZ_Ohm(1:38)]; z14 = [ cell4_25.neg_ImZ_Ohm(1:38); cell4_50.neg_ImZ_Ohm(1:38); cell4_100.neg_ImZ_Ohm(1:38)]; z15 = [ cell5_25.neg_ImZ_Ohm(1:38); cell5_50.neg_ImZ_Ohm(1:38); cell5_100.neg_ImZ_Ohm(1:38)]; z16 = [ cell6_25.neg_ImZ_Ohm(1:38); cell6_50.neg_ImZ_Ohm(1:38); cell6_100.neg_ImZ_Ohm(1:38)]; z17 = [ cell7_25.neg_ImZ_Ohm(1:38); cell7_50.neg_ImZ_Ohm(1:38);

Page 126: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

111

cell7_100.neg_ImZ_Ohm(1:38)]; z18 = [ cell8_25.neg_ImZ_Ohm(1:38); cell8_50.neg_ImZ_Ohm(1:38); cell8_100.neg_ImZ_Ohm(1:38)]; z19 = [ cell9_25.neg_ImZ_Ohm(1:38); cell9_50.neg_ImZ_Ohm(1:38); cell9_100.neg_ImZ_Ohm(1:38)]; z20 = [ cell10_25.neg_ImZ_Ohm(1:38); cell10_50.neg_ImZ_Ohm(1:38); cell10_100.neg_ImZ_Ohm(1:38)];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Impedance Profiles rescale

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% maxReal = max( abs([z1;z2;z3;z4;z5;z6;z7;z8;z9;z10]) ); maxImg = max( abs([z11;z12;z13;z14;z15;z16;z17;z18;z19;z20]) ); z1 = z1/maxReal; z11 = z11/maxImg; z2 = z2/maxReal; z12 = z12/maxImg; z3 = z3/maxReal; z13 = z13/maxImg; z4 = z4/maxReal; z14 = z14/maxImg; z5 = z5/maxReal; z15 = z15/maxImg; z6 = z6/maxReal; z16 = z16/maxImg; z7 = z7/maxReal; z17 = z17/maxImg; z8 = z8/maxReal; z18 = z18/maxImg; z9 = z9/maxReal; z19 = z19/maxImg; z10 = z10/maxReal; z20 = z20/maxImg;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Mean between Impedance Profiles Chapter 7.2

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% impedance12_mean = (z2 + z1)/2; impedance1112_mean = (z12 + z11)/2; impedance23_mean = (z3 + z2)/2; impedance1213_mean = (z13 + z12)/2; impedance34_mean = (z4 + z3)/2; impedance1314_mean = (z14 + z13)/2; impedance45_mean = (z5 + z4)/2; impedance1415_mean = (z15 + z14)/2; impedance56_mean = (z6 + z5)/2; impedance1516_mean = (z16 + z15)/2; impedance67_mean = (z7 + z6)/2; impedance1617_mean = (z17 + z16)/2; impedance78_mean = (z8 + z7)/2; impedance1718_mean = (z18 + z17)/2; impedance89_mean = (z9 + z8)/2; impedance1819_mean = (z19 + z18)/2; impedance910_mean = (z10 + z9)/2; impedance1920_mean = (z20 + z19)/2;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Loading the new Impedance profile data into variables (real and Imaginary

% part of the % complex impedance)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% zReal1 = z1; zImg1 = z11; zReal2 = impedance12_mean; zImg2 = impedance1112_mean; zReal3 = z2; zImg3 = z12; zReal4 = impedance23_mean; zImg4 = impedance1213_mean; zReal5 = z3; zImg5 = z13; zReal6 = impedance34_mean; zImg6 = impedance1314_mean; zReal7 = z4; zImg7 = z14; zReal8 = impedance45_mean; zImg8 = impedance1415_mean; zReal9 = z5; zImg9 = z15; zReal10 = impedance56_mean; zImg10 = impedance1516_mean; zReal11 = z6; zImg11 = z16; zReal12 = impedance67_mean; zImg12 = impedance1617_mean; zReal13 = z7; zImg13 = z17; zReal14 = impedance78_mean; zImg14 = impedance1718_mean; zReal15 = z8; zImg15 = z18; zReal16 = impedance89_mean; zImg16 = impedance1819_mean; zReal17 = z9; zImg17 = z19;

Page 127: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

112

zReal18 = impedance910_mean; zImg18 = impedance1920_mean; zReal19 = z10; zImg19 = z20;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Computation of the difference between impedance profiles of different

% month

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% delta12 = zReal2 - zReal1; delta2122 = zImg2 - zImg1; delta23 = zReal3 - zReal2; delta2223 = zImg3 - zImg2; delta34 = zReal4 - zReal3; delta2324 = zImg4 - zImg3; delta45 = zReal5 - zReal4; delta2425 = zImg5 - zImg4; delta56 = zReal6 - zReal5; delta2526 = zImg6 - zImg5; delta67 = zReal7 - zReal6; delta2627 = zImg7 - zImg6; delta78 = zReal8 - zReal7; delta2728 = zImg8 - zImg7; delta89 = zReal9 - zReal8; delta2829 = zImg9 - zImg8; delta910 = zReal10 - zReal9; delta2930 = zImg10 - zImg9; delta1011 = zReal11 - zReal10; delta3031 = zImg11 - zImg10; delta1112 = zReal12 - zReal11; delta3132 = zImg12 - zImg11; delta1213 = zReal13 - zReal12; delta3233 = zImg13 - zImg12; delta1314 = zReal14 - zReal13; delta3334 = zImg14 - zImg13; delta1415 = zReal15 - zReal14; delta3435 = zImg15 - zImg14; delta1516 = zReal16 - zReal15; delta3536 = zImg16 - zImg15; delta1617 = zReal17 - zReal16; delta3637 = zImg17 - zImg16; delta1718 = zReal18 - zReal17; delta3738 = zImg18 - zImg17; delta1819 = zReal19 - zReal18; delta3839 = zImg19 - zImg18;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Fuzzy input variables

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

f = [cell1_25.freqHz(1:38);cell1_50.freqHz(1:38);cell1_100.freqHz(1:38)]; input1 = [delta12,delta2122,f]; input2 = [delta23,delta2223,f]; input3 = [delta34,delta2324,f]; input4 = [delta45,delta2425,f]; input5 = [delta56,delta2526,f]; input6 = [delta67,delta2627,f]; input7 = [delta78,delta2728,f]; input8 = [delta89,delta2829,f]; input9 = [delta910,delta2930,f]; input10 = [delta1011,delta3031,f]; input11 = [delta1112,delta3132,f]; input12 = [delta1213,delta3233,f]; input13 = [delta1314,delta3334,f]; input14 = [delta1415,delta3435,f]; input15 = [delta1516,delta3536,f]; input16 = [delta1617,delta3637,f]; input17 = [delta1718,delta3738,f]; input18 = [delta1819,delta3839,f]; %Input to predict the impendace profile of month 19 input =

[input1;input2;input3;input4;input5;input6;input7;input8;input9;input10;inp

ut11;input12;input13;input14;input15;input16]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5;zReal5-zReal6;zReal6-

zReal7;zReal7-zReal8;zReal8-zReal9;zReal9-zReal10;zReal10-zReal11;zReal11-

zReal12;zReal12-zReal13;zReal13-zReal14;zReal14-zReal15;zReal15-

zReal16;zReal16-zReal17;zReal17-zReal18]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5;zImg5-zImg6;zImg6-

zImg7;zImg7-zImg8;zImg8-zImg9;zImg9-zImg10;zImg10-zImg11;zImg11-

zImg12;zImg12-zImg13;zImg13-zImg14;zImg14-zImg15;zImg15-zImg16;zImg16-

zImg17;zImg17-zImg18];

Page 128: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

113

%Input to predict the impendace profile of month 18 input =

[input1;input2;input3;input4;input5;input6;input7;input8;input9;input10;inp

ut11;input12;input13;input14;input15]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5;zReal5-zReal6;zReal6-

zReal7;zReal7-zReal8;zReal8-zReal9;zReal9-zReal10;zReal10-zReal11;zReal11-

zReal12;zReal12-zReal13;zReal13-zReal14;zReal14-zReal15;zReal15-

zReal16;zReal16-zReal17]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5;zImg5-zImg6;zImg6-

zImg7;zImg7-zImg8;zImg8-zImg9;zImg9-zImg10;zImg10-zImg11;zImg11-

zImg12;zImg12-zImg13;zImg13-zImg14;zImg14-zImg15;zImg15-zImg16;zImg16-

zImg17]; %Input to predict the impendace profile of month 17 input =

[input1;input2;input3;input4;input5;input6;input7;input8;input9;input10;inp

ut11;input12;input13;input14]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5;zReal5-zReal6;zReal6-

zReal7;zReal7-zReal8;zReal8-zReal9;zReal9-zReal10;zReal10-zReal11;zReal11-

zReal12;zReal12-zReal13;zReal13-zReal14;zReal14-zReal15;zReal15-zReal16]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5;zImg5-zImg6;zImg6-

zImg7;zImg7-zImg8;zImg8-zImg9;zImg9-zImg10;zImg10-zImg11;zImg11-

zImg12;zImg12-zImg13;zImg13-zImg14;zImg14-zImg15;zImg15-zImg16]; %Input to predict the impendace profile of month 16 input =

[input1;input2;input3;input4;input5;input6;input7;input8;input9;input10;inp

ut11;input12;input13]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5;zReal5-zReal6;zReal6-

zReal7;zReal7-zReal8;zReal8-zReal9;zReal9-zReal10;zReal10-zReal11;zReal11-

zReal12;zReal12-zReal13;zReal13-zReal14;zReal14-zReal15]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5;zImg5-zImg6;zImg6-

zImg7;zImg7-zImg8;zImg8-zImg9;zImg9-zImg10;zImg10-zImg11;zImg11-

zImg12;zImg12-zImg13;zImg13-zImg14;zImg14-zImg15]; %Input to predict the impendace profile of month 15 input =

[input1;input2;input3;input4;input5;input6;input7;input8;input9;input10;inp

ut11;input12]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5;zReal5-zReal6;zReal6-

zReal7;zReal7-zReal8;zReal8-zReal9;zReal9-zReal10;zReal10-zReal11;zReal11-

zReal12;zReal12-zReal13;zReal13-zReal14]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5;zImg5-zImg6;zImg6-

zImg7;zImg7-zImg8;zImg8-zImg9;zImg9-zImg10;zImg10-zImg11;zImg11-

zImg12;zImg12-zImg13;zImg13-zImg14]; %Input to predict the impendace profile of month 14 input =

[input1;input2;input3;input4;input5;input6;input7;input8;input9;input10;inp

ut11]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5;zReal5-zReal6;zReal6-

zReal7;zReal7-zReal8;zReal8-zReal9;zReal9-zReal10;zReal10-zReal11;zReal11-

zReal12;zReal12-zReal13]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5;zImg5-zImg6;zImg6-

zImg7;zImg7-zImg8;zImg8-zImg9;zImg9-zImg10;zImg10-zImg11;zImg11-

zImg12;zImg12-zImg13]; %Input to predict the impendace profile of month 13 input =

[input1;input2;input3;input4;input5;input6;input7;input8;input9;input10]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5;zReal5-zReal6;zReal6-

zReal7;zReal7-zReal8;zReal8-zReal9;zReal9-zReal10;zReal10-zReal11;zReal11-

zReal12]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5;zImg5-zImg6;zImg6-

zImg7;zImg7-zImg8;zImg8-zImg9;zImg9-zImg10;zImg10-zImg11;zImg11-zImg12]; %Input to predict the impendace profile of month 12

Page 129: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

114

input = [input1;input2;input3;input4;input5;input6;input7;input8;input9]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5;zReal5-zReal6;zReal6-

zReal7;zReal7-zReal8;zReal8-zReal9;zReal9-zReal10;zReal10-zReal11]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5;zImg5-zImg6;zImg6-

zImg7;zImg7-zImg8;zImg8-zImg9;zImg9-zImg10;zImg10-zImg11]; %Input to predict the impendace profile of month 11 input = [input1;input2;input3;input4;input5;input6;input7;input8]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5;zReal5-zReal6;zReal6-

zReal7;zReal7-zReal8;zReal8-zReal9;zReal9-zReal10]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5;zImg5-zImg6;zImg6-

zImg7;zImg7-zImg8;zImg8-zImg9;zImg9-zImg10]; %Input to predict the impendace profile of month 10 input = [input1;input2;input3;input4;input5;input6;input7]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5;zReal5-zReal6;zReal6-

zReal7;zReal7-zReal8;zReal8-zReal9]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5;zImg5-zImg6;zImg6-

zImg7;zImg7-zImg8;zImg8-zImg9]; %Input to predict the impendace profile of month 9 input = [input1;input2;input3;input4;input5;input6]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5;zReal5-zReal6;zReal6-

zReal7;zReal7-zReal8]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5;zImg5-zImg6;zImg6-

zImg7;zImg7-zImg8]; %Input to predict the impendace profile of month 8 input = [input1;input2;input3;input4;input5]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5;zReal5-zReal6;zReal6-

zReal7]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5;zImg5-zImg6;zImg6-zImg7]; %Input to predict the impendace profile of month 7 input = [input1;input2;input3;input4]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5;zReal5-zReal6]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5;zImg5-zImg6]; %Input to predict the impendace profile of month 6 input = [input1;input2;input3]; output1 = [zReal2-zReal3;zReal3-zReal4;zReal4-zReal5]; output2 = [zImg2-zImg3;zImg3-zImg4;zImg4-zImg5]; %Input to predict the impendace profile of month 5 input = [input1;input2]; output1 = [zReal2-zReal3;zReal3-zReal4]; output2 = [zImg2-zImg3;zImg3-zImg4]; %Input to predict the impendace profile of month 4 input = [input1]; output1 = [zReal2-zReal3]; output2 = [zImg2-zImg3];

data1 = [input,output1]; data2 = [input,output2];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Generate Fuzzy Inference System structure from data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% in_fis1 = genfis2(input,output1,0.2); anfisedit(in_fis1);

in_fis2 = genfis2(input,output2,0.2); anfisedit(in_fis2);

Page 130: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

115

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Prediction of the impedance profiles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Predict impendace profile of month 4 delta = evalfis([delta23,delta2223,f],anfis31); Y = zReal3 - delta(:,1); delta(:,2) = evalfis([delta23,delta2223,f],anfis32); X = zImg3 - delta(:,2); %Predict impendace profile of month 5 delta = evalfis([delta34,delta2324,f],anfis29); Y = zReal4 - delta(:,1); delta(:,2) = evalfis([delta34,delta2324,f],anfis30); X = zImg4 - delta(:,2); %Predict impendace profile of month 6 delta = evalfis([delta45,delta2425,f],anfis27); Y = zReal5 - delta(:,1); delta(:,2) = evalfis([delta45,delta2425,f],anfis28); X = zImg5 - delta(:,2); %Predict impendace profile of month 7 delta = evalfis([delta56,delta2526,f],anfis25); Y = zReal6 - delta(:,1); delta(:,2) = evalfis([delta56,delta2526,f],anfis26); X = zImg6 - delta(:,2); %Predict impendace profile of month 8 delta = evalfis([delta67,delta2627,f],anfis23); Y = zReal7 - delta(:,1); delta(:,2) = evalfis([delta67,delta2627,f],anfis24); X = zImg7 - delta(:,2); %Predict impendace profile of month 9 delta = evalfis([delta78,delta2728,f],anfis21); Y = zReal8 - delta(:,1); delta(:,2) = evalfis([delta78,delta2728,f],anfis22); X = zImg8 - delta(:,2); %Predict impendace profile of month 10 delta = evalfis([delta89,delta2829,f],anfis19); Y = zReal9 - delta(:,1); delta(:,2) = evalfis([delta89,delta2829,f],anfis20); X = zImg9 - delta(:,2); %Predict impendace profile of month 11 delta = evalfis([delta910,delta2930,f],anfis17); Y = zReal10 - delta(:,1); delta(:,2) = evalfis([delta910,delta2930,f],anfis18); X = zImg10 - delta(:,2); %Predict impendace profile of month 12 delta = evalfis([delta1011,delta3031,f],anfis15); Y = zReal11 - delta(:,1); delta(:,2) = evalfis([delta1011,delta3031,f],anfis16); X = zImg11 - delta(:,2); %Predict impendace profile of month 13

delta = evalfis([delta1112,delta3132,f],anfis13); Y = zReal12 - delta(:,1); delta(:,2) = evalfis([delta1112,delta3132,f],anfis14); X = zImg12 - delta(:,2); %Predict impendace profile of month 14 delta = evalfis([delta1213,delta3233,f],anfis11); Y = zReal13 - delta(:,1); delta(:,2) = evalfis([delta1213,delta3233,f],anfis12); X = zImg13 - delta(:,2);

%Predict impendace profile of month 15 delta = evalfis([delta1314,delta3334,f],anfis9); Y = zReal14 - delta(:,1);

Page 131: State-of-Charge (SOC) Prediction of Lithium Iron Phosphate ... · State-of-Charge (SOC) Prediction of Lithium Iron Phosphate (LiFePO4) Batteries for Automotive Application Based on

116

delta(:,2) = evalfis([delta1314,delta3334,f],anfis10); X = zImg14 - delta(:,2); %Predict impendace profile of month 16 delta = evalfis([delta1415,delta3435,f],anfis7); Y = zReal15 - delta(:,1); delta(:,2) = evalfis([delta1415,delta3435,f],anfis8); X = zImg15 - delta(:,2); %Predict impendace profile of month 17 delta = evalfis([delta1516,delta3536,f],anfis5); Y = zReal16 - delta(:,1); delta(:,2) = evalfis([delta1516,delta3536,f],anfis6); X = zImg16 - delta(:,2); %Predict impendace profile of month 18 delta = evalfis([delta1617,delta3637,f],anfis3); Y = zReal17 - delta(:,1); delta(:,2) = evalfis([delta1617,delta3637,f],anfis4); X = zImg17 - delta(:,2); %Predict impendace profile of month 19 delta = evalfis([delta1718,delta3738,f],anfis1); Y = zReal18 - delta(:,1); delta(:,2) = evalfis([delta1718,delta3738,f],anfis2); X = zImg18 - delta(:,2);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Impedance profiles prediction error computation (month j) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

for i = 1:38; erroReal25(i,1) = Y(i,1) – zReal(j)(i,1); erroReal50(i,1) = Y(i+38,1) - zReal(j)(i+38,1); erroReal100(i,1) = Y(i+76,1) - zReal(j)(i+76,1); end for i = 1:38; erroImg25(i,1) = X(i,1) - zImg(j)(i,1); erroImg50(i,1) = X(i+38,1) - zImg(j)(i+38,1); erroImg100(i,1) = X(i+76,1) - zImg(j)(i+76,1); end meanRealError25 = mean(erroReal25); meanRealError50 = mean(erroReal50); meanRealError100 = mean(erroReal100);

meanImgError25 = mean(erroImg25); meanImgError50 = mean(erroImg50); meanImgError100 = mean(erroImg100);