The Development of a 48V, 10kWh LiFePO4 Battery Management System for Low Voltage Battery Storage Applications.

by

Bartholomeus van Wyk Horn

Thesis presented in partial fulfilment of the requirements for the degree of Master of Engineering (Electrical) in the Faculty of Engineering at Stellenbosch University

Department of Electrical and Electronical Engineering, University of Stellenbosch, Private Bag X1, Matieland 7602, South Africa.

Supervisor: Dr. P.J. Randewijk Dr. J.M. Strauss

March 2017 Stellenbosch University https://scholar.sun.ac.za

Declaration

By submitting this thesis electronically, I declare that the entirety of the work contained therein is my own, original work, that I am the sole author thereof (save to the extent explicitly otherwise stated), that reproduction and publication thereof by Stellenbosch University will not infringe any third party rights and that I have not previously in its entirety or in part submitted it for obtaining any qualification.

Date: March 2017

Copyright c 2017 Stellenbosch University

All rights reserved.

i Stellenbosch University https://scholar.sun.ac.za

Abstract

The Development of a 48V, 10kWh LiFePO4 Battery Management System for Low Voltage Battery Storage Applications. B.V. Horn Department of Electrical and Electronical Engineering, University of Stellenbosch, Private Bag X1, Matieland 7602, South Africa. Thesis: MEng (Elec) December 2016

Renewable energy sources are a promising replacement for fossil fuels in future energy generation. To fully replace fossil fuels some form of energy storage is required. Chemical batteries offer an energy storage solution that is flexible and scalable for applications ranging from electric vehicles to residential and even commercial applications. -ion (Li-ion) battery technologies offers the most promising performance in terms of energy density, power density as well as cycle life. Unfortunately, Li-ion batteries are very sensitive to usage outside of the specified operating range. These specified parameters include the battery operating temperature, over- and undervoltage thresholds as well as the maximum charge and discharge current. A Battery Management System (BMS) is thus required to monitor all of the above mentioned parameters and to ensure the battery is operated safely and within the specified range. A BMS’s primary focus is on the safety and protection of the battery, to minimise the risk of sudden failure and to maximise the life of the battery. The secondary function of the BMS is to perform battery diagnostics which could be used for more effective energy management of the battery. The objective of this project was to develop a BMS to be used within a Li-ion battery pack for a micro electric vehicle. The developed BMS was used for battery testing. The battery results were used to estimate the battery parameters off-line according to a specific battery model. The estimated battery parameters can be used as a basis for future energy management purposes. An on-line parameter estimation algorithm was also developed. The algorithm was proven to be successful with a simulation. Future work is required in order to simplify the practical implementation of the algorithm. Another objective of this project was to development a solid state contactor (SSC) that can be used to disconnect the battery from a load. Mechanical contactors, which presents some disadvantages, are typically used for high current applications. The proof

ii Stellenbosch University https://scholar.sun.ac.za

ABSTRACT iii of concept SSC was proven to be an efficient though costly substitute to replace the mechanical contactor within the BMS design. Stellenbosch University https://scholar.sun.ac.za

Uittreksel

Die Ontwikkeling van ’n 48V, 10kWh LiFePO4 Battery Bestuur Stelsel vir Lae Spanning Battery Stoor Toepassings.

B.V. Horn Departement Elektries en Elektroniese Ingenieurswese, Universiteit van Stellenbosch, Privaatsak X1, Matieland 7602, Suid Afrika. Tesis: MIng (Elek) Desember 2016

Hernubare energie bronne is belowende opsies om fossiel brandstof bronne mee te vervang. Om fossiel brandstowwe volledig te vervang is daar een of ander vorm van energie storing nodig. Chemiese batterye bied so ’n oplossing wat buigsaam en maklik skaleerbaar is vir toepassings wat strek van elektriese voertuie tot residensiële en selfs kommersiële verbruik. Lithium-ioon battery tegnologië bied belowende verrigting in terme van energie digt- heid, drywings digtheid en lewens siklusse. Ongelukking is hierdie tegnologië baie sensitief om buite die vervaardiger se spesifikasies bedryf te word. Hierdie spesifikasies sluit in die battery temperatuur, oor- en onderspannings drumpel asook die maksimum battery laai en ontlaai stroom. ’n Battery monitor stelsel (BMS) word gebruik, vir hierdie rede, om al hierdie spesifikasies te meet en te verseker dit is binne die veilige venster van gebruik. ’n BMS se primêre doel is die beveiliging en die beskerming van die battery om die lewe van die battery te maksimeer. Die sekondêre doel van die BMS is om battery diagnose te doen vir meer effektiewe energie bestuur. Die doel van hierdie projek is om ’n BMS te ontwikkel vir ’n mikro elektriese voertuig. The ontwikkelde stelsel was gebruik om battery toetse te doen. Die resultate was gebruik om die battery parameters van ’n battery model af te skat. Hierdie afgeskatte parameters kan in die toekoms gebruik word vir energie bestuur doelwitte. ’n Aanlyn parameters afskatting algoritme word ook in hierdie projek ontwikkel. Die algoritme word slegs bewys deur behulp van simulasies. Verdere werk sal gedoen moet word om die algoritme aan te pas om in ’n praktiese stelsel geïmplementeer te kan word. Die projek ondersoek ook die onwikkeling van ’n “solid state contactor” wat gebruik kan word om die battery van die las te ontkoppel. Meganiese kontaktors, wat nadele het, word tipies gebruik vir hoë stroom toepassings. Die “solid state contactor” poog om ’n opsie te wees wat die meganiese kontaktor in die hoof BMS ontwerp kan verwag.

iv Stellenbosch University https://scholar.sun.ac.za

Acknowledgements

The author gratefully acknowledges the contributions of the following individuals and institutions: My Mother and Father who have supported the author both financially and men- • tally.

My two supervisors, Dr Randewijk and Dr Strauss, for all the time spent helping • to solve problems.

The NRF who invested in the project. • Mr Arendse for helping with some of the soldering work. • All the post graduate students sitting in the power electronics laboratory including • Adel Coetzer.

The Mellowcabs team for all the support during the project. •

v Stellenbosch University https://scholar.sun.ac.za

Contents

List of Figures viii

List of Tables x

Nomenclature xi

1 Project Overview 1 1.1 Introduction ...... 1 1.2 Project Motivation ...... 2 1.3 Research Objectives ...... 3 1.4 Thesis Structure ...... 3

2 Literature Study 5 2.1 Introduction ...... 5 2.2 Batteries: A Short Overview ...... 5 2.3 Battery Management Systems ...... 10 2.4 Battery Modelling ...... 13 2.5 Off-line Parameter Identification of an ECM ...... 17 2.6 State Estimation ...... 21 2.7 Recursive Least Squares method ...... 23 2.8 Conclusion ...... 24

3 Hardware design 25 3.1 Introduction ...... 25 3.2 Proof of Concept Battery Management System ...... 25 3.3 Full Scale Battery Management System ...... 30 3.4 Prototype Solid State Contactor ...... 40 3.5 Conclusion ...... 46

4 Software Design 47 4.1 Introduction ...... 47 4.2 Overview ...... 47 4.3 Main loop ...... 48 4.4 Battery Balancing ...... 49 4.5 Current sense loop ...... 51 4.6 Master control loop ...... 51 4.7 Conclusion ...... 53

vi Stellenbosch University https://scholar.sun.ac.za

CONTENTS vii

5 On-line Parameter Estimation 54 5.1 Introduction ...... 54 5.2 Battery model ...... 54 5.3 Recursive Least Squares Algorithm ...... 57 5.4 Simulation and results ...... 59 5.5 Conclusion ...... 64

6 Results 66 6.1 Introduction ...... 66 6.2 Battery Management System ...... 66 6.3 Battery Off-line Parameter Estimation ...... 73 6.4 Solid State Contactor ...... 79 6.5 Conclusion ...... 84

7 Conclusion 85 7.1 Introduction ...... 85 7.2 Conclusion ...... 85 7.3 Future work ...... 86

Bibliography 88

Appendices 92

A Calculations 93 A.1 LM5017 regulator design ...... 93

B Code 96 B.1 Python USB listener ...... 96 B.2 MATLAB Symbolic solver ...... 97 B.3 Noise filter ...... 98 B.4 Battery balancing ...... 100

C PCB Schematics 102 C.1 Full Scale BMS Schematic ...... 102 Stellenbosch University https://scholar.sun.ac.za

List of Figures

2.1 Ragone diagram ...... 7 2.2 Diagram illustrating the discharge of a LFP cell ...... 8 2.3 Requirement fulfilment of various cathode materials ...... 9 2.4 Possible battery pack cell configurations ...... 10 2.5 Typical passive cell balancing topology ...... 13 2.6 Internal resistance equivalent circuit model ...... 15 2.7 Single polarisation Thévenin equivalent circuit model ...... 15 2.8 PNGV equivalent circuit model ...... 15 2.9 Dual polarisation Thévenin equivalent circuit model ...... 16 2.10 RC equivalent circuit model ...... 16 2.11 Typical discharge OC voltage test ...... 18 2.12 Typical open circuit hysteresis ...... 19 2.13 Battery voltage measured during off-line test ...... 20 2.14 Block diagram of the ECM SOC Estimation Methods ...... 23

3.1 Proof of concept BMS circuit diagram ...... 26 3.2 Proof of concept BMS with the SEM battery ...... 27 3.3 Voltage ripple ...... 30 3.4 Full scale BMS circuit diagram ...... 31 3.5 Full scale battery pack ...... 32 3.6 Digital model of the battery pack ...... 33 3.7 Main control BMS PCB ...... 34 3.8 TPS54060 voltage ripple ...... 35 3.9 Balance circuit diagram ...... 36 3.10 Balancing PCB connected to cell terminals ...... 37 3.11 Current sensor circuit diagram ...... 39 3.12 Current sensor ...... 40 3.13 Solid state contactor circuit diagram ...... 43 3.14 Dead time design ...... 44 3.15 Manufactured solid state contactor ...... 45

4.1 Main flow diagram ...... 48 4.2 Cell balancing flow diagram ...... 50 4.3 Current sensing flow diagram ...... 51 4.4 Master flow diagram ...... 52

5.1 Single polarisation (SP) Thévenin model ...... 55

viii Stellenbosch University https://scholar.sun.ac.za

LIST OF FIGURES ix

5.2 Dual polarisation (DP) Thévenin model ...... 56 5.3 Simulink simulation ...... 60 5.4 Battery discharge profile ...... 61 5.5 Estimated Voltage ...... 62 5.6 Voltage estimation error ...... 62 5.7 Estimates of the RLS algorithm compared to the actual parameters . . . . . 63 5.8 τt2 quantization error result ...... 64 6.1 ADC error ...... 67 6.2 Voltage measurement noise comparison ...... 68 6.3 Current sensor noise ...... 69 6.4 Filtered current sensor noise ...... 69 6.5 Current sensor thermal performance ...... 70 6.6 Weak terminal connections ...... 71 6.7 Cell balancing ...... 72 6.8 Impact of protection fuse during cell balancing ...... 72 6.9 Dual polarization Thévenin equivalent circuit model ...... 73 6.10 Pulse discharge test ...... 74 6.11 SOC vs OC voltage ...... 75 6.12 Ohmic resistance characteristic curve of the battery ...... 75 6.13 Curve fit of dynamic behaviour ...... 76 6.14 Dynamic resistance characteristic curve of the battery ...... 76 6.15 Total battery resistance characteristic curve ...... 77 6.16 Time constant τt1 characteristic curve ...... 78 6.17 Time constant τt2 characteristic curve ...... 78 6.18 SSC test set-up ...... 79 6.19 SSC current at maximum load ...... 80 6.20 Current sense and reference pin at maximum load ...... 80 6.21 SSC temperature at maximum load ...... 81 6.22 SSC trip ...... 82 6.23 Current sense and reference pin ...... 83 6.24 Dead time ...... 83 6.25 SSC during turn-off ...... 84

B.1 Noise of prototype BMS compared to that of the up-scaled BMS ...... 99 B.2 Battery balancing ...... 100 B.3 Battery balancing ...... 100 B.4 Battery balancing ...... 101

C.1 Balance schematic ...... 106 C.2 Current sense schematic ...... 107 Stellenbosch University https://scholar.sun.ac.za

List of Tables

3.1 LP55100100 cell specifications ...... 26 3.2 LY-100AH cell specifications ...... 32 3.3 CSD19535KTT Power MOSFET specifications ...... 42

5.1 Simulink model parameters ...... 60

x Stellenbosch University https://scholar.sun.ac.za

Nomenclature

List of symbols V Volt A Ampere Ah Ampere hour Q Capacity R Resistance C Capacitance L Inductance W Watt ω Frequency

Abbreviations & Acronyms ADC Analogue to Digital Converter BMS Battery Management System CAN Controller Area Network CC Constant Current CPU Central Processing Unit CRC Cyclic Redundancy Check CV Constant Voltage DC Direct Current DP Dual polarisation ECM Equivalent Circuit Model EIS Electrochemical Impedance Spectroscopy EMI Electromagnetic Interference ESD Electro Static Discharge EV Electric Vehicle FET Field-Effect Transistor FF Forgetting Factor FTDI Future Technology Devices International HPPC Hybrid Pulse Power Characterisation IGBT Insulated-Gate Bipolar Transistor

xi Stellenbosch University https://scholar.sun.ac.za

NOMENCLATURE xii

I2C Inter-Integrated Circuit IIR Infinite Impulse Response LCO Lithium Cobalt Oxide LFP Lithium Iron Phosphate Li Lithium LMO Lithium Manganese Oxide LNMC Lithium Nickel Manganese Cobalt Oxide LNCA Lithium Nickel Cobalt Aluminium Oxide LS Least Squares LTO Lithium Titanate MCU Micro Controlling Unit MOSFET Metal-Oxide-Semiconductor Field-Effect Transistor NiMH Nickel-Metal Hydride NTC Negative Temperature Coefficient OC Open Circuit OV Over Voltage PNGV Partnership for a New Generation of Vehicles RLS Recursive Least Squares SC Short Circuit SEM Shell-Eco Marathon SOC State Of Charge SOH State Of Health SOP State Of Power SP Single Polarisation SPI Serial Peripheral Interface SSC Solid State Contactor TI Texas Instruments TVS Transient Voltage Suppressor UDDS Urban Dynamometer Driving Schedule USB Universal Serial Bus UV Under Voltage Stellenbosch University https://scholar.sun.ac.za

Chapter 1

Project Overview

1.1 Introduction

Fossil fuels are currently used to generate electricity and to provide fuel for transportation. It has the advantage that the energy is stored in chemical bonds which can be utilised whenever necessary and has a very high energy density compared to other storage options. Renewable energy sources are a promising replacement for fossil fuels, since no green- house gasses are released during the energy generation process. The cost of renewable technologies has decreased significantly [1] and the need for fossil fuel replacements are increasing as the effects of global warming are becoming more and more apparent. Un- fortunately, these sources come with other difficulties. One such difficulty is that renewable energy sources require the energy generated to be utilised immediately after generation. A significant drawback with most renewable technologies is that they cannot continuously supply a baseload. Without large energy storage devices connected to renewable energy sources, the energy generated is either unpredictable (wind power) or it is periodical (solar power). Thus, some sort of storage device is required to supply power while power fluctuations in the renewable sources are present. Energy storage options that are currently available for commercial implementation include hydro systems, thermal energy storage and chemical batteries. Unfortunately, hydro systems are depended upon the location of the system. Thermal energy storage is typically used at concentrated solar power plants where energy is stored thermally in a storage medium. The thermal energy is converted at a later stage to electrical energy by means of a turbine. Unfortunately, this technique is not ideal for renewable energy sources that directly generates electrical power, due to the inefficient process of converting thermal energy into electrical energy. It is clear that none of the above mentioned technologies can be practically implemented for small scale energy storage such as required by electric vehicles or residences. Chemical batteries offer an energy storage solution that is flexible and scalable for applications ranging from electric vehicles to residential and even commercial energy storage. Currently battery storage options are still expensive, but the price is gradually de- creasing. This decrease can be attributed to more effective manufacturing processes as well as economies of scale. The battery price is moving towards the point where it is becoming a viable solution for either electric vehicles (EV) or peak power shaving. The

1 Stellenbosch University https://scholar.sun.ac.za

CHAPTER 1. PROJECT OVERVIEW 2 latest research on battery technologies are promising. The current commercially available battery technologies, in terms of performance, are good enough to replace fossil fuels as an energy storage solution. Lithium-ion (Li-ion) battery technologies offers the most promising results in terms of energy density, power density as well as cycle life. Li-ion battery technologies include a wide range of different battery chemistries, all with the similarity that Li-ions are used to carry the positive charge between the two electrodes of the battery. Li-ion batteries have many advantages compared to batteries with other chemistries, which will be discussed in more detail in Chapter 2. Unfortunately, Li-ion batteries are very sensitive to being used outside of its specified operating range. These specifications include the battery operating temperature, over- and undervoltage thresholds as well as the maximum charge and discharge current. This is due to the fact that Lithium is a very reactive element. The Li-ion cells can potentially ignite or even explode if it is used outside of its safe operating range specified by the manufacturer [2]. A Battery Management System (BMS) is required, for this reason, to monitor all of the above mentioned specifications and to ensure that the battery is operated safely within the specified range. The objective of this project is to develop a BMS for a Li-ion battery pack that will be used on a micro electric vehicle (EV). This technology can also be applied to the renewable energy storage sector since the research of Li-ion battery storage for EVs are more advanced than for renewable storage.

1.2 Project Motivation

In an attempt to reduce the high investment cost of a Li-ion battery it is crucial to maximise the lifespan of the battery. One of the easiest ways to maximise the battery’s cycle life is to use it within the specified operating range as indicated by the manufacturer. All the different aspects requires to be monitored continuously to ensure the battery is operated within the specified range. This is achieved by using a BMS to monitor the battery pack. The different cell voltages and temperatures, as well as the battery current are measured by the BMS to ensure it is within the specified range of operation. The BMS for instance disconnects the battery from the load if the resulting measurements are not within the specified range of operation, effectively protecting the battery. This increases battery performance by minimising the physical degradation of the battery. A BMS primary focus are therefore on the safety and the protection of the battery, to minimise the risk of sudden failure and to maximise the life cycle of the battery. The secondary function of the BMS is to perform battery diagnostics, such as state of charge (SOC) estimation, state of health (SOH) estimation and state of power (SOP) estimation. SOC is the amount of charge the battery has at a certain time, i.e. how much of the total energy capacity is available for usage. SOH refers to the current battery capacity compared to the original capacity specified by the manufacturer. SOP refers to the maximum amount of power that can be delivered by the battery at a specific time. These states cannot be measured directly, but can be estimated. Accurate estimations of these states are very important for effective energy management. In order to estimate these states accurately, a model is required to describe the dynamics of the battery. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 1. PROJECT OVERVIEW 3

A great variety of battery models exists. This project will investigate and select the optimal model in terms of accuracy and complexity. Once the optimal model is selected, the parameters of the model will be estimated, which can in turn be used for energy management purposes.

1.3 Research Objectives

The motivations for this project as discussed above gives rise to the following objectives:

Development of a proof of concept Li-ion BMS to demonstrate the basic working • of the BMS. This includes the design, manufacturing and testing of the proof of concept BMS.

Development of a full scale Li-ion BMS for the purpose of a micro EV. This includes • the design, manufacturing and testing of the full scale BMS. The aim is to prolong the life of the battery by ensuring the battery is operated in a safe and sustainable way.

The successful implementation of a balancing algorithm within the BMS to max- • imise the available capacity of the battery pack.

Off-line parameter estimation using the BMS. • The development of an on-line parameter estimation algorithm using the appropri- • ate battery model. The algorithm will be proved by a simulation.

Development of a proof of concept Solid State Contactor (SSC) to protect the • battery against overcurrent and short circuit conditions. This includes the design, manufacturing and testing of the proof of concept SSC.

1.4 Thesis Structure

Chapter 2: Literature Study • The relevant literature concepts and topics are discussed. The study describes, amongst others, related works, a short battery overview, BMSs, battery modelling and parameter estimation algorithms.

Chapter 3: Hardware Design • The hardware design of a proof of concept BMS is firstly discussed within this chapter. The design choices made to up-scale the system to a full scale BMS for an EV follows. Finally the design of a prototype solid state contactor are discussed in this chapter.

Chapter 4: Software Design • The software design of the BMS is discussed in this chapter. This includes the different monitoring loops and the balancing algorithm. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 1. PROJECT OVERVIEW 4

Chapter 5: On-line Parameter Estimation • An on-line parameter estimation algorithm is investigated within this chapter. A simulation is implemented to prove the accuracy of the algorithm.

Chapter 6: Results • The test results of the designed proof of concept BMS, full scale BMS and proof of concept SSC are discussed in this chapter.

Chapter 7: Conclusion and Future Work • A conclusion of the work presented within this thesis is discussed in this chapter as well as some ideas for future work. Stellenbosch University https://scholar.sun.ac.za

Chapter 2

Literature Study

2.1 Introduction

Li-ion batteries have the potential to significantly impact the energy storage sector. This chapter discusses the history and operation of batteries in general but with a primary focus on Li-ion batteries. The surrounding concepts and principles used to monitor and manage batteries are also discussed within this chapter. It includes BMSs, battery modelling, parameter estimation, state estimation and the recursive least squares method.

2.2 Batteries: A Short Overview

2.2.1 Introduction The earliest forms of batteries are found in ancient civilisations, such as the Egyptians and Parthians, where it was typically used for electroplating purposes, not storing energy. Batteries used for energy storing purposes were first investigated in the late 17th century. Alessandro Volta discovered in the year 1800 that two different metals joined together by a moist intermediary would generate a flow of electrical power when the two metals are connected by a conductor. This discovery led to the invention of the first voltaic cell. A battery is simply a set of cells in series. In the two centuries that have pasted since, various new technologies have been devel- oped. The basic operation is however the same for all of these technologies, ranging from non-rechargeable to rechargeable batteries. Also, these technologies served an integral part of society but because of the low specific energy and low specific power constraints, was never used as a mainstream energy storage medium. Specific energy (Wh/kg) is the nominal battery energy per unit mass, sometimes referred to as the gravimetric energy density while specific power (W/kg) is the maximum available power per unit mass. In 1912, experimentation started on Li-ion batteries. Only in 1970 was the first Li- ion batteries made available to the open market. It is clear that the development of batteries is slow and comes with a number of difficulties. In the past 40 years significant improvements have been made to the initial Li-ion technology. Li-ion batteries nowadays have the potential of high specific power and high specific energy. The following section discusses the basic operation of batteries in more detail and also provides a comparative study in terms of the performance of the commercially available

5 Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 6 battery technologies.

2.2.2 Battery Operation Batteries store electrical energy in chemical bonds. All batteries makes use of electro- chemical reactions referred to as reduction and oxidation reactions [3]. Reduction is the gain of electrons by a molecule, atom, or ion. Oxidation is the loss of electrons by a molecule, atom, or ion. A battery cell has three essential components: the anode, the cathode, and the electrolyte. The materials used for each of these components determine the battery’s characteristics, but the basic working principle of a cell stays the same. The anode and cathode materials are chosen in such a way that the anode donates electrons, and the cathode accepts electrons. The tendency of a material to donate or accept electrons is commonly expressed as the material’s reduction potential. Reduction potential is measured in Volts (V). Each material has its own intrinsic reduction potential. The higher the potential, the greater the material’s tendency to be reduced. The difference between the reduction potentials of the cathode and the anode deter- mines the nominal operating voltage of the cell. The anode and cathode are separated by the electrolyte, which is typically a liquid or gel that conducts electricity. When the anode and cathode are connected to each other through a conductor, the anode undergoes a chemical reaction with the electrolyte in which it loses electrons, creating positive ions (oxidation). The positive ions flows through the electrolyte to reach the cathode. At the cathode, the positive ions and electrons reacts with the cathode (reduction). Together the entire process is known as a redox reaction. Lithium is the metal with the lowest density [4], the greatest reduction potential and the highest energy-to-weight ratio. Therefore, it is at the forefront of battery technologies and it will contribute extensively to the future of energy storage on a large scale. In reality, Li-ion batteries have a much higher energy density than other common rechargeable bat- teries, such as a nickel-metal hydride (NiMH) or lead-acid batteries. The Ragone diagram characterises the specific power and specific energy of the different battery chemistries. It is used to compare the different technologies and can be seen in Figure 2.1. The Li-ion batteries are not displayed as a continuous range on the Ragone diagram because different cell technologies are used in energy storage cells compared to power storage cells. Some Li-ion technologies have the highest specific energy (Wh/kg) while other Li-ion technologies have the highest specific power (W/kg). Other Li-ion technolo- gies tries to find a good balance between the two. It is important to note that typically there is a trade off between the specific energy and specific power, e.g. a lead-acid bat- tery’s capacity is greatly influenced by the speed at which the power is extracted from the battery. This is one of the reasons why lead acid cells is not ideally suited for EV appli- cations. EV applications require a high specific energy, but also a relatively high specific power. The combination of both these properties is one of Li-ion’s greatest advantages. The technology is, at the moment, expensive compared to other chemistries. This will change in the future as the scale of production of Li-ion batteries increases which will lead to price decreases. Li-ion batteries usually uses a mixture of different cathode and anode materials to complement the advantages and disadvantages of the respective materials. The redox reaction for charging and discharging a Lithium Iron Phosphate (LFP) cell can be seen Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 7

100000 Super- Lead-acid Li-ion capacitor spirally wound very high power 10000 Li-ion high power

1000 Li-ion high energy Li- 100 polymer

10

ecific power, cell level [W/kg] Ni-Cd Ni-MH Na-NiCL

Sp Lead-acid 1 0 20 40 60 80 100 120 140 160 180 200 Specific energy, cell level [Wh/kg]

Figure 2.1: Ragone diagram [5] below with a typical example of the operation of Li-ion batteries.

Discharge:

+ − Anode: LiC6 C6 + Li + e (2.2.1) −→

+ − Cathode: FePO4 + Li + e LiFePO4 (2.2.2) −→ Charge:

+ − Anode: LiFePO4 FePO4 + Li + e (2.2.3) −→

+ − Cathode: C6 + Li + e LiC6 (2.2.4) −→

A discharge diagram of a LFP cell can be seen in Figure 2.2. The oxidation and reduction reactions can be seen at the anode and cathode respectively. The positive denoted terminal is at the cathode while the negative denoted terminal is at the anode. During the charge cycle of a cell the redox reactions are reversed from that of the discharge cycle. Oxidation takes place at the positive terminal and reduction at the negative terminal. The positive terminal becomes the anode and the negative terminal becomes the cathode. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 8

e−

- +

Li+

Electrolyte

Anode Cathode + − + − LiC6 C6 + Li + e FePO4 + Li + e LiFePO4 → → Figure 2.2: Diagram illustrating the discharge of a LFP cell [6]

The most common material used for the anode is some form of carbon. Carbon materials have the advantage that their mechanical and electrical properties are not sig- nificantly affected by accepting or donating large amounts of lithium. Carbon is typically used in some form of graphite, but other materials do exist for example Lithium Titanate (LTO). The chosen cathode material varies greatly for the different cell technologies. It is chosen according to the requirements of the application. Typical examples of currently used positive electrode materials is shown in Figure 2.3. The main determining factors of batteries are performance, lifetime, safety, cost, power and energy density. The deter- mining factors of various battery technologies is also shown in Figure 2.3. The different battery technologies are rated according to these different factors. Generally, the battery technology is named after its positive electrode’s composition. Starting from the left, Lithium Iron Phosphate (LFP) is well balanced with high safety and cycle life. LFP has a relatively low specific energy because of its low voltage plateau. Lithium Cobalt Oxide (LCO) is a chemistry that is typically used in consumer elec- tronics. Drawbacks include low thermal stability and relatively low cycle life. Lithium Nickel Manganese Cobalt Oxide (LNMC) is widely used in EVs because it is very well balanced and has a high specific power. Lithium Manganese Oxide (LMO) shows high safety performance at a relatively low cost since no expensive metals are used. Unfortunately, it is very sensitive to high tem- peratures and it has a relatively low specific power. Lithium Nickel Cobalt Aluminium Oxide (LNCA) has the highest specific energy and specific power. Unfortunately, it lacks in terms of safety and cost. The variations on all of these battery technologies can differ greatly to result in a Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 9

LFP Energy density LCO

Costs Power density

LNMC SOC- Safety operating range LMO Cycles LNCA

Figure 2.3: Requirement fulfilment of various cathode materials [7] battery with the needed requirements for a specific application. There is no clear optimal solution for battery chemistries, only chemistries that suite certain applications better than others. Despite all the advantages it has, Li-ion technologies do have some disadvantages. Li- ion batteries degrade over time that leads to an increase in the internal resistance, which decreases the battery’s ability to deliver power. It is also susceptible to a number of other potential problems including oxygen production due to overcharging at the cathode and overheating of the anode. These potential problems can lead to battery degradation or in worst-case scenarios, ignite the battery. Thus, it is crucial for Li-ion batteries to have a BMS to prevent these problems. This section, thus far, has given a short review of batteries by discussing battery operation and comparing the different battery technologies. The rest of this section discusses different battery configurations since this greatly influences the specifications of the system monitoring the battery.

2.2.3 Battery Configuration Battery packs are a combination of cells. The voltage of a single cell is typically low compared to the demanded voltage for various applications. Cells are stacked in series to deliver a higher voltage to a load. This reduces the current, which minimises losses. The cells can be configured in various different configurations as shown in Figure 2.4. The arrangement of cells is dependant upon the following factors:

The mechanical layout of the battery pack for structural integrity. • The wiring harness connecting the different cells. • Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 10

a) b) c) d) Figure 2.4: Possible battery pack cell configurations: a) series, b) matrix, c) series-parallel and d) mixed

Temperature management. How to best regulate the battery temperature. • Robustness of the battery pack. By connecting the cells in a series-parallel configu- • ration, if one cell fail, that series string could be disconnected by a contactor. This would ensure that the rest of the pack could still be used.

Li-ion cell voltages need to be operated within the specified range of operation for • safety purposes and to prolong the cell’s lifespan. To ensure this is the case, all the cell voltages needs to be monitored continuously. Connecting the cells in a matrix configuration reduces the amount of cells that needs to be monitored, effectively simplifying the BMS.

These various configurations have different advantages and disadvantages and would typically depend upon the application of the battery. The battery configuration also influences the choice of BMS used to monitor it. The following section investigates BMSs in more detail.

2.3 Battery Management Systems

2.3.1 Introduction The first priority of a BMS is to monitor the health of all the cells in the battery pack, while still being able to deliver the power required by the application. In order to prolong the the life of the battery pack the BMS needs to maintain all the cells within the specified operating range. In this section an overview of BMSs are presented. This includes BMS requirements, architectures and battery balancing techniques.

2.3.2 Requirements The BMS is an integral part of any large scale battery pack and is generally responsible for: Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 11

Cell protection: Safety is the first priority of the BMS. Protecting the cells from • operating outside of the manufacturer’s specified operating conditions are crucial. The rest of the system also needs to be protected from the battery in the event of battery failure.

Data acquisition: Battery current, voltage and temperature measurements. • Data analysis: State of power, state of health and state of charge estimation. • Control: Charge and discharge current control to ensure it is within the manufac- • turer’s specified operating conditions.

Communication: Used to interact with other components in the system, e.g. the • charger or inverter. Typically also used to give users access to the data of the battery.

Battery balancing: Ensures that the maximum capacity of the battery is available • for use.

2.3.3 Architectures There are a variety of different BMS architectures. All of them have their advantages and disadvantages. The architectures are typically set apart by the scalability and cost of each system [8]. Some of the BMS architectures are presented next.

Centralised BMS Architecture: A centralised BMS architecture uses one main con- trol board that monitors all the different aspects of the battery. This architecture has the advantage of low cost and easy implementation when used with a battery with a low cell count. Disadvantages include large wiring harnesses as the size of the battery increases, since the main board needs to be connected to all the different cells and temperature sensors. This also increases the complexity of the system as the cell count increases. Typically this architecture is ideally suited for battery packs with low cell counts.

Distributed BMS Architecture: A distributed BMS architecture has a node on each cell which monitors the voltage and temperature of that specific cell. This node is a slave device which are connected to a master via a serial connection. All the different nodes communicate its measurements via the serial connection to the master controller. The master interprets this data and controls the output of the battery accordingly. This archi- tecture has the advantage that it is very easily scalable and easy to install. Unfortunately, the cost of a distributed system can be relatively high compared to a centralised system.

Modular BMS Architecture: A modular BMS architecture is a combination of the centralised and distributed architectures. It uses a set of slave devices that monitors more than one cell each. These slave devices are typically connected on top of each other, through a daisy chain communication interface, to monitor a large number of cells. The modular BMS architecture is flexible and scalable. The slaves are controlled by a master controller. The modular architecture delivers a good trade-off between the centralised Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 12

and distributed architectures. It is generally used for batteries containing a high number of cells such as the batteries used for electric vehicles.

2.3.4 Battery Balancing Cell balancing is used to ensure that the state of charge of each of the series connected cells is even. The inconsistencies in the manufacturing of battery cells result in unique performance characteristics for each individual cell in a battery pack. For this reason cells accept and deliver charge at a slightly different efficiency and their overall capacity differs slightly. This small difference in efficiency and capacity results in one cell having a higher SOC than another cell, even though the current through the series connected cells are the same. These differences are aggravated during extensive use of a battery pack. The difference between the SOC of the individual cells continue to increase which in turn lowers the overall capacity of the battery pack as a whole, since the battery pack will operate at the level of the weakest cell. The unbalanced state of the battery pack causes some of the cells to be operated in an overvoltage or undervoltage state which will significantly decrease the life cycle of the battery pack. It is therefore very important that the cells are balanced properly. There are two battery balancing techniques that will be discussed in the following subsections: passive and active cell balancing.

Passive Balancing: Passive balancing makes use of resistors to remove charge from the cells with higher cell voltages than the rest in the series string, until all the cell voltages equal each other. The advantage is that the system has a relatively low cost and complexity. The drawback of this method is that it is energy inefficient, since all the energy removed from the higher cells are dissipated in resistors. Passive balancing typically only balances the battery pack during charging. During discharge, the whole battery pack’s capacity is constrained by the cell with the lowest capacity in the series connected string. Balancing during discharge is not desirable since the energy is wasted. A typical passive cell balancing topology is shown in Figure 2.5. Cell balancing of Cell1 can be achieved by closing switch S1 and S2. The resistance R1 determines the balancing current and effectively the speed at which balancing is performed. Choosing R1 depends on the cell chemistry (nominal voltage), the manufacturer’s tolerance of the cells and the application of the battery.

Active Balancing: Active balancing removes charge from a cell with a high state of charge and delivers it to a cell with a lower state of charge. Transformers, inductors or capacitors are used as the active component to store the charge from the higher state of charge cells and then deliver it to the lower state of charge cells. Switching circuits are used in combination with these active components to effectively spread the charge from one cell to another. Active cell balancing has the advantage over passive cell bal- ancing that cells can be balanced during charging as well as during discharging. This effectively increases the capacity of the battery pack. Another advantage of active cell balancing, compared to passive cell balancing, is its high energy efficiency since energy is not dissipated within the resistors. The active cell balancing circuits are more expensive to build and more complex to control than passive cell balancing. The overall complexity Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 13

S1

+ Voltage Cell R monitor 1 1 − S2

+ Voltage Cell R monitor 2 2 − S3

+ Voltage Cell R monitor 3 3 −

Figure 2.5: Typical passive cell balancing topology of active cell balancing also reduces the total reliability of the system. There are many different active cell balancing topologies, but they will not be discussed in detail since passive balancing was chosen for this thesis due to the complexity of active balancing. The following section discusses the different battery modelling techniques.

2.4 Battery Modelling

2.4.1 Introduction Battery modelling is an effective way in which to manage the battery by estimating the SOH, SOP and the SOC. Accurate estimations of these states are very important since it cannot be measured directly. In order to estimate these states accurately a model is needed to describe the dynamics of the battery. Research on electric vehicles has increased dramatically and therefore a wide range of different battery models exists. These models can typically be split into three different categories, which include the equivalent circuit model, first principle model and the empirical model. These models are discussed in the following section.

2.4.2 First Principle Model The first principle model are usually the first choice for battery analysis due to its accurate representation of a battery’s physical properties. It models the battery as simply a collection of atoms bound together by electrochemical reactions. These reactions are the interactions between electrons, which can be described by the basic laws of physics. The first principle model attempts to analyse the battery through the atomic number and mass of the battery’s chemical elements. The different physical characteristics of the battery are modelled though several electrochemical models. Although these models can achieve high levels of accuracy, they are computationally complex and time consuming because of the involved partial differential equations. The first principle models are not suitable for control-oriented or real-time applications. It is typically used to investigate and Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 14

understand the physical properties of batteries in order to design new battery materials. The first principle model is not, for these reasons, discussed in further detail in this thesis.

2.4.3 Empirical Model The empirical model uses data-based methods to model the dynamic behaviour of a battery. These models rely entirely on experimental data sets and have no insight into the physical electrochemical processes within the battery. A large amount of empirical models has been proposed for various purposes. The Peukerts formulation being the most commonly used battery model. It was expanded to capture the non-linear relationship between the battery’s capacity and the discharge current under different temperatures [9]. Other more intelligent data-based models include, neural networks [10] and fuzzy logic [11], which is typically used to estimate the states of batteries. These models require large off-line training data to estimate the model’s parameters. These models have shown high levels of accuracy. The downside is that training has to be acquired off-line. The training data could also prove to be a constraint. New applications require new training data in order to determine how the battery will react to a specific application. This makes the model’s accuracy directly proportional to the quality of the training data [12]. In addition, the empirical models always rely on a large amount of experimental observations, which require a large amount of experimental and modelling.

2.4.4 Equivalent Circuit Models The Equivalent Circuit Model (ECM) is a good trade off between the empirical and first principle models. It delivers some physical insight into the battery as well as a good control-orientated basis. A large variety of ECMs exist and will be discussed in the sections below. These models use electric circuits to mimic the dynamic electrochemical processes of a battery. The accuracy of the model typically depends upon the number of electrical elements used. Parameters in the model in turn depend on many factors, such as the SOC, the temperature and the SOH. The presented models disregard self-discharge and other factors with long time constants.

Internal Resistance model: The internal resistance model is the most simplistic ECM available and is shown in Figure 2.6. It consists of an ideal voltage source VOC and an equivalent series resistor Rs. The voltage source is used to model the open circuit voltage and the resistor is used to model the ohmic resistance of the battery.

Single Polarisation Thévenin model: The Single Polarisation (SP) Thévenin model is the most commonly used battery model and is shown in Figure 2.7. It consists of an ideal voltage source VOC , series resistor Rs and a parallel resistor-capacitor Rt1-Ct1 pair. Again,the voltage source is used to model the open circuit voltage. The resistor Rs models the ohmic resistance and the parallel RC pair models the polarization voltage.

Partnership for a new Generation of Vehicles linearised model: The Partner- ship for a New Generation of Vehicles (PNGV) linearised model is used in the "Free- domCAR Battery Test Manual" which is a result of the FreedomCAR program which Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 15

Rs +

+ VOC V (t) − I(t) − Figure 2.6: Internal resistance equivalent circuit model

Rt1 Rs + Vt1 − +

+ Ct1 VOC V (t) − I(t) − Figure 2.7: Single polarisation Thévenin equivalent circuit model

Rp Cpb Rs + Vp + − + Vpb− + Cp VOC V (t) − I(t) − Figure 2.8: PNGV equivalent circuit model ended in 2003. The program set out to lay the groundwork for more energy efficient and environmentally friendly highway transportation technologies and was funded by the American government [13]. The PNGV model is based on the SP Thévenin model and is shown in Figure 2.8. Again, the voltage source VOC is used to model the open circuit voltage, Rs models the ohmic resistance and the parallel RC (Rp-Cp) pair models the polarization voltage. Capacitance Cpb models the cumulative open circuit voltage change with respect to current I(t).

Dual Polarisation Thévenin model: The polarisation characteristic of a Li-ion bat- tery consists of the concentration polarisation and the electrochemical polarisation. In the SP Thévenin model both these are modelled by one parallel RC pair. Unfortunately, this one pair can only model it to a certain extent. The Dual Polarisation (DP) Thévenin Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 16

model adds an RC parallel pair to the SP Thévenin model as shown in Figure 2.9. This expands the modelling of the polarisation characteristics of the battery, which increases the model accuracy. The DP Thévenin model is an improved SP Thévenin model and consists of a voltage source (VOC ), three resistors (Rs, Rt1, Rt2) and two capacitors (Ct1, Ct2). Again,the voltage source VOC is used to model the open circuit voltage and Rs models the ohmic resistance. The first parallel RC (Rt1-Ct1) pair models the electrochemical polarization and the second parallel RC (Rt2-Ct2) pair models the concentration polarization.

Rt1 Rt2 Rs + Vt1 + Vt2 − − +

+ Ct1 Ct2 VOC V (t) − I(t) − Figure 2.9: Dual polarisation Thévenin equivalent circuit model

RC model: The RC model shown in Figure 2.10 was developed by the battery manu- facturer SAFT [14]. It comprises of two capacitors (Cb, Cc) and three resistors(Re, Rc, Rt). The capacitor Cb models the capacity of the battery and is therefore extremely large. The capacitance Cc represents the dynamic behaviour and is typically relatively small. The resistance Rt is known as the terminal resistance, Re is the end resistance and Rc is the capacitor resistance.

Re Rt + Rc + Cb Vb V (t) − + Vc Cc I(t) − − Figure 2.10: RC equivalent circuit model

The following section discusses the different methods of estimating the parameters for an ECM. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 17

2.5 Off-line Parameter Identification of an ECM

2.5.1 Introduction ECMs are commonly used to model battery behaviour. Accurate estimations of the battery model parameters have a direct correlation with the model’s performance. In this section, an overview is given on the methods of off-line ECM parameter identification.

2.5.2 Open Circuit Voltage Identification Determining an accurate estimation of the open circuit voltage is a crucial part of the implementation of most ECMs. The open circuit (OC) voltage VOC is present in all but one ECM (RC) model. The OC voltage is typically measured as a function of the SOC and temperature of the battery. If the battery is not used for an extended period of time, the battery terminal voltage will equal the electrochemical potential of the battery, thus reaching equilibrium. This is the potential required to balance the difference between the anode and cathode’s ability to gain or lose electrons. This state is also referred to as the OC voltage. The OC voltage is determined at set intervals of the SOC and constant temperature. The relationship between the SOC and OC voltage is not linear and is thus interpolated by a polynomial. A typical procedure to determine the OC voltage is as follows: the battery is fully charged with a Constant Current-Constant Voltage (CC-CV) profile according to the manufacturer’s specification. The CC-CV charging profile is achieved by charging the battery at constant current (CC) until the battery reaches its maximum voltage. The battery is then charged to maintain this maximum voltage until the charge current de- creases below the fully charged specification as detailed by the manufacturer. A rest period follows to allow the battery to reach its equilibrium potential. The battery is then discharged at constant current to 90% of its nominal capacity. Typically, the manufac- turer’s rated discharging current will be used as the reference for the amount of discharge current. Another rest period is then inserted during which time the battery will again reach its equilibrium potential. This cycle of discharging (10%) and inserting a rest pe- riod continues until one of the cells reaches its minimum voltage which marks the end of the OC voltage test. An example of the typical results obtained from this testing procedure is shown in Figure 2.11. The same process can also be followed to determine the OC voltage of the battery whilst the battery is charging, however the battery must be drained beforehand to 0% capacity. The battery has to be charged with the same amount of current used with the discharging method. The battery is charged at constant current charging cycles, similar to the discharge cycles, where the battery is charged 10% and given a rest period to reach its equilibrium potential. This is repeated until one of the cells reaches its maximum voltage and the charge OC voltage test is completed. It is worthy to note that the charge and discharge test do not compare perfectly, since the equivalent potential of the battery is dependant upon the previous usage of the battery [15]. An exaggerated example of the OC voltage hysteresis during charging and discharging is shown in Figure 2.12. This non-linearity of the battery is caused by the Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 18

52 Voltage OC voltage 50

48

46 Voltage [V]

44

42 0 5000 10000 15000 Time [s] Figure 2.11: Typical discharge OC voltage test electrochemical reactions within the battery. The magnitude of the hysteresis is typically dependant upon the cell chemistry. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 19

52 Discharge Charge 50

48

46 Open circuit Voltage [V] 44

42 0 20 40 60 80 100 State of charge [%] Figure 2.12: Typical open circuit hysteresis

2.5.3 Time Domain Parameter Identification Simple time dependant testing can be used to characterise a battery’s behaviour. This is particularly important to enable ECM parameter fitting. In addition to the OC voltage test detailed in the previous section, there is the Hybrid Pulse Power Characterisation test (HPPC) that is used to estimate the characteristics of the current dependent ECM parameters. A HPPC test consists of a high current pulse charging and discharging the battery for for a short duration of time. Normally, pairs of equal magnitude discharge and charge current pulses are applied at different SOC operating points of the battery. Applying a HPPC test at different SOC operating points leads to a dynamic ECM which describes the battery behaviour over the full SOC range of the battery. Variations of this test can be applied in order to suit the application of the battery. The parameters and OC voltage of an ECM can be identified simultaneously as de- tailed in [16]. A typical example of the test is shown in Figure 2.13. The voltage Vs is the peak value of the linear part of the curve while Vt is the voltage value of the exponential part of the curve. The voltage Vs is used to calculate the ohmic resistance of the battery pack. It can be calculated by

Vs Rs = , (2.5.1) Ibat

where Ibat is the battery current just before the rest period starts. The voltage Vt is used to estimate the dynamic behaviour of the battery. Curve fitting is typically used to estimate an appropriate time constant or time constants to obtain the ECM parameters. Curve fitting is only applied to the exponential part of the curve. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 20

52

50

48 Rest period

46 Voltage [V] Vt

44 Vs

42 0 5000 10000 15000 Time [s] Figure 2.13: Battery voltage measured during off-line test

The curve fit in combination with the battery current, just before the rest period starts, contain enough information to estimate the polarisation characteristic of the battery.

2.5.4 Frequency Domain Parameter Identification Electrochemical impedance spectroscopy (EIS) is a frequency domain testing procedure that employs small amplitude signal perturbations to measure the impedance of the battery at different frequencies. This test is typically done at different cell operating points such as temperature, SOC and whether the battery is busy being charged or discharged. The magnitude of the perturbations have to be small in order to assume that at that specific operating point, the system is linear. During the test, the temperature of the battery is required to be regulated to ensure the results can be related to a specific operating point. Batteries are inherently non-linear devices, so it is crucial that these conditions are met to ensure that the results for one operating point do not overlap with other operating points. EIS testing can be used to identify the parameters of an ECM. The response of the battery, when tested at mid-frequency ranges, exhibits behaviour which can be described using RC circuit elements [17]. The low and high frequency testing ranges results in behaviour which can be described by capacitive and inductive circuit elements. The impedance of Li-ion batteries are very low (within the milliohm range) and can- not be easily and accurately measured using laboratory EIS systems. It is said that commercial EIS systems become less accurate when the impedance is below 0.1 Ω [18]. Another possible problem is the mutual inductance of the cell cable and placement of the leads which can have a major effect on the EIS system’s performance. The duration of the test at low frequencies (1 mHz or less), can be a considerable drawback since it can Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 21

last more than several hours. It is for these reasons that frequency domain parameter estimation is not investigated further within this thesis.

2.6 State Estimation

2.6.1 Introduction A battery is a complex non-linear electrochemical device. Only a small amount of param- eters can be measured such as the voltage, current and temperature. Energy management is crucial to use the battery optimally and effectively. Some parameters that are needed for accurate energy management, cannot be measured, but only estimated. These pa- rameters include the SOH, SOC, and SOP and will be discussed in more detail in this section.

2.6.2 SOH Estimation The degradation of a Li-ion battery is indicated by two factors. One, the battery’s capacity decreases, and two, the internal resistance increases over time. This changes the battery’s behaviour and could cause failure or limit the battery’s ability such that it is not able to function as designed for. It is for this reason that the health of the battery should be analysed. SOH can be defined by either comparing the remaining capacity of the battery to the original rated capacity or by the increase in the internal resistance of the battery. These two definitions are defined below by

Qactual SOHcap = x 100%, (2.6.1) Qrated

Rrated Ractual SOHres = 1 + − . (2.6.2) Rrated

In the first definition, Qrated refers to the manufacturer’s rated capacity and Qactual refers to the measured remaining capacity of the battery. This can be calculated by discharging the battery from 100% to 0% according to the manufacturer’s standard dis- charging method. This will typically determine the discharge rate as well as the nominal operating temperature. In the second definition, Rrated refers to the initial internal resistance of the battery. Typically, the manufacturer does not supply this information in the datasheet. Therefore it is important that the parametrisation of the battery is done at the beginning of its life cycle in order to estimate the internal resistance. Ractual refers to the determined internal resistance of the battery. Again, both these values are calculated at the specified nominal operating temperature and discharge rate. Currently, there is no definite consensus in the industry to how SOH is measured. It is for this reason that a SOH has to be chosen that signals the end of life (EOL) of a battery. The general definitions are that either the EOL of a Li-ion battery is at SOHcap < 80% [19] or when the SOHres <= 0 [20]. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 22

2.6.3 SOC Estimation The SOC is determined by comparing the the remaining charge Q of a battery compared to the nominal capacity Qrated of the battery. The SOH of the battery influences the SOC since the capacity decreases over time as can be seen in the following equations

Q SOCnominal = x 100%, (2.6.3) Qrated

Q SOCnominal SOCactual = x 100% = x 100%. (2.6.4) Qactual SOHcap The SOC serves as a measurement of the amount of energy that is still available for use within the battery. Compared to an internal combustion vehicle, the SOC can be viewed as the fuel gauge of the battery. It is important to note that as the battery degrades and the capacity reduces, the SOC needs to be updated accordingly. For example in a degraded battery, the SOCactual might differ significantly from the SOCnominal of a new battery and will consequently convey a very inaccurate estimate of the remaining charge. Additionally, the temperature conditions and the nature of the load could also significantly impact the SOCactual compared to the SOCnominal. A wide range of SOC estimation methods exist, as stated earlier. The most arbitrary method for estimating the SOC, is by integrating the current of the battery such that

1 Z t SOC(t) = SOC(t0) + I(τ)dτ. (2.6.5) Q t0 This method is also known as coulomb counting and is widely used in the consumer electronics market. Unfortunately, the method is very sensitive to the accuracy of the current sensor as well as to the initial SOC of the battery since an error in the measure- ment will be integrated over time. Another problem is the limited bandwidth due to the sampling period. Sudden changes in current can therefore not be accurately measured, which further decreases the accuracy of this method. Other SOC estimation methods are mostly based on the way in which the battery is modelled, except empirical methods of estimation. Pure empirical models uses the current, temperature and voltage measurements as inputs and delivers an estimate on the SOP, SOH or SOC as outputs. Hybrid empirical and ECM methods have been proposed as detailed in [11], where the equivalent circuit model is based on fuzzy logic. In general the selected model is combined with some form of estimation method to estimate the states within the model. A first principle model in combination with an extended Kalman filter is an example of such a model and is described in more detail in [21]. ECMs are the most predominantly used solution for SOC estimation in automotive and large-scale battery packs [7]. An ECM has the advantage that the algorithms and models can be reused easily for different cell chemistries, and it is also efficient and robust. Typically, an ECM is used as the basis for the estimation process. The model is given the measured current of the battery as an input. A control system is used to change the states of the ECM in such a way that the difference between the output of the model and real system is minimised (negative feedback), as shown in Figure 2.14. These estimation methods includes the Luenberger observer, sliding mode method, Kalman filter and Proportional Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 23

Measured Voltage Battery Current

Estimation − method +

Measured Current Battery model Calculated Voltage Figure 2.14: Block diagram of the ECM SOC Estimation Methods integral observer [22]. One of the states that these estimators will estimate, typically include the open circuit voltage VOC of the battery. This can then be used to obtain an estimation of the SOC of the battery.

2.6.4 SOP Estimation State of power (SOP) is the ability of the battery to deliver or accept power to or from the application. An accurate SOP estimate is useful in practical battery applications since it can be used to determine the available power and as such ensure the battery is not overcharged or over-discharged. SOP is defined similarly as discussed in [23]. It can easily be estimated by the use of an ECM. Using the SP Thévenin model as an example, the maximum discharge current can be calculated if all the parameters of the model is known. The SOP can be calculated with the maximum allowed discharge current, without decreasing a cell’s terminal voltage to below the cell voltage as specified by the manufac- turer. Thus,

Vlimit(VOC Vlimit) SOP = − [W]. (2.6.6) Rs + Rt1

Equation 2.6.6 is derived using node analysis. The voltage Vlimit is the minimum allowed terminal voltage of the cell. The voltage VOC is the open-circuit voltage and (Rs + Rt1) is the total internal resistance of the cell. This method can also be used to calculate the maximum allowed charging current of a cell. In this case Vlimit is the maximum cell voltage specified by the manufacturer.

2.7 Recursive Least Squares method

The least squares (LS) method is a mathematical algorithm that minimises the sum of the squares of the differences between observed values and estimated values. This method is typically used for curve-fitting and this can be also be applied to the dynamic behaviour of Li-ion batteries. The parameters of an ECM can be estimated by the LS method in such a way that the error between the measured data and the model is minimised. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 2. LITERATURE STUDY 24

Unfortunately, the LS method can only be applied to a complete data set, which makes it unsuitable for real-time estimation purposes. This is where the recursive least squares (RLS) method comes in. The RLS method is derived from the LS method and is usually used for real-time estimation. The model is recursively updated as new data is processed using the least squares method. The RLS method for on-line parameter estimation will be discussed in more detail in Chapter 5.

2.8 Conclusion

In this chapter, the different concepts pertaining to the objectives of this thesis were pre- sented. This includes a short overview of batteries, where the different technologies were compared and different configurations were discussed. The needed BMS requirements and architectures were also investigated. Battery modelling and parameter estimation methodologies were discussed in detail. Definitive definitions for the different state esti- mations of batteries were also given. Stellenbosch University https://scholar.sun.ac.za

Chapter 3

Hardware design

3.1 Introduction

The hardware design of a proof of concept BMS for a small Li-ion battery pack is discussed within this chapter. This design serves as a prototype to prove the basic capabilities of the different subsystems within the BMS. This design is scaled up for the purpose of a micro EV and is also discussed in this chapter. This chapter also includes the design of a proof of concept solid state contactor that may be used as an alternative to the mechanical contactor used in the full scale BMS design.

3.2 Proof of Concept Battery Management System

3.2.1 Introduction In this section a proof of concept BMS is designed for a small Li-ion battery pack. This concept design is inspired by a previous prototype BMS designed for the Shell Eco- Marathon (SEM) competition. The competition’s goal was to travel a certain distance using the least amount of energy possible. Energy efficiency was therefore extremely important. The prototype EV was supposed to have competed in the Shell Eco-Marathon race, but due to some technical difficulties with the electrical drive train, the EV was unable to participate in the race. The concept design is based on the battery pack used for the SEM competition. The design and specifications of the battery is described in more detail in the following subsections.

3.2.2 Design choices The SEM battery pack consists of 13 EEMB LP55100100 Lithium polymer cells connected in series. The cell specifications is shown in Table 3.1. The proof of concept BMS design for this thesis is based on these specifications. The nominal battery voltage of the complete battery pack is 48 V. This voltage has become the standard for low voltage energy storage systems since it is well within the safe operating range which is limited to 60 V. The human body has an internal resistance and

25 Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 26

Table 3.1: LP55100100 cell specifications

Parameter Rating Nominal voltage 3.7 V Maximum voltage 4.2 V Minimum voltage 2.75 V Nominal capacity 6.5 Ah at 1.3 A Maximum discharge current 13 A Maximum charge current 6.5 A as the magnitude of the voltage increases, so does the current in the case of an electric shock. An electric current too large can affect biological tissue in a hazardous manner. A BMS consists of multiple components. This typically includes a battery monitoring chip that measures the cell voltages and pack temperature. A current sensor is used to measure the battery current. A Micro Controlling Unit (MCU) is used to process the data and accordingly control the the output of the battery by means of some sort of a switch. A block diagram of the proof of concept BMS is shown in Figure 3.1. In the figure, B1 to B13 are balancing circuits that are controlled via the battery monitoring chip which is programmed with the MCU. The design includes a shunt resistor as a current sensor. Back to back power field-effect transistors (FET) are used as a solid state switch. A MCU is the master controller which controls the monitoring chip. The MCU is powered by a low power buck regulator. The proof of concept BMS with the SEM battery is shown in Figure 3.2. The design choices for all the main circuit components will be discussed in the rest of this section.

+

B13

Monitor I2C Micro- 3.3 V Low chip controller Power Unit DC-DC 48 V B2

B1

Current sensor Switch −

Figure 3.1: Proof of concept BMS circuit diagram Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 27

Figure 3.2: Proof of concept BMS with the SEM battery

3.2.2.1 Cell Monitoring System There is a large variety of battery monitoring chips that are used to measure the voltage and temperature of the different cells in a battery pack. Linear Technology, Analogue Devices and Texas Instruments all provide possible solutions and will be discussed below.

AD7280A [24] is a modular battery monitoring system from Analog Devices. It can monitor up to six cells per chip, but multiple AD7280A’s can be stacked on top of each other through its daisy-chain interface to accommodate up to 48 cells connected in series. The AD7280A supports cell balancing, temperature and voltage measurements. It uses the Serial Peripheral Interface (SPI) communication protocol to communicate with the master controller.

LTC6802-1 [25] is a modular battery monitoring system from Linear technologies. It can monitor up to 12 cells per chip, but multiple LTC6802-1 can be stacked on top of another via its daisy-chain interface to accommodate a high battery voltage (>1000 V). The LTC6802-1 supports cell balancing, temperature and voltage measurements. It also uses the SPI communication protocol to communicate with the master controller and it is equipped with an open wire connection fault detection function.

BQ76940 [26] is a centralized battery monitoring system from Texas Instruments (TI). The chip periodically measures the cell voltage, battery current and battery temperature. It supports up to 15 cells and 3 temperature sensors. Multiple BQ76940’s cannot be stacked on top of each other to accommodate an increased battery voltage. It aims to be a complete battery monitoring solution in itself. The BQ76940 has a current sensor as well as an output for a FET solid state switch. The solid state switch can be used to control the output of the battery. It uses the Inter-integrated Circuit (I2C) communication protocol to communicate with the master controller. Another important feature that is included within the BQ76940, is a built-in extra layer of analogue protection. As soon as one or more of the sensors sense a value out- side of the specified operating range, the solid state switch opens and thus protects the battery. The maximum overvoltage (OV), undervoltage (UV), short-circuit (SC) and overcurrent values are programmed into the BQ76940 directly after the system start-up. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 28

The periodical measurements are continuously monitored and the solid state switch is controlled independently, thus not by the MCU but by the BQ76940 itself. This protects the battery if the digital control circuitry from the MCU should fail for some reason. The BQ76940 was chosen as the battery monitoring chip for this project due to its ability to measure all the required variables, and also due the additional protection circuitry that it provides. The BMS needs to be operational over extended periods of operation. If the MCU should fail for some reason, the BQ76940 chip will keep monitoring the voltage of all the cells and the current of the battery. If some fault occur the switch is opened to protect the battery from damage.

3.2.2.2 Cell Balancing The BQ76940’s cell balancing feature is implemented within the proof of concept BMS design. Each cell is equipped with its own balancing circuit. All of the different cell balancing circuits are situated on the proof of concept BMS printed circuit board (PCB) along with other components such as the BQ76940 and the MCU. Each cell balancing circuit is controlled with a P-channel MOSFET which is switched on or off using the BQ76940 chip. The MCU controls which cells are balanced by programming the BQ76940 chip. A 20 Ω balance resistor was selected to discharge the cell being balanced. This results in a balancing current of 200 mA which is 3% of the LP55100100 cell capacity (Ah). Balancing currents of 1% of the battery capacity (Ah) are adequate for applications that stay in standby for long periods, e.g. electric vehicles, according to [27]. The balancing current is chosen in such a way that the proof of concept BMS is compatible with battery packs with a larger capacity than that of the SEM battery pack.

3.2.2.3 Current Sensor For the safety of the battery and the application it is extremely important to regularly measure the battery current to avoid continuous overcurrent conditions. The BQ76940 chip is equipped with a 16-bit integrating analogue-to-digital converter (ADC) that pro- vides measurements of accumulated charge across a current sense resistor. This func- tionality is used since it reduces the overall system complexity and it also provides an accurate measurement of the battery current. Shunt resistors used for current sensing purposes are ideal for smaller battery packs due to its low cost and simplicity. Larger battery packs, typically, do not use shunt resistors, because of the high power losses and the effect of temperature on the resistor’s value. The value of the shunt resistor used in this design is chosen as 2 mΩ. The value of the resistor was chosen as such to minimise losses, since efficiency is of great concern for this design. This does however slightly lower the measurement accuracy.

3.2.2.4 Solid State Switch The BQ76940 chip provides two low side FET drivers. These may be used to control back-to-back power FETs, which acts as a solid state switch. Two FETs are used, one to control each direction of the battery current. This has the advantage for example that if the battery is fully charged, the charge FET can be opened to only allow a discharge Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 29 current. This functionality does result in higher losses in the switch, but are rarely used. It is only used on the edge of operation, meaning at very low or high SOC. The FETs chosen for the proof of concept BMS was the FS3207 power metal-oxide-semiconductor field-effect transistor (MOSFET) from International Rectifier. It is chosen for its low on-state resistance of 4.5 mΩ and minimum breakdown voltage of 75 V.

3.2.2.5 Micro Controlling Unit The MCU used in this design is the Piccolo TMS320F28035 [28] from TI. TI MCUs are chosen for all the electronic development done within the electrical drive train. This ensures compatibility and eases the integration process between the different working parts of the overall project. The TMS320F28035 was chosen for its Controller Area Network (CAN) functionality. It is the smallest available TI MCU with CAN functionality. The CAN interface will be used, at a later stage, to communicate with the dashboard unit of the prototype EV. The MCU is used for the processing of data and receives the battery data via the I2C communication protocol. The MCU controls the complete BMS apart from partially controlling the solid state switch. The MCU processes the data it received from the monitoring system such as the cell voltages, battery current and pack temperature. It is also in charge of cell balancing and can control the output 48 V battery supply via the BQ76940 chip.

3.2.2.6 Low Power Buck Regulator A low power regulator is required to step down the battery voltage to power the MCU and future communication interfaces. The supply voltage is required to step down from 48 V to 5 V and 3.3 V. The battery voltage can fluctuate, depending on its state of charge, between a minimum voltage of 41.6 V and a maximum voltage of 54.6 V. The LM5017 [29] buck regulator from TI is selected for this purpose. It can deliver a maximum current of up to 600 mA which is adequate since the MCU uses a maximum constant current of 200 mA. The LM5017 is primarily chosen for its 600 mA current supplying capability, since additional current will be required at a later stage for the implementation of the communication interfaces. Secondly, the LM5017 is chosen for its flexibility in terms of its wide input voltage range, adjustable switching frequency and under voltage lockout protection. It is also equipped with other protection features such as thermal shut down and a peak current limiting circuit which protects against overload conditions. This makes the LM5017 ideal for the purpose of this project. The design to step down the battery voltage to 5 V through the LM5017 is shown in Appendix A.1. The 5 V supply will also be used in future versions to power the isolated CAN transceiver. Isolated CAN is required since the solid state switch is connected to the negative terminal of the battery. The 5 V is stepped down to 3.3 V using the TPS73633 which is a linear regulator from TI. The 3.3 V is used to power the MCU. The voltage ripple on the 3.3 V rail is shown in Figure 3.3. The switching frequency of the LM5017 is 237.3 kHz which confirms the designed switching frequency detailed in Appendix A.1. The ripple voltage is 58.5 mV. The large ripple voltage can be attributed Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 30

0.05 Ripple 0.04

0.03

0.02

0.01 Voltage [V]

0.00

0.01 −

0.02 − 0.000010 0.000005 0.000000 0.000005 0.000010 − − Time [s] Figure 3.3: Voltage ripple to the fact that a ripple voltage of 25 mV is required at the feedback pin to enable the LM5017 to react.

3.2.2.7 Temperature Sensor The temperature of the battery pack is measured with three thermistors. The 103AT-2 of Semitec is selected according to the BQ76940 datasheet. It specifies the use of 10 kΩ negative temperature coefficient (NTC) thermistors for measurements.

3.3 Full Scale Battery Management System

3.3.1 Introduction The proof of concept BMS detailed in the previous section is scaled up for the purpose of a micro electric vehicle in this section. The required battery capacity is 10 kWh with a maximum continuous power output of 5 kW. The battery terminal voltage is selected as 48 V since this reduces the risk of fatal electric shocks. The required power specification results in a nominal current of 104 A. By scaling the discussed BMS to meet all of the specification for the EV, new design challenges are introduced. The design choices made to address these challenges are discussed in this section.

3.3.2 System Overview The full scale BMS is based on the proof of concept BMS that is expanded into multiple components. The complete proof of concept BMS was manufactured onto a single PCB. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 31

Due to the scale of the micro EV battery, the full scale design is forced to be divided into separate PCBs, which include:

1. A main control board, which measures the different battery attributes and interprets them.

2. A current sensor board to deliver a voltage representation of the battery current that can be measured by the main control board. Currents of this magnitude could possibly induce Electromagnetic Interference (EMI) onto the cell voltage measure- ments if the sensor remained on the main board as with the proof of concept design.

3. Separate balancing boards are required and mounted on each parallel set of cells to increase the battery balancing current.

The other circuit components within the system that was not developed include a mechanical contactor and a fuse that serves as a back up to the contactor if it should fail. A condensed version of the complete BMS is shown in Figure 3.4. Starting from the left: the system has a local buck regulator to supply power to the MCU and various communication hardware (CAN, USB and Bluetooth). The MCU is the master controller and controls the 48 V battery output by using a mechanical contactor. It also monitors the battery current through the current sensor board and does cell balancing during charging. The voltage and temperature measurements are done with a battery monitoring chip (BQ76940). Custom balancing PCBs are designed for cell balancing purposes in order to enable high power cell balancing. The battery cells are connected in a matrix configuration to minimise the total required cell voltage measurements. The full scale BMS installed along with the battery pack can be seen in Figure 3.5. The design choices made are discussed in detail in the following subsections.

F Contactor 1 Current sensor 250 A + Communication

B15

Low Micro- 3.3 V I2C Monitor 48 V Power controller chip DC-DC Unit B2

B1

M1

N1 −

Figure 3.4: Full scale BMS circuit diagram Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 32

Figure 3.5: Full scale battery pack

3.3.3 Battery Cell Configuration The cells used inside the battery pack are 100 Ah LFP (LY-100AH) cells from Liyuan Battery Corporation. The battery chemistry is chosen for its high cycle life and high safety. The LFP cells have a nominal voltage of 3.2 V each, resulting in nominal battery voltage of 48 V when 15 of the cells are connected in series. The specifications of the cells are shown in Table 3.2. Two sets, of 15 cells connected in series, are used to achieve the required capacity of around 10 kWh. The resulting battery pack is a 48 V - 200 Ah battery pack, which has a capacity of 9.6 kWh. The two strings are connected in the matrix configuration, i.e. two cells are connected in parallel, with 15 of these parallel connections connected in series. This configuration is selected to minimise the required cell voltage measurements. Only 15 parallel connected cell voltages need to be measured. Another advantage, with careful selection, is that the capacity tolerances of the cells can be used to cancel each other out by connecting a low capacity cell in parallel with a higher capacity cell. This will typically entail testing each individual cell’s capacity before constructing the battery pack. A digital model of the full scale BMS installed along with the battery pack is shown

Table 3.2: LY-100AH cell specifications

Parameter Rating Nominal voltage 3.2 V Maximum voltage 3.6 V Minimum voltage 2.5 V Nominal capacity 100 Ah at 33 A Normal discharge current 33 A Normal charge current 33 A Maximum discharge current 500 A Maximum charge current 300 A Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 33

Figure 3.6: Digital model of the battery pack in Figure 3.6. The battery pack is divided into an upper and lower level due to size constraints. All the control circuitry is packaged close together within the remaining space allotted to the battery pack. This simplifies the installation of the BMS onto the battery. It also results into a battery pack with a symmetric form as specified by the EV manufacturer.

3.3.4 Fuse The central fuse of the system is added to protect the battery pack from overcurrent conditions, either during charging or discharging. The fuse acts as the last resort current protection in situations where for example there is a short-circuit current, or the MCU or current sensor should fail for some reason. The fuse selected is a 250 A fast acting fuse. The battery pack can deliver up to 600 A and receive up to 300 A without being damaged according to the datasheet. The maximum continuous power that the system requires to deliver is 5 kW, which results in a maximum current of 104 A. The maximum peak power is limited by the current sensor, since the current sensor is only rated to measure currents up to 150 A. This is well below the 250 A rating of the fuse.

3.3.5 Main Control Board The main control board is responsible firstly to measure all the battery attributes and sec- ondly to regulate the battery output. The components used within the previous designed BMS that are also used within the full scale design include the MCU (TMS320F28035) and battery monitoring chip (BQ79640). The manufactured main control PCB is shown in Figure 3.7 and the schematic can be seen in Appendix C.1.1. Reusing as much as possible of the previous design reduced the development time since many of the firmware has already been developed. Similarly as the proof of concept BMS, the full scale BMS is centered around the BQ76940 battery monitoring chip from TI. Again the core functionality of the chip is Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 34

Figure 3.7: Main control BMS PCB to monitor the 15 cells connected in series as well as to provide the additional analogue protection circuitry. The BQ79640 is able to control the mechanical contactor using an AND gate and the cell voltage measurements. The current measurement is no longer performed by the BQ79640 which results that the BQ79640’s analogue SC and overcur- rent protection are lost. The BQ79640’s analogue protection is active for OV and UV conditions. Other changes that were implemented from the proof of concept BMS include the addition of communication interfaces that can be used to communicate the data and states of the battery to a driver interface. A different low power buck regulator is also used. These changes are discussed in the following subsections.

3.3.5.1 Bluetooth Communication The LMX9839 [30] Bluetooth module from TI is added to the design to provide the Bluetooth capability. This will typically be used for battery diagnostics and data logging. This module was chosen since it is a complete solution with a built-in antenna. This hardware design is included but not tested in this project. The software development of the Bluetooth interface is outside of the scope of this project and will be added at a later stage.

3.3.5.2 CAN Communication The SN65HVD234 [31] transceiver from TI is added to the design for its CAN functional- ity. The CAN protocol delivers a robust solution for communication between the various system components for example the BMS and the battery charger. It can however also be used for battery diagnostics and data logging. The SN65HVD234 transceiver acts as a buffer between the MCU and the CAN bus. The transceiver was chosen because it meets the requirements of the system. This hardware design was succesfully implemented within this project. The software development of the CAN interface is discussed in detail in Chapter 4. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 35

3.3.5.3 Powerline Communication/ USB Communication Originally, the PLC-stamp mini from I2SE was also added to the design for its power-line communication functionality. The PLC-stamp mini is a small breakout board. Unfortu- nately, it only became apparent at a later stage that using this technology is currently too expensive to implement. This will however change over time as the price of the tech- nology decreases. Therefore, it is kept in the design for development and testing at a later stage. The PCB layout is done in such a way that other breakout boards can also be used instead of the PLC-stamp mini. USB communication was added via Future Technology Devices International’s (FTDI) FT220 [32] breakout board which uses the same layout as that of the PLC-stamp mini. This is the primary interface used to send data from the BMS to a computer. USB com- munication is easy to set up on the computer’s side. A small Python listener application is used to read the incoming battery data into a database.

3.3.5.4 Low Power Buck Regulator A low power regulator is used to power the MCU as well as all of the different communi- cation interfaces. The supply voltage is required to be 3.3 V. The LM5017 buck regulator was used in the proof of concept design. Unfortunately, it has a very low feedback preci- sion which results in a voltage ripple higher than desired. It is for this reason that for the full scale BMS design, the TPS54060 [33] buck regulator from TI is chosen. The design is done using TI’s SwitcherPro software package. The voltage ripple of the regulator is shown in Figure 3.8. The voltage ripple has decreased to 10 mV. The lower ripple minimises the regulator’s influence on the voltage and current measurements. The switching frequency of the device is 143.7 kHz which confirms the design.

0.004 Ripple 0.002

0.000

0.002 − Voltage [V] 0.004 −

0.006 −

0.008 − 0.000015 0.000010 0.000005 0.000000 0.000005 0.000010 0.000015 − − − Time [s] Figure 3.8: TPS54060 voltage ripple Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 36

3.3.6 Balance Circuit Design The full scale BMS, similar to the proof of concept BMS, deploys passive cell balancing to maximise the battery capacity. In large scale systems the magnitude of the cell balancing current is large, thus a lot of heat is dissipated. The heat is substantially more than what can be dissipated on the BMS’s main control board. For this reason a small balance PCB is designed, one for each set of parallel connected cells, to distribute the heat across a large area during cell balancing. The circuit diagram of the PCB is shown in Figure 3.9 and the PCB schematic can be seen in Appendix C.1.2. The size of the balance current is typically chosen according to the cell capacity and tolerance. A minimum balancing current of 1 A was selected for this project, as was suggested by Julian Gerber, an engineer involved in the Joule EV project. He also consulted the University of Stellenbosch during this project. Balancing is activated by the battery monitoring chip that is situated on the main control board. The chip’s ADC pins are connected internally to enable a P-channel MOSFET (M1) externally, which enables cell balancing of that specific cell. A fuse (F1) is used to protect each cell connection from a short-circuit fault. A transient voltage suppressor (TVS) (Dt) and two diodes (D1 and D2) are used to protect the MOSFET from electrostatic discharge (ESD). It is also disconnects the output by blowing the fuse in case the PCB is connected to the cell the wrong way around. The resistor Rf is part of the BQ79640 hardware set-up and is used in combination with a capacitor, to act as a filter. The resistor Rg is used as a gate resistor to limit the inrush current which enables the balancing MOSFET. The resistor Rt is a 10 kΩ NTC thermistor and is selected as suggested by the BQ76940 datasheet. The thermistor is situated close to the battery terminal on the PCB. This ensures an accurate cell temperature measurement. The PCB is designed to bolt onto the terminals of a cell. It was decided to use a PCB trace as the balance resistor Rb. This saves on some of the cost of the system since no high power resistors need to be bought and it reduces the height of the balancing PCBs which was a constraint in the physical design of the battery pack. The required trace width for a specific current and temperature increase can be approximated [34] by I = 0.048 ∆T 0.44 A0.725, (3.3.1) · · where I = maximum current [A], ∆T = temperature rise [◦C] ,

F1 Rf

D1 + M1 + Rg Vcell Dt − D2 + R Rt b -

Figure 3.9: Balance circuit diagram Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 37

A = cross-sectional area [mil2]. The minimum balancing current was specified as 1 A. This results, with a temperature rise of 10◦C, in a PCB trace width of 0.3 mm. The total balance resistance is chosen as 2.5 Ω. The cells are typically balanced at a voltage of 3.6 V, limiting the balancing current to a maximum of 1.44 A. The internal resistance of the MOSFET is 0.14 Ω, which results in a required trace resistance of 2.36 Ω. The resistance of the trace can be calculated by

L R = ρ (1 + α (temperature 25◦C)), (3.3.2) · T W · · − · where

ρ = resistivity,

L = length,

W = trace width,

T = trace height,

α = temperature coefficient.

−3 −6 1 The values of ρcopper and αcopper are 3.9 10 Ω cm and 1.7 10 ◦C respectively. The length of the trace is calculated· as 1.4 m· with a trace· thickness of 35 µm. This results in a balancing current with a minimum value of 1 A and a maximum value 1.44 A. During practical testing the balancing current was measured to be 1.25 A. A manufactured balance PCB connected to a cell’s terminals is shown in Figure 3.10.

Figure 3.10: Balancing PCB connected to cell terminals

3.3.7 Current Sense PCB Design Accurate current measurements are required to successfully monitor the battery pack. This section details the design of the high current measurement board. The current measurement board is separated from the main control board for several reasons. The board is designed to measure a maximum steady state current of up to 120 A. A safety margin is added since only 104 A is required to provide an output power of 5 kW. To achieve such a high current rating the PCB trace width and trace thickness need to be maximised. Increasing the trace thickness increases the overall cost of the PCB dramatically. One of the manufacturing constraints is that a PCB typically only have one PCB trace Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 38

thickness unless it is a specialised PCB which is expensive. The current sensor is therefore split from the main control board to minimise the PCB area that requires extra thickness tracks. Splitting the design also reduces EMI on the main control board. The high motor controller switching current needs to be as far away from the main control board as possible to minimise the coupled noise. This noise will typically reduce measurement accuracy.

3.3.7.1 Current Sensor Selection There are two types of sensors that can be used to measure the current of the battery. The first is a shunt resistor, as was used in the proof of concept BMS design. The second is the use of a Hall effect-based current sensor. The shunt resistor method has some disadvantages when it comes to high currents. In extreme fault conditions the conductor connecting the battery and the shunt resistor can induce voltage spikes which can damage the measuring device. This is due to the δi change in battery current with respect to time ( δt ). The corresponding generated voltage δi is calculated by: V =L δt . All conductors have some equivalent series inductance (L) even though it is very small. This phenomenon decreases the overall robustness of this solution. Another drawback with using a shunt resistor, is the power dissipated within the resistor. It is important that adequate resistance is chosen. If the resistance is too large, too much power is dissipated which decreases the overall efficiency of the circuit. On the other hand if the resistance is too small, the accuracy of the measurement is decreased. The value of the shunt resistor is typically chosen extremely small to minimise the amount of power dissipated within the resistor. A shunt resistor with a small tolerance and temperature coefficient is usually quite expensive. An operational amplifier is used to amplify the shunt resistor’s voltage measurement in order to increase the resolution of the measurement. This also adds to the complexity of the system. A Hall effect current sensor is another option. It operates on the principle of using the magnetic field generated by the current to measure the size and direction of the current. The ACS758KCB-150B-PFF [35] sensor from Allegro is chosen for this design. The Hall effect sensor is much more suitable for high current applications and provides superior performance to that of the shunt resistor. The sensor chosen has a series resistance of 100 µΩ which is much smaller than that of a corresponding shunt resistor required for this application. The Hall effect sensor provides galvanic isolation which isolates the sensor’s output from voltage spikes and it allows high-side voltage current sensing. No additional amplification of the measurement is required and as such it provides the complete current measuring solution. The price of the Hall effect sensor also compares very well to that of a high quality shunt resistor.

3.3.7.2 Sensor Design A simplified diagram of the current sensing circuit is shown in Figure 3.11. The thicker lines represent high current paths. A low pass filter Rf and Cf , is shown at the output of the current sensor. This is used for noise filtering. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 39

PC out I out SSC 3.3 V D1

Rp R PC in S1

Current CS out sensor Rf Cf

I in Figure 3.11: Current sensor circuit diagram

A pre-charge resistor Rp is also added to the current sensor design. The battery is typically connected to loads that have some form of bus capacitance. Initially the mechanical contactor is connected in open-circuit to allow the bus capacitance to charge at a controlled rate in order to prevent high inrush currents that can harm the battery, the mechanical contactor or the load itself. A pre-charge resistor is used for this purpose. The mechanical contactor’s one terminal is connected to the output terminal (I out) of the current sense PCB. The pre-charge output (PC out) is connected to the mechanical contactor’s second terminal. A small solid state contactor (SSC) is used to control the output of the pre-charge circuit to the external bus capacitance. Once the voltage across the capacitors equal that of the battery potential, the main mechanical contactor is closed. The value of the pre-charge resistor Rp was chosen according to the motor controller’s datasheet information as 470 Ω. The SSC was chosen according to the pre-charge resistor’s value and the maximum voltage of the battery which is 54.75 V. A transient voltage suppressor (TVS) D1 is used to protect the SSC from electro static discharge (ESD) as well as from fault conditions where the voltage across the mechanical contactor could spike. The SSC is controlled by the MCU by means of a MOSFET S1 and resistor R. The PCB schematic can be seen in Appendix C.1.3. The manufactured current sense PCB is shown in Figure 3.12.

3.3.7.3 Thermal Design Accommodating a current of 120 A on a PCB is a challenge. For this design a two layer board was selected to minimise the cost of the PCB. The PCB layer thickness was chosen as 140 µm on each side. This is four times the thickness of the standard of 35 µm. The top and bottom layers are stitched together with via’s to ensure both layers are used effectively. This results in a combined layer thickness of 280 µm. The required trace width is calculated using (3.3.1) and (3.3.2). The trace width is calculated using the worst case scenario in mind: an ambient temperature of 40 ◦C, a current of 120 A and a Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 40

Figure 3.12: Current sensor temperature rise of 15 ◦C. The resulting trace width is 22 mm. The thermal results will be discussed in more detail in Chapter 6 as part of the results discussion.

3.4 Prototype Solid State Contactor

3.4.1 Introduction A SSC is designed, in this section, as a possible replacement for the mechanical contactor. Possible advantages a solid state contactor has over a mechanical contactor are a faster reaction time, less wear as well as being more energy efficient. The main focus of this design is on ensuring the SSC is more energy efficient than it’s mechanical counter part. It is for this reason that the design is centered around the specifications of the mechanical contactor. The basic operation of a mechanical contactor is therefore discussed in the following subsection. The rest of the subsections discuss the design of the SSC.

3.4.2 Mechanical Contactor The mechanical contactor shown in Figure 3.4 is used as a switch to connect or disconnect the battery from the load. In this subsection a mechanical contactor is investigated and is used to determine the different specifications required for a SSC. Mechanical contactors use an electrical current as input, to generate a magnetic field in the control coil. This magnetic field closes the mechanical contact. Typically, the magnetisation current is the most energy inefficient part of the mechanical contactor. In order for the contactor to remain closed, magnetisation current is required. Thus, as long as the contactor is closed, power is being dissipated. The mechanical contactor also dissipates power during use due to the contact resistance of the pole. This contact resistance typically increases with use due to the build-up of compounds on the contacts which is caused by arcs when the contactor disconnects. The mechanical contactor used in this project is the SW80B [36] from Albright In- ternational. It is a 100 A rated single pole, normally open contactor. The continuously rated coil (on-state) power dissipation is between 7 – 13 W according to the datasheet. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 41

The contactor was tested for the intended application under normal operating conditions to more accurately determine the coil’s power dissipation. A coil dissipation of 11 W was measured. This value stays constant while the contactor is closed, irrespective of the load power usage. The datasheet also specifies that the typical voltage drop per pole across new contacts at 100 A, is 40 mV (4 W). Interpolated for 104 A, this would result in a loss of 4.326 W. The total power dissipation in the mechanical contactor at a current of 104 A is thus 15.326 W. The SSC must thus dissipate less power in order to be more energy efficient.

3.4.3 Solid State Contactor Design When designing a SSC, all the solid state switching technologies need to be investigated. The most commonly used solutions currently include a MOSFET or an insulated-gate bipolar transistor (IGBT). For this project’s application, the contactor is used at high current and low voltage. This makes the use of a MOSFET an appropriate solution, since low voltage MOSFETs have very low on resistances. Thus, MOSFETs were chosen over other technologies such as IGBTs.

3.4.3.1 Design Overview MOSFETs can only control current in one direction because of its freewheeling diode. Therefore, an extra MOSFET is added to ensure current control in both directions. This results in two MOSFETs in series, connected back to back with a common source. The MOSFETs need to be powered by an isolated supply to ensure operation within noisy environments. The solid state contactor must thus be isolated from the control circuitry. Opticalcouplers are used to deliver isolated signals to the gate drivers of the MOSFETs. MOSFETs do add some difficulties in terms of robustness.

3.4.3.2 MOSFET Considerations It is critical that the SSC is robust and disconnects the battery from the load when desired under all circumstances. The worst case scenario is a short circuit condition across the battery terminals. If the SSC is unable to disconnect the battery from the load in the event of a short circuit condition, it could lead to the battery failing. A Li-ion battery failing, could lead to a fire or even an explosion. MOSFETs are susceptible to being damaged in the case of overvoltage or overcurrent conditions. In the worst case scenario, the Miller capacitance can also lead to the MOS- FET being operated within the linear region. This would cause the MOSFET to dissipate too much power, which in turn could lead to MOSFET’s failure. MOSFETs also need short circuit protection and thermal runaway protection to protect it from damage.

3.4.3.3 Detailed Design MOSFET: A simplified schematic of the SSC design is shown in Figure 3.13. The de- sign is based on ultra-low resistance MOSFETs. The MOSFETs used is the CSD19535KTT Power MOSFET from TI as is shown in Table 3.3. To further reduce the internal resis- tance of the SSC, four MOSFETs were connected in parallel, which reduced the overall Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 42

Table 3.3: CSD19535KTT Power MOSFET specifications

Parameter Rating VDS maximum voltage 100 V VGS maximum voltage 20 V ± RDS(on) 2.8 mΩ at 10 V ◦ ID maximum drain current 197 A at 25 C Qg maximum gate charge 98 nC at 10 V Junction-to-case thermal resistance 0.5 ◦C/W

resistance to 0.7 mΩ. This action was required to ensure the SSC is comparable to the mechanical contactor in terms of efficiency. Two sets of parallel MOSFETs are connected in series, back to back. This configuration minimises the required amount of DC-DC converters to one, which reduces the overall cost of the system. The two series sets allow the control of the battery current in both directions. This increases the overall resistance to 1.4 mΩ. A current of 104 A results in a power dissipation of 15.14 W, which is within the design specification. It is important to note that the power dissipated inside the coil of the mechanical contactor, when it is within its closed state, is responsible for the majority of the power being dissipated. This results in a very inefficient switch when only a small amount of power is being delivered to the load. The on-state power dissipation of the SSC on the other hand is very small. It is negligible compared to the series resistance power dissipation. This is confirmed in the results section. Even though at maximum continuous power the two contactor’s efficiencies are roughly equal, at low power usage the SSC’s efficiency declines quadratically with the load current.

Isolated Converter: The MOSFETs are controlled by MOSFET drivers which are powered by an isolated DC-DC converter. This isolates the MOSFETs from any voltage spikes on the high current carrying conductors. It also allows the SSC to be connected at the positive terminal as was the case with the mechanical contactor. The supply voltage of the MOSFET driver was chosen as 12 V. It is the midway voltage between the driver’s maximum voltage and the minimum on-voltage of the MOSFETs. The chosen DC-DC converter for this project is the MEU1S1212ZC [37] from Murata Power Solutions. Both the input and output voltages are rated to 12 V. The converter was chosen for its small size, cost and voltage rating.

Optical Isolator: The input signals to the SSC are also required to be isolated in order to isolate the control of the SSC from the main control board. This can easily be achieved by means of optocouplers. The 4N35 [38] from Fairchild is selected for this project. It delivers a good trade-off between performance and cost.

Transient Voltage Suppressors: One of the problems with MOSFETs are its sensi- tivity to overvoltage. It is for this reason that transient voltage suppressors (TVS) are Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 43

INPUT 2 3.3 V ISO High Current output

D2 12 V ISO R4 C2 R6 R R 3 11 IN2 CS Mosfet RG5 RG6 RG7 RG8 R5 driver 2 GND-ISO Ilim OUT2 R7 12 V 12 V ISO D3 Supply GND-ISO GND-ISO D5 D4

R10 Ilim OUT1 R Mosfet 8 GND-ISO R R R R IN1 driver 1 CS G1 G2 G3 G4 R12 R1 R9 R2 C1 D1 12 V ISO

INPUT 1 3.3 V ISO High Current input Figure 3.13: Solid state contactor circuit diagram added to the design. When a large current is disconnected by the SSC, the inductance within the conductors causes a voltage spike on the SSC terminals. The TVS clamps the voltage at a set value. The TVS chosen for this project is the 5KP54CA-TP [39] from Micro Commercial Co. It can dissipate peak power pulses of up 5 kW at a maxi- mum clamping voltage 87.1 V. The peak pulse current is 57 A. Three of these TVS are connected in parallel to accommodate the worst case battery current scenario of 120 A.

MOSFET Driver: Each set of parallel MOSFETs are controlled by a MOSFET driver. The UCD7100 [40] from TI is selected for this purpose. Another MOSFET driver that was investigated is the TD352 from ST. The UCD7100 was chosen for its high sink and source current of 4 A. A large current is demanded in order to switch all of the parallel connected MOSFETs on at the same time. Another functionality that is crucial for this application is the current limit protection. With this functionality, the driver can turn off the power stage in the unlikely event that the digital system cannot respond to a failure situation in time. The UCD7100 has two inputs to achieve this: a current sense (CS) pin and a current limit (Ilim) pin. According to the datasheet these two inputs are compared and when the CS voltage level is greater than that of the ILIM voltage minus 25 mV, the output of the driver is forced low. A reference voltage can be given to the Ilim pin to change the overcurrent threshold voltage of the MOSFET driver. This current sense functionality is used to solve two possible problems: thermal run- away and short circuit conditions. The idea is to sense the voltage across the set of MOSFETs while they are switched on. The voltage across a MOSFET can only increase due to one of two reasons. Either the current increased through the MOSFET, or the MOSFET’s internal resistance increased due to a temperature rise. A dead-time circuit Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 44 is designed to delay voltage feedback from the CS pin as shown in Figure 3.14. This ensures that the current limit protection is not activated during the time period required for the MOSFETs to switch on.

OUT

R2 D1 CS

R1 C1 RDS(ON)

Figure 3.14: Dead time design

In Figure 3.14, OUT is the power output of the MOSFET driver, CS is the current sense pin of the driver and RDS(ON) is the internal resistance when the MOSFET is turned on. Before the MOSFET is switched on the diode D1 is typically reverse biased because of the high voltage across the SSC terminals. The diode is only forward biased when the MOSFET is switched on. Resistor R2 is used to limit the current flowing through D1 during operation. Resistor R1 and capacitor C1 are added to introduce dead-time dead-time to the CS pin. This allows some time delay for the MOSFETs to switch on before normal operation of the UCD700 continues. The derivation of the dead-time’s mathematical equation are done within the fre- quency domain. The assumption is made that the diode is reversed biased. A step input at the OUT pin of the drive results in a voltage

1 !  C1R2 VOUT VCS = , (3.4.1) s + R1+R2 s C1R1R2 at the CS pin. Calculating the inverse Laplace transform of (3.4.1) yields the time domain response   R1  − R1+R2 t VCS = 1 e C1R1R2 VOUT . (3.4.2) R1 + R2 − at the CS pin. A dead-time below 1 µs is chosen. This minimises the risk of the SSC failing. The increase in current, within the dead-time delay, is limited by the inductance of the con- ductors. A check is required to ensure the MOSFETs turn on before the dead-time has passed. The MOSFET’s input gate pin is approximated by their total gate capacitance. The gate Qg capacitance can be estimated by Cg = as 9.8 nF. The gate resistor, through which the Vg MOSFETs are controlled, is chosen as 15 Ω. This yields a simple RC circuit. The time domain function of the input gate pin can be approximated by

−t Vgate = VOUT (1 e RC ). (3.4.3) − Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 45

According to the datasheet, the MOSFET is said to be fully switched on when Vgate = 8 V . The switch time for the gate voltage to reach 8 V, is 161.5 ns. Adding the MOSFET’s turn-on delay of 33 ns yields a total time delay of 194.5 ns. This results in a large safety factor between the time required for the MOSFETs to be fully switched on and before the dead-time has passed. Once the MOSFETs are switched on, the voltage present at the CS pin is the forward bias voltage of the diode plus the voltage across the MOSFET. In order to enable better control of the output current of the gate driver, only the voltage across the MOSFET’s drain and source terminals are required. This voltage is typically very small. The problem is that the diode voltage differs with current and temperature. It is for this reason that a similar diode, D4, is placed in series with the reference resistors to set the current limit. When similar magnitude currents flows through both diodes, the two voltages cancel out. The manufactured SSC is shown in Figure 3.15.

3.4.3.4 Thermal Design Ensuring that the SSC operate at the optimal temperature is crucial to making it more robust. The thermal design of the SSC is discussed in the following section.

Power dissipation: The thermal design is conducted for a battery current of 120 A. This adds an extra safety factor since the maximum continuous rated current is 104 A. There are four MOSFETs in parallel and the assumption is made that the current are divided equally between them. This results in a current of 30 A per 2.8 mΩ MOSFET. The maximum power dissipated per MOSFET is 2.52 W. The switching losses are ignored, since the SSC is not design for high frequency switching.

Design: The maximum ambient temperature is selected as 40◦C. The maximum junc- tion temperature is chosen not to exceed 70◦C which results in a temperature rise of

Figure 3.15: Manufactured solid state contactor Stellenbosch University https://scholar.sun.ac.za

CHAPTER 3. HARDWARE DESIGN 46

30◦C. Therefore, the overall thermal resistance per MOSFET required for this design is 11.9◦C/W. The MOSFET junction-to-case thermal resistance is 0.5◦C/W. The 7109DG from AAVID Thermalloy is a surface mount heat-sink with a thermal resistance of 11◦C/W. It is chosen for this project for its small footprint. This results in a overall thermal resistance of 11.5◦C/W, which is within the required specifications. A heat-sink is connected to every MOSFET on the PCB to dissipated the heat. The thermal results will be discussed in more detail in Chapter 6 as part of the results discussion.

3.5 Conclusion

In this chapter a proof of concept BMS was designed. The required design changes to the proof of concept BMS were also implemented in order to scale the BMS for the application of a micro EV. This included splitting the designed circuitry into three parts, a main control circuit, balancing circuits and a current sensor circuit. This approach delivered an adequate BMS in terms of cost and performance. A proof of concept design of a SSC was also investigated, which could possibly replace the mechanical contactor in future iterations of the BMS. Stellenbosch University https://scholar.sun.ac.za

Chapter 4

Software Design

4.1 Introduction

The BMS is digitally controlled by means of a MCU. This ensures that the system is flexible and that it can be used with a wide range of different battery technologies without making hardware adjustments to the control circuitry. Only software changes have to be implemented in order for the BMS to comply with different battery cells. The software design of the BMS is discussed within this chapter.

4.2 Overview

An overview of the software design is discussed in this section. The MCU used for this project is the Piccolo TMS320F28035. The IDE used to program the MCU is Code Com- poser Studio from TI. The MCU is required to interact with a variety of components for the BMS to function properly. The MCU controls the battery monitoring chip with the Inter-Integrated Circuit (I2C) communications protocol. Battery data is communicated via Serial Peripheral Interface (SPI) to a Universal Serial Bus (USB) breakout board which communicates with a computer. The battery data can also be requested via the CAN communication protocol. The CAN interrupts are used to respond to a measure- ment request. The analogue battery current is measured with an analogue-to-digital converter (ADC). Other peripherals used include Central Processing Unit (CPU) timers to gauge the time between samples taken. The software design can be split into multiple sections and contains a main loop with an additional set of interrupts. The layout of the design is described in detail below.

1. The main loop is used to measure the cell voltages and battery temperature using the BQ79640 chip and thus forms the basis of the design. It sends the battery measurements via USB to a computer. Battery balancing is also performed within the main loop.

2. A current sensing loop is used to convert the current sensor’s analogue value into a digital representation using the MCU’s ADC. The conversion triggers an ADC interrupt after which the current sensing loop is executed.

47 Stellenbosch University https://scholar.sun.ac.za

CHAPTER 4. SOFTWARE DESIGN 48

3. A master control loop, which is situated within a CPU timer interrupt, is used to control the logic of the battery. The logic is controlled via flags that are set within the main loop and current sensing loop. These flags convey the status of the battery at that specific time.

The design of the different software loops are discussed in the following sections.

4.3 Main loop

A simplified flow diagram of the main loop is shown in Figure 4.1. The flow diagram is shown to have an initialisation phase. Within this phase all the different peripher- als are set up. It includes the set-up of the ADC, CPU timers, SPI, I2C and CAN. The BQ79640’s analogue protection and initialisation are also programmed within this initialisation phase.

Start

Initialise: BQ79640 CPU Timers I2C SPI ADC CAN

F Timer0 interrupt

T

Read BQ79640 measurements

F CRC match

T

Compare to F Set flags constraints Open contactor T

Balance cells

Send data to USB

Figure 4.1: Main flow diagram

An if statement in combination with the CPU timer 0 is used to execute the main loop only once every second. Within this loop the battery measurements are read via the I2C communication protocol from the BQ79640. These measurements include the cell voltage measurements and the battery temperature measurements. The data received is put through a cyclic redundancy check (CRC) method to ensure the validity of the data. This ensures a more robust system in a typically noisy environment. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 4. SOFTWARE DESIGN 49

The measurements taken are then compared to the operating specifications as given by the manufacturer. When the battery is operated outside of the specified operating range, the appropriate error status flags are set. The contactor is also opened in the case of a fault condition. Once the measurements are taken, the balancing method is called to balance the battery pack. The balancing function is only executed if the status flags indicate balancing is required. All the battery measurements are sent to the computer by the USB FT220 breakout board. On the computer’s side, a python script is used to process the data and store it in a database. This script is shown in appendix B.1.

4.4 Battery Balancing

The balancing algorithm is shown in Figure 4.2 and is located in the balancing function within the main loop. The operation of the function can be described as follows: the battery is charged with the traditional constant current - constant voltage (CC-CV) method. As soon as one of the measured cell voltage is higher than 3.65 V, charging is stopped and balancing is started. All cells with a measured voltage of higher than 3.45 V is balanced through the balancing circuitry. Balancing is terminated for a particular cell once the cell’s voltage drops below 3.45 V. The cell balancing action is thus terminated once all the cell voltages are below the reference voltage. This algorithm was suggested by James Verster, whom is the CEO of BlueNova, a local energy storage company. This is not the general balancing algorithm used for Li-ion cells. Typically, cells are balanced during charging. The reasons for not using the general algorithm are the application of the battery and the battery chemistry used in this project. The application of the battery allows the battery to be charged and balanced during nights when it it not used. The battery chemistry exhibits extreme non-linear behaviour at a high and low SOC. This results in a large cell voltage difference between cells that have a small SOC difference, when the battery pack is nearly fully charged. In most cases this results in the battery not being charging in the CV mode for long enough periods of time in order for the charging current to decrease significantly. This results in the balancing current being negligibly small compared to the charging current. Therefore, balancing is only activated once charging has stopped. Another characteristic of the LFP cells is that their cell voltage do not stay constant at the charging voltage after being fully charged, instead the cell voltages settle at approximately 3.4 V. This characteristic is combined within the balancing algorithm as a threshold voltage where balancing is terminated. The battery pack is balanced using the BQ76940 battery monitoring chip. One of the constraints of the chip is that adjacent cells cannot be balanced simultaneously. Balancing adjacent cells simultaneously can possibly damage the integrated circuit. The balancing algorithm is therefore adjusted to ensure that this does not happen. The even numbered cells are balanced inversely with the uneven numbered cells. This ensures that adjacent cells cannot be balanced simultaneously. Each set of cells are balanced for a time duration of 5 seconds. This minimises the amount of balancing commands sent from the MCU to the BQ76940 chip. This algorithm does have a negative impact on the time required for cell balancing, since adjacent cells requiring balancing causes the average balancing Stellenbosch University https://scholar.sun.ac.za

CHAPTER 4. SOFTWARE DESIGN 50 current to be half of the maximum balancing current. The battery monitoring chip also impacts the average balancing current of the cells. The total duty cycle devoted to cell balancing is approximately 70% of the 250 ms period. This is due to a portion of the 250 ms time duration is allocated to perform normal cell voltage measurements using the BQ76940’s ADC. This ensures that the cell balancing does not affect the voltage measurements. It also ensures that the OV and UV protections do not accidentally trigger, or that OV and UV conditions go undetected while cell balancing is enabled.

Enter function

Initialize variables

Balance T status

F Counter==0 T

F Reset balancing

Balance uneven cells above ref

Counter==period T

F Reset balancing

Balance even cells above ref

Count ++

Counter > T 2 x period

F All cells T below ref F Stop balancing

Stop Reset flag balancing and counter

Exit function

Figure 4.2: Cell balancing flow diagram Stellenbosch University https://scholar.sun.ac.za

CHAPTER 4. SOFTWARE DESIGN 51

4.5 Current sense loop

The current sensing flow diagram is shown in Figure 4.3. It shows the ADC interrupt which is triggered by Timer1 on the MCU. This interrupt has the highest priority to ensure it is not interrupted while a fault condition exists. The mechanical contactor allows for a slower reaction time. The sampling rate is therefore chosen as 2 kHz, since this will ensure the MCU reacts fast enough to a fault condition.

Enter ADC Interrupt

Read: ADC value

Convert ADC value

F Compare to constraints Set flag T Open contactor First order digital filter

Acknowledge interrupt

Exit ADC Interrupt

Figure 4.3: Current sensing flow diagram

Once the interrupt is received, the ADC value is converted from a measured voltage to a corresponding digital current value. The output of the battery is disconnected from the load by means of the mechanical contactor if the current measurement is outside of the manufacturer’s specified operating range. A flag is also set to notify the master control loop of the status of the battery. The current measurement is passed through a first order digital filter in order to filter all the excess noise. The interrupt is acknowledged to enable the ADC interrupt to read in new values.

4.6 Master control loop

The master control loop monitors the battery flags in order to determine the battery’s mode. The battery output is controlled accordingly. The flags are for current, temper- ature, charged and discharged indications. The current flag is set in the current sensing loop if the battery current falls outside of the specified current boundaries. The temper- ature flag is set within the main loop if the measured battery temperature falls outside of the specified operating range. The charged flag is set when the battery is fully charged, Stellenbosch University https://scholar.sun.ac.za

CHAPTER 4. SOFTWARE DESIGN 52 when one of the cell voltages is higher than the maximum allowed voltage during charg- ing. The discharged flag is set when the battery is fully discharged, when one of the cell voltages is lower than the minimum allowed voltage during discharging. The master control loop, as shown in Figure 4.4, is executed within the CPU’s Timer1 interrupt. This interrupt has a frequency of 100 Hz. This allows the routine to quickly respond to the different external and internal inputs and interrupts. There are three main modes that the battery can be in. In the normal mode all the flags are null and the charger is not connected. In combination with all these flags the BMS has some external inputs from the motor drive unit and the driver. These inputs are used to signal the BMS when to close the mechanical contactor if needed. One of the external inputs is the vehicle’s key switch used to signal the motor drive unit to start up and standby until the throttle is active. The key switch is also used to reset the current flag after a fault condition.

Timer1 Interrupt

Charger==0 T f_Discharge==0

F

Keyswitch==0 T

F

Keydrive==0 T

Open F contactor f_Current==0 T f_Temperature==0

Set Open F Close f_Current==0 contactor contactor

Charger==1 T f_Charge==1

F

Charger==1 T

F

f_Temperature==0 T

Open F Close contactor contactor

Acknowledge interrupt

End Interrupt

Figure 4.4: Master flow diagram Stellenbosch University https://scholar.sun.ac.za

CHAPTER 4. SOFTWARE DESIGN 53

The second mode the BMS can enter is the charged mode. This is when the charge flag is high and the battery is still connected to the charger. The charge flag is set when one of the cell voltages is higher than the maximum allowed voltage during charging. This results in the contactor opening to stop charging. Typically, this is when balancing starts. The charged flag is reset to null when all the cell voltages decreases below a specific reference level. The third mode is the charging mode. The BMS enters this mode during battery charging. More specifically, the mode is entered when the charger is connected and the charge flag is null. The mechanical contactor is closed in order for the battery to charge.

4.7 Conclusion

In this chapter, the software layout of the BMS was discussed. This included the various software design choices made. Flow diagrams were used to explain the flow of the software. The main loop is used to monitor the cell voltages and battery temperature and is also used for battery balancing. The current sensing loop is used for current measurements. Flags are used to notify the master control loop which then controls the SOC and current of the battery. Stellenbosch University https://scholar.sun.ac.za

Chapter 5

On-line Parameter Estimation

5.1 Introduction

This chapter investigates the on-line parameter estimation of an equivalent circuit model (ECM) of a battery. An ECM proves a good trade-off between model accuracy and model complexity. Unfortunately, the battery parameters tend to change over time as the health of the battery deteriorates (irreversible physical and chemical degradation). This makes the on-line parameter estimation a more realistic approach to energy management. A wide range of methods exist to accomplish on-line parameter estimation. Typically, a set of current and voltage measurements are used as the input and output of a system respectively. By minimizing the the error between the measured output and estimated output, the parameters of the battery can be estimated with reasonable accuracy. In [41] the recursive least squares (RLS) algorithm is used to estimate the battery parameters. The RLS algorithm is easy to implement on-line and is computationally efficient. It is therefore chosen to determine the parameters of the ECMs. The following chapter include the mathematical derivations of the single polarisation (SP)- and dual polarization (DP) Thévenin ECMs such that the RLS algorithm can be applied to the models. A simulation, in combination with the RLS algorithm, is used to prove the derived mathematics.

5.2 Battery model

5.2.1 Introduction In order to use the RLS algorithm to estimate the parameters of an ECM, the mathematics describing the model is required to be written in the correct form. The SP Thévenin model is evaluated first as it is the most common ECM. This model is then later in the chapter extended to the DP Thévenin model which characterises the battery more accurately. The derivation of the models to the suitable RLS algorithm format is shown in the following subsections.

54 Stellenbosch University https://scholar.sun.ac.za

CHAPTER 5. ON-LINE PARAMETER ESTIMATION 55

5.2.2 Single Polarisation Thévenin equivalent circuit model The most commonly used ECM is the SP Thévenin model as shown in Figure 5.1. The Open Circuit (OC) voltage, VOC , is the equilibrium potential of the battery. For the purpose of this thesis the OC voltage is assumed a function of the SOC of the battery. Also, the temperature is assumed to be constant. Thus, when the SOC decreases so will the OC voltage. Typically this relationship is non-linear and will be determined off-line. The internal resistances include the ohmic resistance Rs and the polarization resistance Rt1. The equivalent capacitance Ct1 is used to describe the transient response.

Rt1 Rs + Vt1 − +

+ Ct1 VOC V (t) − I(t) −

Figure 5.1: Single polarisation (SP) Thévenin model

The mathematical model is derived as

V (t) = VOC RsI(t) Vt1(t), (5.2.1) − − dVt1(t) Vt1(t) = Rt1I(t) Rt1Ct1 . (5.2.2) − dt

The assumption is made that the open circuit voltage (VOC ) remains constant over one sampling period [42]. By differentiating (5.2.1) with respect to time, a third equation is established. Solving these equations simultaneously, Vt1(t) can be eliminated in (5.2.1). dI(t) dV (t) The output V (t) is expressed in terms of I(t), dt and dt as shown in (5.2.3). dI(t) dV (t) V (t) = VOC [Rs + Rt1]I(t) RsRt1Ct1 Rt1Ct1 (5.2.3) − − dt − dt This gives the same result as that in [43]. In the next section the more complex DP Thévenin ECM is derived.

5.2.3 DP Thévenin equivalent circuit model The DP Thévenin model is shown in Figure 5.2. This model adds an additional RC pair to more accurately match the dynamic behaviour of the battery voltage. The re- sistor Rt1 characterises the effective resistance of the electrochemical polarisation and Rt2 characterises the effective resistance of the concentration polarisation of the battery. The capacitor Ct1 represents the electrochemical polarisation, whilst Ct2 represents the Stellenbosch University https://scholar.sun.ac.za

CHAPTER 5. ON-LINE PARAMETER ESTIMATION 56

Rt1 Rt2 Rs + Vt1 + Vt2 − − +

+ Ct1 Ct2 VOC V (t) − I(t) −

Figure 5.2: Dual polarisation (DP) Thévenin model concentration polarisation, which is used to characterise the transient response of the bat- tery. According to [14], the DP Thévenin model presents the best dynamic performance and offers a more accurate SOC estimation compared to other ECMs. In [44], a similar derivation was performed for the DP model, by transforming the state space model of the battery to the frequency domain. The derivation presented here is however much simpler, since all the equations are derived within the time domain, as shown below:

V (t) = VOC RsI(t) Vt1(t) Vt2(t) (5.2.4) − − − dV (t) dI(t) dVt1(t) dVt2(t) = Rs (5.2.5) dt − dt − dt − dt 2 2 2 2 d V (t) d I(t) d Vt1(t) d Vt2(t) = Rs (5.2.6) dt2 − dt2 − dt2 − dt2 Vt1(t) dVt1(t) I(t) = + Ct1 (5.2.7) Rt1 dt 2 dI(t) 1 dVt1(t) d Vt1(t) = + Ct1 2 (5.2.8) dt Rt1 dt dt Vt2(t) dVt2(t) I(t) = + Ct2 (5.2.9) Rt2 dt 2 dI(t) 1 dVt2(t) d Vt2(t) = + Ct2 2 (5.2.10) dt Rt2 dt dt

Again the assumption is made that the open circuit voltage, VOC , will remain constant over one sampling period. Equations (5.2.4) through (5.2.10) can be solved simultaneously using a MATLAB solver function, as shown in Appendix B.2, to find V (t) in terms of VOC and the other ECM parameters such that

V (t) = VOC (Rs + Rt1 + Rt2)I(t) − dI(t) (Rs(Ct1Rt1 + Ct2Rt2) + Rt1Rt2(Ct1 + Ct2)) − dt dI2(t) dV (t) Ct1Ct2Rt1Rt2Rs (Ct1Rt1 + Ct2Rt2) − dt2 − dt dV 2(t) Ct1Ct2Rt1Rt2 . (5.2.11) − dt2 Stellenbosch University https://scholar.sun.ac.za

CHAPTER 5. ON-LINE PARAMETER ESTIMATION 57

In order to further simplify the above equation let Ct1Rt1=τt1 and Ct2Rt2=τt2 where τt1 and τt2 are the time constants of the two RC pairs of the model, resulting in the simplified equation

V (t) = VOC (Rs + Rt1 + Rt2)I(t) − dI(t) (Rs(τt1 + τt2) + Rt2τt1 + Rt1τt2) − dt dI2(t) dV (t) dV 2(t) Rsτt1τt2 (τt1 + τt2) τt1τt2 . (5.2.12) − dt2 − dt − dt2 5.3 Recursive Least Squares Algorithm

5.3.1 Introduction The following section discusses the rewriting of the derived ECM mathematics into the form required by the RLS algorithm. The RLS algorithm is divided into 8 steps to simplify the implementation thereof.

5.3.2 Recursive structure The DP Thévenin ECM mathematics need to be rewritten into the required format for the RLS algorithm in order to simplify the calculations. This is achieved by setting

V (t) = φT (t)θ, (5.3.1) where the input vector is h i φT dI(t) d2I(t) dV (t) d2V (t) (5.3.2) (t) = 1 I(t) dt dt2 dt dt2 , and the parameters that needs to be estimated using the RLS algorithm is

 T θ = θ1 θ2 θ3 θ4 θ5 θ6   VOC  (Rs + Rt1 + Rt2)   −   (Rs(τt1 + τt2) + Rt2τt1 + Rt1τt2) = −  . (5.3.3)  Rsτt1τt2   −   (τt1 + τt2)  − τt1τt2 − In the case of an on-line application, the output V (t) and the input I(t) are discretised at a constant sampling period T . Therefore, (5.3.1) requires to be converted into the discrete form such that V [k] = φT [k]θ. (5.3.4) Within (5.3.2), I(t) and V (t) are discretised as I[k] and V [k] and represents the current and voltage measured at a constant sample period T . The other variables can be Stellenbosch University https://scholar.sun.ac.za

CHAPTER 5. ON-LINE PARAMETER ESTIMATION 58

approximated by:

dI(t) I[k] I[k 1] − − , (5.3.5) dt ≈ T d2I(t) I[k] 2I[k 1] + I[k 2] − − − , (5.3.6) dt2 ≈ T 2 dV (t) V [k] V [k 1] − − , (5.3.7) dt ≈ T d2V (t) V [k] 2V [k 1] + V [k 2] − − − . (5.3.8) dt2 ≈ T 2 Once the vector θ is identified by the RLS algorithm, the parameters of the battery can then be derived from (5.3.3) as follows:

VOC = θ1, (5.3.9)

θ4 Rs = , (5.3.10) θ6 p 2 θ5 (θ5 + 4θ6) τt1 = − , (5.3.11) − 2 p 2 θ5 + (θ5 + 4θ6) τt2 = , (5.3.12) − 2 1 2 2 Rt1 = 2 − 2 [2θ4θ6 + 2θ2θ6 + θ3θ5θ6 + θ2θ5θ6 (5.3.13) θ5θ6 + 4θ6 + τt2(2θ3θ6 θ4θ5 + θ2θ5θ6)], − 1 2 2 Rt2 = 2 − 2 [2θ4θ6 + 2θ2θ6 θ3θ5θ6 + θ4θ5 (5.3.14) θ5θ6 + 4θ6 − τt2(2θ3θ6 θ4θ5 + θ2θ5θ6)]. − − 5.3.3 Recursive identification algorithm As stated the RLS algorithm can be divided into 8 steps. By repeating these steps each time a new set of input and output data is measured, the RLS algorithm minimizes the estimated error. The algorithm should be initialised with the initial estimate of θ0 = 0 6 and P0 = (10 )I, where θ0 is the initial estimation, P0 is the initial covariance matrix and I is an identity matrix. This will place the emphasis on the incoming data instead of on the input vector θ0. In the 8 steps described below, K[k] is the recursive gain and P[k] is the covariance matrix, while λ is the forgetting factor (FF) of the RLS algorithm. The steps are as follow:

1. Initialise parameters θ0 and P0. 2. Collect the input data I[k], I[k 1]), I[k 2] and the output data V [k], V [k 1], V [k 2]. − − − − 3. Calculate φT [k]. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 5. ON-LINE PARAMETER ESTIMATION 59

4. Calculate the recursive gain matrix

P[k 1]φ[k] K[k] = − . (5.3.15) λ + φT [k]P[k 1]φ[k] − 5. Calculate the system output prediction

Vˆ [k] = φT [k]θˆ[k 1]. (5.3.16) − 6. Calculate the error between the measured output and the predicted output with the previous estimated parameter vector values

E[k] = V [k] Vˆ [k]. (5.3.17) − 7. Calculate a new updated estimate of the system parameter vector

θˆ[k] = θˆ[k 1] + E[k]K[k]. (5.3.18) − 8. Calculate covariance matrix P[k 1] K[k]φ[k]P[k 1] P[k] = − − − . (5.3.19) λ

The battery parameters tend to change over time. Therefore, the dependence of the parameters on temperature, SOC and battery degradation is managed via the forgetting factor as in (5.3.19). A small FF places more emphasis on new incoming data, while a large FF places greater emphasis on older data. Typically the FF is chosen between 0.95 and 1. If the value chosen for the FF is too small, the system will become unstable. Similarly, if λ = 1, the FF will not work at all, since older measurements are weighed the same as new measurements.

5.4 Simulation and results

5.4.1 Introduction In this section the suggested DP Thévenin ECM mathematics are proven using a simu- lation. The simulation can be split in two parts:

1. The ECM is simulated in Simulink to provide input (current) and output (voltage) data.

2. This data is then used, in an on-line manner by the RLS algorithm in order to estimate the parameters of the battery.

By comparing the parameters used inside the Simulink simulation with the estimated parameters a conclusion can be drawn on whether the mathematical analysis is correct. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 5. ON-LINE PARAMETER ESTIMATION 60

5.4.2 Simulation The Simulink simulation is discussed within this section. A block diagram of the Simulink simulation is shown in Figure 5.3. The current is integrated to monitor the SOC of the battery during discharge. A gain factor is used to scale this value to a percentage of the total battery capacity. This value is subtracted from the initial SOC in order to calculate the remaining SOC of the battery. This SOC value is then fed into a polynomial function, which describes the relationship between the SOC and OC voltage, in order to supply a reference OC voltage output to the voltage source. This results in a voltage, VOC (SOC), which is a voltage source controlled by a polynomial that describes the relationship be- tween the SOC and the OC voltage. The polynomial of the Shell Eco-marathon (SEM) battery pack is used in this simulation. The relationship was determined by [16] and will be discussed in more detail in Chapter 6. The sampling period T is chosen as 1 s.

R R R Gain s t1 t2 current + + V + V t1 − t2 − Rload Integrator Ct1 Ct2

Vbat In Noise + − SOC V (SOC) + polynomial OC − PWM Sideal

Initial - SOC Ibat

Figure 5.3: Simulink simulation

The battery model parameters that were used is shown in Table 5.1.

Table 5.1: Simulink model parameters

Parameter Value Rs 1 Ω Rt1 0.5 Ω Rt2 0.5 Ω Ct1 100 F Ct2 20 F

The current profile at which the simulated battery model is discharged, is shown in Figure 5.4. The simulated battery is discharged from 95% to 15%. This ensures that the non-linear relationship between the OC voltage and the SOC would be present in the output of the simulation. The current profile comprises of the sum of two components: Stellenbosch University https://scholar.sun.ac.za

CHAPTER 5. ON-LINE PARAMETER ESTIMATION 61

Total battery I Resistor I 4 t [A] 2 Curren

0

0 100 200 300 400 500 600 700 Time [s]

Figure 5.4: Battery discharge profile

1. A discharge pulse through a resistor. The pulse has a period of 720 seconds and a duty cycle of 0.45.

2. A varying current to excite the dynamic behaviour of the battery. This varying current is added to the simulation by using a current source that is driven by noise.

In Figure 5.4 the resistor current is shown in red and the total battery current is shown in blue. The varying current is added to provide the system with some excitation during periods when almost no dynamic behaviour is detected such as during constant current periods. According to [45], poor excitation can lead to the exponential growth of the covariance matrix (or covariance wind-up). This results in the estimator becoming extremely sensitive and susceptible to numerical and computational errors.

5.4.3 Simulation results The simulated measured output voltage (blue) and the estimated voltage (red) is present in Figure 5.5. The error between the output voltage and estimated voltage, as a percent- age, can be seen in Figure 5.6. It is clear that the RLS algorithm effectively minimises the error between output voltage and estimated voltage. The maximum error between the voltage and estimated voltage is smaller than 1 %. This proves that the RLS algorithm was implemented successfully. The estimated ECM parameters for the battery is shown in Figure 5.7. In each sub figure, the RLS algorithm’s estimation is indicated in red, while the Simulink simulation parameter value is indicated in blue. The estimated parameters compare closely with the actual simulated parameters when the OC voltage is a constant value as shown in Figure 5.7a through 5.7f. The parameters are unstable when the OC voltage of the battery changes too quickly. This is due to the RLS algorithm presented here inherently assume a model with a con- stant OC voltage. According to [17] the estimation response of the OC voltage is slow Stellenbosch University https://scholar.sun.ac.za

CHAPTER 5. ON-LINE PARAMETER ESTIMATION 62

55

50 oltage [V] V

45 V RLS estimated V

0 100 200 300 400 500 600 700 Time [s]

Figure 5.5: Estimated Voltage

1

error [%] 0

Estimation 1 −

0 1,000 2,000 3,000 4,000 5,000 Time [s]

Figure 5.6: Voltage estimation error compared to that of the typical drive-cycle excitation dynamics. Typically, the RLS algo- rithm is combined with a current integration method since the two methods complement each other. The purpose of the simulation was firstly to prove the mathematical model was correctly derived and secondly to test the implementation of the RLS algorithm. The sampling period was also shown to have a significant impact on the accuracy of the estimation. There is a trade-off between the sampling time and the maximum value of the time constants of the ECM that can be estimated. The larger the sampling time, the larger the time constants that can be estimated. This is due to the fact that the estimation rests on only three voltage and current measurements at a time. For instance, when the time constants of the model are very long and the sampling time is short, the differences in the output are too small to measure. Under these circumstances the RLS algorithm cannot perform the estimation accurately. Increasing the sampling Stellenbosch University https://scholar.sun.ac.za

CHAPTER 5. ON-LINE PARAMETER ESTIMATION 63

55 1.2 VOC RLS estimated Rs RLS estimated VOC 1.1 Rs

53 1 [V] [Ω] C s 0.9 O R V 51 0.8

0.7

49 0.6 0 1,000 2,000 3,000 4,000 5,000 0 1,000 2,000 3,000 4,000 5,000 Time [s] Time [s]

(a) VOC estimation (b) Rs estimation

80 1

60 0.75 [s] [Ω] t 1 t 1 0.5 τ 40 R

20 0.25 RLS estimated τt1 RLS estimated Rt1 τt1 Rt1 0 0 0 1,000 2,000 3,000 4,000 5,000 0 1,000 2,000 3,000 4,000 5,000 Time [s] Time [s]

(c) τt1 estimation (d) Rt1 estimation

10 0.7

0.6 8 0.5

6 0.4 [Ω] [s] t 2 t 2 τ 4 R 0.3 0.2 2 RLS estimated R RLS estimated τt2 0.1 t2 τt2 Rt2 0 0 0 1,000 2,000 3,000 4,000 5,000 0 1,000 2,000 3,000 4,000 5,000 Time [s] Time [s]

(e) τt2 estimation (f) Rt2 estimation Figure 5.7: Estimates of the RLS algorithm compared to the actual parameters Stellenbosch University https://scholar.sun.ac.za

CHAPTER 5. ON-LINE PARAMETER ESTIMATION 64 time too much on the other hand, impacts the assumption that the open circuit voltage, VOC , remains constant over one sampling period. The RLS method’s accuracy is also reduced by selecting a large sampling time. In practice, it is therefore important that the optimum sampling time is used. The optimal sampling time varies from one cell chemistry to another, but typically a sampling time of 1 - 2 seconds are used. It is clear that the characteristics of the battery influence the accuracy that the practi- cal system requires in order to successfully implement the RLS algorithm. The simulation was adjusted to investigate the accuracy required by a practical system, to accurately estimate the battery parameters using the RLS algorithm. This was achieved by adding a quantisation error to the input (current) and output (voltage) data. A quantisation error typically occurs when the measurements are measured with an ADC. The simulated data is rounded off to the third decimal in order to achieve a quantization error large enough to affect the output of the RLS algorithm. This effect can be seen in Figure 5.8 as an example of the RLS algorithm’s behaviour during such an input. It is clear that the RLS algorithm is extremely sensitive to low resolution data, since a 0.1 mV accuracy is required on a voltage signal with an amplitude of up to 50 V. This sensitivity is further supported by the fact that the covariance matrix of the current system used in the RLS algorithm is ill-conditioned. Thus, a small change in input data has a great effect on the output data of the algorithm.

T2 estimation 10

8 RLS est. τt2 τt2 6 RLS est. τt2 with quantization [s] t 2 τ 4

2

0 0 1,000 2,000 3,000 4,000 5,000 Time [s]

Figure 5.8: τt2 quantization error result

5.5 Conclusion

This chapter discussed the mathematical derivation of an ECM to the RLS algorithm’s format. The battery model was simulated in Simulink. The generated data was used in combination with the RLS algorithm in order to estimate the parameters of the simulated battery parameters in an on-line manner. The derivation was proven to be accurate and the RLS algorithm was implemented successfully. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 5. ON-LINE PARAMETER ESTIMATION 65

The designed BMS’s accuracy unfortunately does not comply with the required spec- ifications for the RLS algorithm. This resulted in the on-line estimation being inaccurate and can thus not be implemented in the BMS. Further work will need to be conducted in order to make the algorithm function properly with less accurate data. Other work that need to be investigated includes the minimisation of the noise on the measured data. It might be necessary to extend the current RLS algorithm into the recursive extended least squares (RELS) algorithm and or the Kalman filter in order to limit the impact of noise. Stellenbosch University https://scholar.sun.ac.za

Chapter 6

Results

6.1 Introduction

This section discusses the results of all the different components designed within this thesis. This includes the SSC as well as the different components for the BMS.

6.2 Battery Management System

This section investigates the performance of all the different components within the BMS. This includes the voltage and current measurements and how these measurements are affected.

6.2.1 BQ76940 Analogue to Digital Converter Accuracy The voltage measurements obtained using the BQ76940 battery monitoring chip are discussed within this section. After initial testing, the discovery was made that the BQ76940’s ADC measurement output at certain voltage references remains constant even though the voltage changes. An example of this behaviour is shown in Figure 6.1. The measurements were obtained after a discharge pulse during which the cells were given time to reach equilibrium. All the cell voltages rise as can be expected. The measured cell voltages also rise but at certain reference voltages are clamped to a constant value as is shown in Figure 6.1. The reference value varies from cell to cell. This behaviour at one cell also does not influence the measurement of the other cell voltages. The source of this behaviour was investigated but was not found. It is important to note that this non-linear behaviour’s impact on the accuracy of the measurements are within the accuracy of the BQ76940 chip. A curve was fitted to the measured data in order to calculate the voltage measurement error more accurately. The maximum error was found to be 4 mV, which is within the accuracy specification of the BQ76940 battery monitoring chip.

66 Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 67

3.220

3.215

3.210

3.205

3.200 Voltage [V]

3.195 cell 2 cell 3 3.190 cell 4 cell 5 3.185 50800 51000 51200 51400 51600 51800 52000 Time [s] Figure 6.1: ADC error

6.2.2 Measurement Noise This section investigates the measurement noise of the proof of concept BMS and the full scale BMS. A lot of effort was put into minimising both the voltage and current measurement noise on the full scale BMS. This included upgrading to the TPS54060 buck regulator. The buck regulator has a small voltage ripple which in turn reduces the noise induced on to the cell voltage and battery current measurements. The full scale BMS design also makes use of a 4 layer PCB to minimise noise, where one layer was used for grounding and another layer was used for supply power to the PCB.

6.2.2.1 Voltage Measurements The cell voltage measurement noise of the proof of concept BMS is compared to that of the full scale BMS in this subsection. Unfortunately, the BQ76940 cannot measure a voltage of 0 V. Therefore, the voltage measurement noise are isolated off-line by means of a filter. The Python code is shown in Appendix B.3. Both signals are filtered with exactly the same filter: A Butterworth filter with a sample rate of 1 Hz and a cut-off frequency of 0.01 Hz. The filtered data is subtracted from to the measured data to estimate the noise. The estimated noise of both systems are shown in Figure 6.2. It is clear that the full scale BMS’s measurement noise is lower than that of the prototype BMS. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 68

0.004

0.003

0.002

0.001

0.000

0.001 − Voltage [V] 0.002 − 0.003 − Proof of concept BMS noise 0.004 − Full scale BMS noise 0.005 − 0 200 400 600 800 1000 Time [s] Figure 6.2: Voltage measurement noise comparison

The power within the signals are calculated using

N−1 1 X P = x[n] 2. (6.2.1) N n=0 | | The above equation quantifies the difference in power of the two noise signals. The prototype BMS was calculated to have a noise power level of 21.9 µW/Ω compared to 10.7 µW/Ω of the full scale BMS which confirms that the noise is attenuated in the full scale design.

6.2.2.2 Current Measurements One of the main motivations for minimising the voltage ripple of the supply voltage is to minimise the current measurement noise. The sensor used converts the analogue current measurement into a reference voltage that is then measured using the MCU’s ADC. A current value of up to 150 A is scaled down to a corresponding voltage of between zero and the supply voltage± of 3.3 V. This makes the sensor extremely sensitive to noise. The sensor output at a current of 0 A is shown in Figure 6.3. The magnitude of the noise is 1.6 A. This results in a 0.53% error which is well within the desired error range of 1 %. In order to further decrease the noise, an infinite impulse response (IIR) filter is applied in software. A simple low pass filter is used with the difference equation given in the time domain by y(k) = y(k 1) + a[x(k) y(k 1)]. − − − The variables y(k) and x(k) refer to the output and input data, respectively, while a = 1 e−ωcTs . The cut-off frequency is selected as 4 Hz and the corresponding filter output is− shown in Figure 6.4. The cut-off frequency is chosen according to the cell voltage Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 69

1.5 Noise

1.0

0.5

0.0 Current [A]

0.5 −

1.0 − 0 100 200 300 400 500 Samples Figure 6.3: Current sensor noise sampling frequency. The measurement noise is reduced to 150 mA, which is less than 10 % of the original magnitude.

Noise 0.10

0.05 Current [A]

0.00

0.05 − 100 200 300 400 500 Samples Figure 6.4: Filtered current sensor noise Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 70

6.2.3 Current Sensor Thermal Test Result A thermal test was conducted at a constant current of 116 A, at room temperature, for a time of 5 minutes. A Fluke thermal camera was used to measure the maximum temperature of the board and the result is shown in Figure 6.5. A temperature rise of 21◦C was measured. The temperature is seen to rise higher than anticipated due to the power dissipated within the internal resistance of the current sensor, which was not included into the temperature calculation. The temperature rise is however still within the safe range of operation.

Figure 6.5: Current sensor thermal performance

6.2.4 Terminal Connections The high current rating of the battery proposes various problems. One such problem is the amount of contact required between the battery terminal and connector. A test was undertaken to investigate the influence of a weak terminal connection. The battery pack underwent a 66 A pulse discharge test. The cell measurements of the surrounding cells are shown in Figure 6.6. Cell 1 was purposefully connected with a weak terminal connection while cell 2 and cell 3 where connected normally. From Figure 6.6 it is clear that the cell voltage of cell 1 is greatly affected compared to cell 2 and cell 3. The weak terminal connection introduces a high contact resistance. When large amount of current flows into or from the battery terminal, the high contact resistance dissipates a large amount of power. This generates heat at the terminal of the battery, which in turn reduces the available capacity of the cell. The voltage across the contact resistance also forces the two parallel cells to discharge unevenly. As soon as the connection is tightened, the two cells are shown to reach equilibrium again. This test also shows that basic algorithms can be used to ensure that all the terminal connections are connected properly, by measuring the difference in cell voltage. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 71

3.3

3.2

3.1

3.0

2.9 Voltage [V]

2.8 cell 1 2.7 cell 2 cell 3 2.6 13000 14000 15000 16000 17000 18000 19000 Time [s] Figure 6.6: Weak terminal connections

6.2.5 Balancing This section discusses the performance of the balancing circuits and the balancing al- gorithm. Cell balancing is implemented to maximise the usable capacity of the battery pack. The balancing was implemented according to the balancing algorithm discussed in Chapter 4. The balancing reference voltage was chosen as 3.45 V. This resulted in the cells being balanced until their voltage falls below the chosen reference voltage, as shown in Figure 6.7. Additional cell measurements can be seen in Appendix B.4. The cell voltage reference value can be further reduced if the cells require more bal- ancing. Unfortunately, this will also result in a longer balancing time. The cell balancing, for this test, was achieved within 36 minutes. Further field testing is however required in order to find the optimal balancing current and time, since these parameters are typically dependant upon the application that the battery is used for. During balancing cell 6 and cell 11’s voltage measurement are influenced as shown in Figure 6.8. This can be attributed to the operation of the BQ79640 battery monitoring chip. It is internally divided into three sections, each working independently. Each of these sections monitors five cells and are stacked on top of each other to achieve an overall cell count of 15. While cell balancing is active, these sections typically turn off balancing for a short duration of time to measure the cell voltages. Unfortunately, in some instances these dead-times are not synchronised between the different sections. It is thus possible for one cell to be measured while another cell is being balanced. Take for instance cell 10 and cell 11 in Figure 6.8, where a clear influence is notable during balancing. All the terminal connections connected to the main control PCB are fused except the ground connection. Cell voltages are measured from the one positive terminal connection to the positive connection of the next cell’s positive terminal to reduce the amount of conductors connected to the main control PCB. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 72

3.60 cell 3 cell 4 3.55 cell 5

3.50

3.45 Voltage [V]

3.40

3.35 0 500 1000 1500 2000 Time [s] Figure 6.7: Cell balancing

3.70 cell 10 3.65 cell 11

3.60

3.55

3.50 Voltage [V]

3.45

3.40

500 1000 1500 2000 Time [s] Figure 6.8: Impact of protection fuse during cell balancing Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 73

In this instance the balancing current of cell 10 flows through a 2 A fuse, which affects the voltage measurement of cell 11. The fuse has an internal resistance of 50 mΩ.A balancing current of 1 A thus results in a 50 mV voltage offset, as seen in Figure 6.8. For- tunately, this behaviour can be ignored by implementing software changes. The analogue overvoltage threshold of the BQ76940 chip is also adjusted to account for this possible voltage offset. The fuse can be moved within the circuitry or can be replaced by a fuse with a smaller resistance, in future iterations of the BMS, to solve this problem.

6.3 Battery Off-line Parameter Estimation

6.3.1 Introduction In this section the off-line parameter estimation of the DP Thévenin ECM is estimated for the LFP battery pack. Firstly, the total battery pack capacity was validated according to the standard discharge test of the battery manufacturer. The capacity was determined as only 150 Ah, which is 75% of the rated 200 Ah capacity specified. A later discussion with the Chinese manufacturer revealed that they sent the wrong capacity cells. The 85 Ah version of the cells where shipped, not the 100 Ah cells. This is very peculiar since the manufacturer claimed that both versions have the same physical size and that currently the 100 Ah cells are out of stock. Unfortunately, this discussion only occurred after the off-line tests were already conducted and the battery was returned to the micro electric vehicle manufacturer. For these reasons all the tests were performed at the 150 Ah capacity. The DP Thévenin ECM is again chosen for off-line parameter estimation due to its high accuracy. For convenience the model is repeated here and shown in Figure 6.9. The model has six different parameters that require to be estimated. All these parameters are estimated according to [16]. The test consists of pulse discharging the battery through a constant load. Unfortunately, no HPPC tests where concluded since during the testing phase, there where no high power chargers available. The hysteresis effect of the LFP cells were also ignored, as in [16]. The voltage of the battery during the pulse discharge test is shown in Figure 6.10. The duration for the battery to reach equilibrium was determined by discharging the battery at a constant rate before giving it time to settle at a constant voltage. The duration for the dynamic behaviour of the battery to reach 98% of it’s final value was determined as

Rt1 Rt2

Rs + V + V 2 t1 − t − +

Ct1 Ct2 VOC(SOC) V(t)

I(t) − Figure 6.9: Dual polarization Thévenin equivalent circuit model Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 74

Voltage 52

50

48 Voltage [V] 46

44

42 0 10000 20000 30000 40000 50000 60000 Time [s] Figure 6.10: Pulse discharge test

90 minutes. The datasheet’s standard discharge current (66 A) was chosen as the average discharge rate of the test. The battery was discharged 10% at a time. The coulomb counter of the BMS was used during discharge to monitor the SOC of the battery.

6.3.2 Parameter Estimation The estimation of the model parameters are discussed in the following section. The SOC relationship with the OC voltage is shown in Figure 6.11. A polynomial curve fit was implemented in order to estimate a continuous relationship between the two variables. Secondly, resistor Rs was calculated by using the immediate voltage rise during one sample period after the contactor opened, while the current was measured just before the contactor opened. The assumption was made that for a step input, the the dynamic effects over one sampling period is negligibly small compared to that of the static components in the model. The resistance Rs is shown in Figure 6.12 with respect to SOC. From Figure 6.12 it can be seen that the battery’s ohmic resistance increases at low- and high SOC. The magnitude of the resistor Rs rises 13 % from its minimum to maximum value. Lastly, the remaining parameters were estimated using Matlab’s curve fit toolbox. The dynamic behaviour of the battery is approximated by

 −t −t Vdynamic(t) = Ibat Rt1e Rt1Ct1 + Rt2e Rt2Ct2 ]. (6.3.1) A curve fit of this form is applied onto the battery data. As an example, the curve fit of the dynamic behaviour at 90 % SOC is shown in Figure 6.13. It is clear that the curve fit approximates the battery’s behaviour accurately. This confirms the model’s ability to accurately model the battery dynamics. The required parameters were then Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 75

52

50

48

Open circuit voltage46 [V] Open circuit voltage dataset Polynomial curve fit 44 0 20 40 60 80 100 State of charge [%] Figure 6.11: SOC vs OC voltage

extracted from the curve fit result. The approximated resistance Rt1 and Rt2 is shown in Figure 6.14. The total battery resistance, Rtotal = Rs + Rt1 + Rt2, is shown in Figure 6.15. The battery’s maximum internal resistance, as expected, is found at a low SOC. The inter- nal resistance decreases as the SOC increases up to 60 %, where the minimum internal

0.0125 Ohmic battery resistance Rs

0.0120 ]

Ω 0.0115

0.0110 Resistance [

0.0105

0.0100 10 20 30 40 50 60 70 80 90 State of charge [%] Figure 6.12: Ohmic resistance characteristic curve of the battery Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 76

0.8 Battery dynamic behaviour Curve fit

0.6

0.4

Time constant [s] 0.2

0.0

0 1000 2000 3000 4000 5000 6000 State of charge [%] Figure 6.13: Curve fit of dynamic behaviour

0.012 Concentration polarization resistance Rt2 Electrochemical polarization resistance Rt1 0.010 ] Ω 0.008

0.006 Resistance [

0.004

10 20 30 40 50 60 70 80 90 State of charge [%] Figure 6.14: Dynamic resistance characteristic curve of the battery Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 77 resistance is found. This is typically where Li-ion batteries are most stable. The internal resistance increases gradually as the SOC increases to 100 %. The magnitude of the total internal resistance rises 37.5 % from its minimum to maximum value.

0.028 Total battery resistance

0.026 ]

Ω 0.024

0.022 Resistance [

0.020

0.018 10 20 30 40 50 60 70 80 90 State of charge [%] Figure 6.15: Total battery resistance characteristic curve

The two estimated time constants, τt1 and τt2, is shown in Figure 6.16 and 6.17 respectively. τt1 and τt2 represents the time constants RT 1CT 1 and RT 2CT 2. Time constant τt1 stays relatively constant with a rise of 9 % from its minimum to maximum value. The time constant τt2 varies significantly over the discharge cycle, up to 41 % from its minimum to maximum value. It is not uncommon for the concentration polarisation to vary to this magnitude as can also be seen in [16]. Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 78

1500

1450

1400

1350 Time constant [s]

1300

Time constant t1 1250 10 20 30 40 50 60 70 80 90 State of charge [%]

Figure 6.16: Time constant τt1 characteristic curve

90

85

80

75

70

65 Time constant [s] 60

55 Time constant t2 50 10 20 30 40 50 60 70 80 90 State of charge [%]

Figure 6.17: Time constant τt2 characteristic curve Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 79

6.4 Solid State Contactor

In this section the performance of the SSC is discussed. This includes the normal opera- tion, fault conditions and thermal analysis of the SSC.

6.4.1 Test Setup The performance of the designed SSC is investigated within the following subsection. The test set-up is shown in Figure 6.18. A 48 V lead-acid battery is used to deliver the required current through the SSC. Fuse F1 is used to limit the battery current in case of a fault condition. Switch S1 is an emergency switch that can be used to disconnect the battery from the load in the case of an emergency. The current through the SSC is measured with a current probe. The SSC is powered by a small 12 V supply. A signal generator is used to generate an input to the SSC. Diode D1 is used as a freewheeling diode when the SSC is opened in order to provide a path for the current to flow. This decreases the amount of power that is to be dissipated by the TVS within the SSC. Resistor R1 is a variable resistor that is used to control the magnitude of the current flowing through the SSC. The high current carrying components are indicated with thicker lines.

Current probe Supply

F1 SSC 400 A S1

48 V Input D1 R1

Figure 6.18: SSC test set-up

6.4.2 Normal Operation The SSC’s normal operation is tested first. The SSC is required to operate at a steady state current of up to 120 A without the overcurrent protection tripping. The resistive load is setup to allow a maximum continuous current of 120 A. The SSC is closed by the signal generator. The SSC current and the input voltage to the MOSFET gate driver are shown in Figure 6.19. It is clear that the overcurrent was not activated. The current sense pin voltage and the current reference pin voltage of the MOSFET driver are shown in Figure 6.20. The trip condition is activated when the current sense value exceeds the reference value minus 25 mV as stated by the datasheet of the UCD7100 MOSFET driver. The current sense value remains below this reference value as shown Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 80

120 12

100 10

80 8

SSC current 60 6 SSC gate driver input Voltage [V] Current [A] 40 4

20 2

0 0

0.0001 0.0000 0.0001 0.0002 0.0003 0.0004 0.0005 0.0006 − Time [s]

Figure 6.19: SSC current at maximum load

0.5

0.4

0.3

0.2

Voltage [V] 0.1

0.0 Current reference 0.1 Current sense − 0.00005 0.00000 0.00005 0.00010 0.00015 0.00020 − Time [s] Figure 6.20: Current sense and reference pin at maximum load Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 81

in Figure 6.20. It can be seen that the reference value is affected by the large change in current of the SSC. As soon as the SSC current settles at a constant value, the reference value also settles. The change in current induces a voltage on the reference pin. This coupling effect will have to be eliminated in the next iteration of the SSC. The thermal test of the SSC is performed at a constant current of 120 A. The test is conducted at room temperature. The temperature of the the SSC is measured with a Fluke thermal camera. The SSC is closed for a period of five minutes before the temperature is measured. The test results of the thermal camera is shown in Figure 6.21. The SSC reaches a maximum temperature of up to 51◦C around the MOSFETs. This results in a temperature rise of about 26◦C which confirms the thermal design. The thermal design was implemented for a maximum temperature rise of 30◦C. The open PCB areas were not included in the thermal design, even though it does contain thermal conduction. This explains why the temperature rise is lower than anticipated.

Figure 6.21: SSC temperature at maximum load

6.4.3 Overcurrent Trip This section investigates the SSC’s ability to open in the case of an overcurrent condition. This feature is of great importance in order to make the SSC more robust. A mechanical contactor is very robust in the sense that its maximum failing current is much higher than its rated current. For example, the contactor used for this project has a maximum breaking capacity of eight times its rated capacity. The BMS thus has a relatively long time period to react in the case of a fault condition. Unfortunately, the SSC is much more sensitive. When the current that is required to be disconnected is too large, the risk of the MOSFETs not closing increases. This thus makes the SSC less robust. The SSC has over an overcurrent trip with a fast reaction time for this reason. This feature protects the SSC from a short circuit fault as well as from thermal runaway. The resistive load, for this test, is decreased until the SSC’s overcurrent trip is acti- vated. Decreasing the resistive load increases the SSC current. An example of the SSC overcurrent trip is shown in Figure 6.22. It opens at a current of 133 A even though the Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 82

120 15

100

80 10 SSC current 60 SSC gate driver input Voltage [V] Current [A]

40 5

20

0 0

0.00005 0.00000 0.00005 0.00010 0.00015 0.00020 − Time [s]

Figure 6.22: SSC trip input to the system is still active. The input is required to be reset in order to reset the SSC. This proves that the resistance of the MOSFETs can be used, to relative accu- racy, to measure the current flowing through them. The feedback loop also performed as designed. The SSC’s overcurrent trip protects it from a fault condition. The current sense pin voltage and the current reference pin voltage of the MOSFET driver is shown in Figure 6.23. The trip condition is shown to be activated when the current sense value is larger than the reference value minus 25 mV. This leads to the MOSFET driver opening the MOSFETs. The change in current that induces a voltage on the reference pin can once again be seen. Fortunately, it is not large enough to impact the operation of the SSC. Both the reference and sense pins of the MOSFET driver, experience a transient response during the initial start of switching, as shown in Figure 6.24. The source of these oscillations were not found. It is present at no load conditions as well as at a lower MOSFET switching time. This will need to be investigated further in future work. The dead-time of the current sense pin voltage is also shown in Figure 6.24. The dead time is 800 ns, which confirms the design choice of a dead-time below 1 µs. One of the concerns with using MOSFETs to break a current, is how to protect the MOSFET’s terminal voltage. The MOSFET typically switch very fast, which could lead to a voltage spike on the terminal of the MOSFET (VDS) because of the inductance within the conductors. Transient voltage suppressors (TVSs) are therefore used to ensure the MOSFETs are protected against overvoltage conditions. The current and voltage of the SSC are shown in Figure 6.25, during turn-off. There is a voltage spike at the beginning as soon as the MOSFETs close. The voltage spike activates the TVSs. The TVSs conducts Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 83

0.5

0.4

0.3

0.2

Voltage [V] 0.1

0.0 Current reference 0.1 Current sense − 0.00005 0.00000 0.00005 0.00010 0.00015 0.00020 − Time [s] Figure 6.23: Current sense and reference pin

0.6

0.4

0.2

Voltage [V] 0.0

0.2 Current sense − Current reference

0.0000005 0.0000010 0.0000015 0.0000020 0.0000025 Time [s] Figure 6.24: Dead time Stellenbosch University https://scholar.sun.ac.za

CHAPTER 6. RESULTS 84

SSC current 120 120 SSC terminal voltage

100 100

80 80

60 60 Voltage [V] Current [A]

40 40

20 20

0 0 0.00001 0.00000 0.00001 0.00002 0.00003 0.00004 0.00005 − Time [s]

Figure 6.25: SSC during turn-off the current until the current reaches zero, thus effectively clamping the voltage below the maximum voltage of 100 V. When the current reaches zero, the TVSs deactivate until the next turn-off cycle.

6.5 Conclusion

This section discussed the various results of the BMS. The BMS’s voltage and current measurement noise were investigated, both of which were reduced due to design changes implemented from the proof of concept design BMS. The balancing algorithm was imple- mented within the BMS and the BMS was successfully used to balance the LFP battery pack. The BMS was also successfully used to estimate the DP Thévenin ECM parameters of the LFP battery pack in an off-line manner. This section also discussed the various results of the SSC. The SSC’s overcurrent trip function was implemented and it successfully protected the SSC from an overcurrent condition. The thermal design of the SSC was verified. The overvoltage protection while breaking the rated current of the SSC was also validated. Stellenbosch University https://scholar.sun.ac.za

Chapter 7

Conclusion

7.1 Introduction

The conclusion to the different components and algorithms investigated within this thesis are discussed in the following section. Possible future work is also discussed.

7.2 Conclusion

An overview is presented to show how the thesis addressed the objectives as set out in Chapter 1. These were:

Development of a proof of concept Li-ion BMS to ensure the basic working principle • of the BMS.

Development of a full scale Li-ion BMS for the purpose of a micro EV. • The successful implementation of a balancing algorithm within the BMS. • Off-line parameter estimation using the BMS. • The development of an on-line parameter estimation algorithm using an appropriate • battery model.

Development of a proof of concept SSC. • 7.2.1 Development of a proof of concept Li-ion BMS to ensure the basic working of the BMS The proof of concept BMS was designed, manufactured and tested. The system func- tioned with sufficient performance and proved the operation of the various subsystems. The system was shown to be ideal to monitor small battery packs. It also provided a good basic understanding of BMSs and good insight into what was required for the development of the full scale BMS.

85 Stellenbosch University https://scholar.sun.ac.za

CHAPTER 7. CONCLUSION 86

7.2.2 Development of a full scale Li-ion BMS for the purpose of a micro EV The full scale BMS was also designed, manufactured and tested. The system delivered improvements in performance compared to that of the proof of concept version. This was mainly due to the full scale BMS’s ability to minimise the supply voltage ripple. All of the different subsystems performed according to the design specifications. These subsystems include the current sensor circuit, balancing circuit and main control circuit of the full scale BMS.

7.2.3 The successful implementation of a balancing algorithm within the BMS Passive battery cell balancing was successfully implemented within the BMS. Balancing was achieved by the integration of the hardware design as well as the software design.

7.2.4 Off-line parameter estimation using the BMS The BMS was used to monitor the states of the battery during a pulse discharge cycle. This data was used off-line to estimate the parameters of a DP Thévenin ECM. These parameters can be used in future work to monitor for example how the battery ages over time.

7.2.5 The development of an on-line parameter estimation algorithm using an appropriate battery model A derivation of the DP Thévenin ECM mathematics to the RLS algorithm format was presented in Chapter 5. A Simulink simulation was used to simulate a DP Thévenin ECM through a discharge cycle. The derivation was confirmed with the RLS algorithm in an on-line manner. The RLS algorithm was found to be accurate, but extremely sensitive to measurement accuracy and noise.

7.2.6 Development of proof of concept SSC A proof of concept SSC was designed, manufactured and tested. The performance of the SSC, in terms of efficiency, was shown to be competitive compared to that of the me- chanical contactor. The SSC was shown to be more energy efficient within the operating conditions that the SSC was designed for. Unfortunately, it is very expensive compared to the mechanical contactor.

7.3 Future work

7.3.1 Battery management system The addition of an optional real time calibration system can be added to increase the measurement accuracy of the BQ76940. This typically entails externally calibrating the Stellenbosch University https://scholar.sun.ac.za

CHAPTER 7. CONCLUSION 87 measurements using the host MCU. Further software development can also decrease the power consumption of the BMS for example using the MCU’s sleep mode. The current sensor’s noise sensitivity can also be reduced by powering it with 5 V and not 3.3 V. At 3.3 V it typically produces a measurement offset. This will unfortunately result in having an extra supply rail.

7.3.1.1 Battery cell balancing The optimal magnitude of the balancing current will need to be investigated for this specific BMS. This will possibly lead to increasing the battery balancing current to shorten the battery balancing time. Other balancing algorithms can also be investigated to find an algorithm that can balance the cells while the battery is actively being used. The 2 A protection fuse used in the balancing circuit’s design will have to be recon- sidered. This could possibly result in moving the fuse or to chose a fuse with a smaller internal resistance.

7.3.2 On-line parameter estimation Methodologies for making the RLS algorithm less susceptible to measurement accuracy will have to be investigated in future work. The impact of noise will also have to be investigated. This could include upgrading the RLS algorithm to a Kalman filter.

7.3.3 Solid state contactor The cost of the SSC will need to be reduced in order to make it a financially viable option. This will have to be investigated in future work. It could typically be achieved by decreasing the size of the PCB and reducing the amount of MOSFETs used. The design needs to be optimised in terms of cost and efficiency with the specific load in mind. The transient response of the current feedback also requires to be investigated and minimised. This can lead to the SSC being more robust. Stellenbosch University https://scholar.sun.ac.za

Bibliography

[1] M. Taylor, K. Daniel, A. Ilas, and E. Young, “Renewable Power Generation Costs in 2014,” International Renewable Energy Agency (IRENA), Tech. Rep., 2015. [Online]. Available: www.irena.org/publications

[2] R. Xiong, F. Sun, X. Gong, and C. Gao, “A data-driven based adaptive state of charge estimator of lithium-ion polymer battery used in electric vehicles,” Applied Energy, vol. 113, pp. 1421–1433, 2014.

[3] Energy Storage Association, “Redox Flow Batteries.” [Online]. Available: http://energystorage.org/energy-storage/technologies/redox-flow-batteries

[4] Cornell University, “Battery Anodes.” [Online]. Available: http://www.emc2. cornell.edu/content/view/battery-anodes.html

[5] F. Badin, Hybrid Vehicles From Components to System. Editions Tech- nip, 2013. [Online]. Available: http://gen.lib.rus.ec/book/index.php?md5= AAD1D2CA3838E8CAD1D1416B8EB23F7A

[6] J. Molenda and M. Mole, “Composite Cathode Material for Li-Ion Batteries Based on LiFePO4 System.” in Metal, Ceramic and Polymeric Composites for Various Uses. InTech, jul 2011, ch. 30.

[7] B. Scrosati, J. Garche, and W. Tillmetz, Advances in Battery Technologies for Elec- tric Vehicles, 1st ed. Woodhead Publishing, 2015.

[8] M. Bingeman and B. Jeppesen, “Improving Battery Management System Perfor- mance and Cost with Altera FPGAs,” Altera, Tech. Rep. January, 2015.

[9] A. Hausmann and C. Depcik, “Expanding the Peukert equation for battery capacity modeling through inclusion of a temperature dependency,” Journal of Power Sources, vol. 235, pp. 148–158, 2013.

[10] L. Qian, Y. Si, and L. Qiu, “SOC estimation of LiFePO4 Li-ion battery using BP Neural Network,” in 28th International Electric Vehicle Symposium and Exhibition, 2015, pp. 1–7. [Online]. Available: http://www.a3ps.at/site/sites/default/files/ downloads/evs28/papers/A4-03.pdf

[11] D. Jiani, L. Zhitao, W. Youyi, and W. Changyun, “A fuzzy logic-based model for Li-ion battery with SOC and temperature effect,” in 11th IEEE International Conference on Control & Automation (ICCA). IEEE, jun 2014, pp.

88 Stellenbosch University https://scholar.sun.ac.za

BIBLIOGRAPHY 89

1333–1338. [Online]. Available: http://ieeexplore.ieee.org/lpdocs/epic03/wrapper. htm?arnumber=6871117

[12] J. Jiuchun and Z. Caiping, Fundamentals and Application of Lithium-ion Batteries in Electric Drive Vehicles, 1st ed. Wiley, 2015. [Online]. Available: http: //gen.lib.rus.ec/book/index.php?md5=11AA3536910E17170FF614920CB688D4

[13] “FreedomCAR Battery Test Manual For Power-Assist Hybrid Electric Vehicles,” Idaho National Engineering and Environmental Laboratory, Tech. Rep., 2003.

[14] H. He, R. Xiong, and J. Fan, “Evaluation of Lithium-Ion Battery Equivalent Circuit Models for State of Charge Estimation by an Experimental Approach,” Energies, vol. 4, no. 12, pp. 582–598, mar 2011. [Online]. Available: http://www.mdpi.com/1996-1073/4/4/582/

[15] H. Hongwen He, R. Rui Xiong, X. Xiaowei Zhang, F. Fengchun Sun, and J. JinXin Fan, “State-of-Charge Estimation of the Lithium-Ion Battery Using an Adaptive Extended Kalman Filter Based on an Improved Thevenin Model,” IEEE Transactions on Vehicular Technology, vol. 60, no. 4, pp. 1461–1469, may 2011. [Online]. Available: http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm? arnumber=5739545

[16] D. Gandolfo, A. Brandão, D. Patiño, and M. Molina, “Dynamic model of lithium polymer battery: Load resistor method for electric parameters identification,” Jour- nal of the Energy Institute, vol. 88, no. 4, pp. 470–479, 2015.

[17] A. Emadi, Advanced Electric Drive Vehicles. CRC Press, 2014.

[18] “EIS Measurement of a Very Low Impedance Lithium Ion Battery,” Gamry instruments, Tech. Rep., 2011. [Online]. Available: http://www.gamry.com/application-notes/EIS/ eis-measurement-of-a-very-low-impedance-lithium-ion-battery/

[19] L. Lu, X. Han, J. Li, J. Hua, and M. Ouyang, “A review on the key issues for lithium-ion battery management in electric vehicles,” Journal of Power Sources, vol. 226, pp. 272–288, 2013.

[20] D. Andre, C. Appel, T. Soczka-Guth, and D. U. Sauer, “Advanced mathematical methods of SOC and SOH estimation for lithium-ion batteries,” Journal of Power Sources, vol. 224, pp. 20–27, 2013.

[21] M. Corno, N. Bhatt, S. M. Savaresi, and M. Verhaegen, “Electrochemical Model- Based State of Charge Estimation for Li-Ion Cells,” IEEE Transactions on Control Systems Technology, vol. 23, no. 1, pp. 117–127, jan 2015. [Online]. Available: http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=6786991

[22] J. Xu, B. Cao, J. Cao, Z. Zou, C. C. Mi, and Z. Chen, “A Comparison Study of the Model Based SOC Estimation Methods for Lithium-Ion Batteries,” in 2013 IEEE Vehicle Power and Propulsion Conference (VPPC). IEEE, oct 2013, pp. 1–5. [Online]. Available: http://ieeexplore.ieee.org/document/6671653/ Stellenbosch University https://scholar.sun.ac.za

BIBLIOGRAPHY 90

[23] L. W. Juang, P. J. Kollmeyer, T. M. Jahns, and R. D. Lorenz, “Implementation of online battery state-of-power and state-of-function estimation in electric vehicle applications,” in 2012 IEEE Energy Conversion Congress and Exposition (ECCE). IEEE, sep 2012, pp. 1819–1826. [Online]. Available: http://ieeexplore.ieee.org/ lpdocs/epic03/wrapper.htm?arnumber=6342591 [24] Analog Devices, “Lithium Ion Battery Monitoring System AD7280A,” 2011. [Online]. Available: http://www.analog.com/media/en/technical-documentation/ data-sheets/AD7280A.pdf [25] Linear Technology, “Multicell Battery Stack Monitor LTC6802-1.” [Online]. Available: http://cds.linear.com/docs/en/datasheet/68021fa.pdf [26] Texas Instruments, “bq769x0 3-Series to 15-Series Cell Battery Monitor Family for Li-Ion and Phosphate Applications,” 2013. [Online]. Available: http://www.ti.com/lit/ds/slusbk2g/slusbk2g.pdf [27] I. Aizpuru, U. Iraola, J. M. Canales, M. Echeverria, and I. Gil, “Passive balancing design for Li-ion battery packs based on single cell experimental tests for a CCCV charging mode,” in 2013 International Conference on Clean Electrical Power (ICCEP). IEEE, jun 2013, pp. 93–98. [Online]. Available: http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=6586973 [28] Texas Instruments, “TMS320F2803x Piccolo Microcontrollers,” 2009. [Online]. Available: http://www.ti.com/lit/ds/symlink/tms320f28035.pdf [29] ——, “Constant On-Time Synchronous Buck Regulator LM5017,” 2012. [Online]. Available: http://www.ti.com/lit/ds/symlink/lm5017.pdf [30] ——, “LMX9838 Bluetooth Serial Port Module,” 2007. [Online]. Available: http://www.ti.com/lit/ds/snosaz9e/snosaz9e.pdf [31] ——, “SN65HVD23x 3.3-V CAN Bus Transceivers,” 2002. [Online]. Available: http://www.ti.com/lit/ds/symlink/sn65hvd235.pdf [32] Future Technology Devices International Ltd, “UMFT201XB, UMFT220XB and UMFT230XB Datasheet.” [Online]. Available: http://www.ftdichip.com/Support/ Documents/DataSheets/Modules/DS{_}UMFT201{_}220{_}230XB.pdf [33] Texas Instruments, “TPS54060 Step Down DC-DC Converter,” 2009. [Online]. Available: http://www.ti.com/lit/ds/symlink/tps54060.pdf [34] D. G. Brooks and J. Adam, “Trace Currents and Temperatures Revisited,” Tech. Rep., 2015. [35] Allegro MicroSystems, “ACS758 Hall Effect-Based Linear Current Sensor.” [On- line]. Available: http://www.allegromicro.com/en/Products/Current-Sensor-ICs/ Fifty-To-Two-Hundred-Amp-Integrated-Conductor-Sensor-ICs/ACS758.aspx [36] Albright International, “SW80 D.C. contactor.” [Online]. Available: http: //www.albrightinternational.com/products/sw80/ Stellenbosch University https://scholar.sun.ac.za

BIBLIOGRAPHY 91

[37] Murata Power Solutions, “Isolated 1W Single Output DC/DC Converters MEU1 Series.” [Online]. Available: http://power.murata.com/data/power/ncl/ kdc{_}meu1.pdf

[38] Fairchild, “General purpose phototransistor optocouplers 4N35.” [Online]. Available: https://www.fairchildsemi.com/datasheets/4N/4N35M.pdf

[39] Micro Commercial Components, “Transient Voltage Suppression Diodes.” [Online]. Available: http://pdf.datasheet.company/datasheets-1/ micro{_}commercial{_}components/5KP54CA-AP.pdf

[40] Texas Instruments, “Digital Power Control Driver UCD7100.” [Online]. Available: http://www.ti.com/product/UCD7100/technicaldocuments

[41] H. He, X. Zhang, R. Xiong, Y. Xu, and H. Guo, “Online model-based estimation of state-of-charge and open-circuit voltage of lithium-ion batteries in electric vehicles,” Energy, vol. 39, no. 1, pp. 310–318, 2012. [Online]. Available: http://dx.doi.org/10.1016/j.energy.2012.01.009

[42] Y.-H. Chiang, W.-Y. Sean, and J.-C. Ke, “Online estimation of internal resistance and open-circuit voltage of lithium-ion batteries in electric vehicles,” Journal of Power Sources, vol. 196, no. 8, pp. 3921–3932, 2011.

[43] T. Feng, L. Yang, X. Zhao, H. Zhang, and J. Qiang, “Online identification of lithium-ion battery parameters based on an improved equivalent-circuit model and its implementation on battery state-of-power prediction,” Journal of Power Sources, vol. 281, pp. 192–203, 2015. [Online]. Available: http: //dx.doi.org/10.1016/j.jpowsour.2015.01.154

[44] Xidong Tang, Xiaofeng Mao, Jian Lin, and B. Koch, “Li-ion battery parameter estimation for state of charge,” in Proceedings of the 2011 American Control Conference. IEEE, jun 2011, pp. 941–946. [Online]. Available: http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=5990963

[45] A. Vahidi, A. Stefanopoulou, and H. Peng, “Recursive least squares with forgetting for online estimation of vehicle mass and road grade: theory and experiments,” Vehicle System Dynamics, vol. 43, no. 1, pp. 31–55, jan 2005. [Online]. Available: http://www.tandfonline.com/doi/abs/10.1080/00423110412331290446 Stellenbosch University https://scholar.sun.ac.za

Appendices

92 Stellenbosch University https://scholar.sun.ac.za

Appendix A

Calculations

A.1 LM5017 regulator design

Design specifications: Maximum input voltage of 54.6 V with a minimum input voltage of 41.6 V. The regulated output voltage is 5 V. Design is done for a maximum output current of 500 mA. The design can be seen below:

A.1.1 Feedback resistor selection

RFB2 VOUT = VFB x ( + 1) RFB1 where VFB = 1.225 V. Standard values of 3 kΩ and 1 kΩ are chosen for RFB2 and RFB1 to result in an output voltage of 4.9 V.

A.1.2 Frequency selection

1 DMAX 1 5/41.6 fSW (MAX) = − = − = 4.4 MHz TOFF (MIN) 200 ns

DMIN 5/54.6 fSW (MAX) = = = 0.916 MHz TON(MIN) 100 ns A conservative switching frequency of 200 kHz is selected.

VOUT fSW = = 200 kHz K.RON

VOUT 5 RON = = −10 3 = 250 kΩ K.fSW 1x10 .200x10

RON is chosen smaller at 220 KΩ to ensure the switching frequency is always larger than the reference 200 KHz.

93 Stellenbosch University https://scholar.sun.ac.za

APPENDIX A. CALCULATIONS 94

A.1.3 Inductor selection The minimum inductance is selected to limit the output ripple to 15 % of the maximum load current.

VIN VOUT VOUT ∆IL = − x L1.fSW VIN

The maximum ripple is observed at maximum input voltage. Substituting VIN = 54.6 V and ∆IL = 15 % x IOUT (MAX) results in L1 = 3.028 µH. The next higher standard value of 330 µH is chosen.

A.1.4 Output capacitor selection The output capacitor is selected to minimise the output voltage ripple. The ripple can be calculated by:

∆IL COUT = 8.fSW .∆Vripple A 22 µF ceramic capacitor is chosen. This results into a voltage ripple of 2.13 mV.

A.1.5 Input Capacitor selection The input capacitor is selected to minimise the input voltage ripple. The ripple can be calculated by:

IOUT (MAX) CIN ≥ 8.fSW .∆VIN Two 2.2 µF ceramic capacitors are placed in parallel to result in a total of 4.4 µF. This results into a voltage ripple of 82 mV.

A.1.6 Undervoltage lockout resistors selection These resistors set the undervoltage lockout (UVLO) and hysteresis according to:

VIN (HYS) = IHYS x RUV 2 and RUV 2 VIN (UV LO, rising) = 1.225 x ( + 1) RU V 1 where IHYS = 20 µA. RUV 1 is chosen as 6.8 kΩ and RUV 2 as 120 kΩ. This result in a UVLO threshold and hysteresis of 22.8 V and 2.4 V respectively.

A.1.7 Ripple configuration selection The minimum ripple configuration is chosen to minimise the output voltage ripple. The values are chosen as follows: Cr = 3.3 nF Stellenbosch University https://scholar.sun.ac.za

APPENDIX A. CALCULATIONS 95

Cac = 100 nF

Rr are chosen according to

(VIN(MIN) VOUT ) x TON RcCr − ≤ 25 mV which result in 100 kΩ. Stellenbosch University https://scholar.sun.ac.za

Appendix B

Code

B.1 Python USB listener

""" Created on Wed May 04 16:38:09 2016 @author: B. Horn """ import serial import struct import csv try: ser = serial.Serial( port=’COM8’, baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, xonxoff=False, timeout=5 # set input buffer size = read_size # doesn’t seem necessary in pyserial ) except serial.SerialException: print ’Could not open port’, ’port’ + ’.’ print ’Use \’dmesg -T | grep -i \’ to find appropriate ports.’ myfile = open(’document.csv’, ’ab’) try: while 1: outputList = [] while 1: data_in = bytearray() while not data_in: data_in = ser.read(size=4)

96 Stellenbosch University https://scholar.sun.ac.za

APPENDIX B. CODE 97

if len(data_in) == 4: (float_out,) = struct.unpack(’>f’, data_in) #>f outputList.append(float_out); data_in = 0 #print ’Output received and stored:’ #print float_out

if len(outputList) == 18: #append write to csv wr = csv.writer(myfile, dialect=’excel’) wr.writerow(outputList) myFormattedList = [ ’%.3f’ % elem for elem in outputList ] #print ’Output received and stored:’ print myFormattedList outputList[:] = [] break except KeyboardInterrupt: myfile.close() ser.close()

B.2 MATLAB Symbolic solver

syms Voc Rin Rp Rq Cp Cq Vt dVt dV2t I1 dI d2I Vp Vq dVp dVq dV2p dV2q sol = solve(’-Vt + Voc - I1*(Rin) - Vp - Vq’,’dVt +dI*Rin + dVp + dVq’,’dV2t + d2I*Rin + dV2p + dV2q’,’Vp/Rp + dVp*Cp - I1’,’ dVp/Rp + dV2p*Cp -dI’,’-I1 + Vq/Rq + dVq*Cq’,’-dI + dVq/Rq + dV2q*Cq’,’Vp’,’Vq’, ’dVp’ , ’dVq’, ’dV2p’, ’dV2q’,’Vt’); sol.Vt

%Voc - I1*Rin - I1*Rp - Cp*Rp*dVt - Cp*Rin*Rp*dI %Voc %- I1*Rin - I1*Rp - I1*Rq %- Cp*Rin*Rp*dI - Cq*Rin*Rq*dI - Cp*Rp*Rq*dI - Cq*Rp*Rq*dI %- Cp*Cq*Rin*Rp*Rq*d2I %- Cp*Rp*dVt - Cq*Rq*dVt %- Cp*Cq*Rp*Rq*dV2t syms Theta2 Theta3 Theta4 Theta5 Theta6 Tp Tq sol2 = solve(’Theta2+Rin+Rp+Rq’,’Theta3+Rin*(Tp+Tq)+Rq*Tp+Rp*Tq’,’Theta4 + Tp*Tq*Rin’,’Theta5 + Tp+Tq’,’Theta6 +Tp*Tq’, ’Rin’ , ’Rq’, ’Rp’, ’Tp’,’Tq’); Stellenbosch University https://scholar.sun.ac.za

APPENDIX B. CODE 98

% sol2 = solve(’Theta2+Rin+Rp+Rq’,’Theta3 + Cp*Rin*Rp + Cq*Rin*Rq + Cp*Rp*Rq + Cq*Rp*Rq’,’Theta4 + Cp*Cq*Rin*Rp*Rq’,’Theta5 + Cp*Rp + Cq*Rq’,’Theta6 +Cp*Cq*Rp*Rq’, ’Rin’ , ’Rq’, ’Rp’, ’Cp’,’Cq’); sol2.Rin sol2.Tp sol2.Tq sol2.Rp sol2.Rq

B.3 Noise filter

B.3.1 Noise filter Python code

# -*- coding: utf-8 -*- """ Created on Fri May 27 13:31:24 2016

@author: B. Horn """ import numpy as np from scipy.signal import butter, lfilter, freqz, filtfilt import matplotlib.pyplot as plt def butter_lowpass(cutoff, fs, order=5): nyq = 0.5 * fs normal_cutoff = cutoff / nyq b, a = butter(order, normal_cutoff, btype=’low’, analog=False) return b, a def butter_lowpass_filter(data, cutoff, fs, order=5): b, a = butter_lowpass(cutoff, fs, order=order) z = filtfilt(b, a, data) return z

Voltage,current =loadtxt(’Data_lipo.CSV’,delimiter=’,’,skiprows=1, usecols=(0,1), unpack = 1) current2, Voltage2 = loadtxt(’test6_long.CSV’,delimiter=’,’,skiprows=0, usecols=(15,17), unpack = 1) order = 1 fs = 1 # sample rate, Hz cutoff = 0.01 # desired cutoff frequency of the filter, Hz y = butter_lowpass_filter(Voltage, cutoff, fs, order) Stellenbosch University https://scholar.sun.ac.za

APPENDIX B. CODE 99 x = butter_lowpass_filter(Voltage2, cutoff, fs, order)

Lipo = Voltage[11800:12800] Lipo_filt = y[11800:12800]

LFP = Voltage2[28000:29000] LFP_filt = x[28000:29000] noise1 = Lipo_filt-Lipo noise2 = LFP_filt-LFP noise11 = (sum((abs(noise1))**2))/sys.getsizeof(noise1) noise22 = (sum((abs(noise2))**2))/sys.getsizeof(noise2)

B.3.2 Noise filter result

0.004

0.003

0.002

0.001

0.000

0.001 − Voltage [V] 0.002 − 0.003 − Prototype BMS noise 0.004 − Up-scaled BMS noise 0.005 − 0 20 40 60 80 100 Time [s] Figure B.1: Noise of prototype BMS compared to that of the up-scaled BMS Stellenbosch University https://scholar.sun.ac.za

APPENDIX B. CODE 100

B.4 Battery balancing

3.60 cell 1 cell 2 3.55 cell 6 cell 7 3.50

3.45 Voltage [V]

3.40

3.35 500 1000 1500 2000 Time [s] Figure B.2: Battery balancing

3.70 cell 8 3.65 cell 9 cell 10 3.60 cell 11

3.55

3.50 Voltage [V]

3.45

3.40

3.35 500 1000 1500 2000 Time [s] Figure B.3: Battery balancing Stellenbosch University https://scholar.sun.ac.za

APPENDIX B. CODE 101

3.60 cell 12 cell 13 3.55 cell 14 cell 15 3.50

3.45 Voltage [V]

3.40

3.35 500 1000 1500 2000 Time [s] Figure B.4: Battery balancing Stellenbosch University https://scholar.sun.ac.za

Appendix C

PCB Schematics

C.1 Full Scale BMS Schematic

C.1.1 BMS Control Schematic B C D A BATT+ 6 6 SCL SDA CAP1 REGOUT Bartho Horn 3 COC20 C20 PIU203 PIU203 4.7uF PIC2002 PIC2001 D GND MellowCabs Franshoek South Africa Engineer: G S U2B COU2B 1 2 7 COC19 C19 2.2uF PIU201 PIU201 PIU202 PIU202 N type 1.1 of PIC1901 PIC1902 PIC1902 GND 3 COZ2 Z2 Zener PIZ203 PIZ203 PIZ201 Revision: Sheet VC5X REGSRC VC10X VC5X 1 2 COT1 09:39:54 PM T1 3 1 2 1 2 COT3 COT2 T3 T2 PIT101 PIT102 GND Time: Number: PIT302 PIT202 PIT301 PIT302 PIT201 PIT202 5 5 C18 3.3nF COC18 PIC1801 PIC1802 PIC1802 Tabloid 2016/11/22 C:\Users\16687817\Dropbox\Meesters\PCB designs\PCB 1.1\PWR524A_AFE1.SchDoc COC16 COC17 C16 3.3nF C17 3.3nF BMS PIC1601 PIC1602 PIC1701 PIC1702 PIC1602 PIC1702 Title Size: Date: File: COC14 COC15 C14 1µF C15 1µF PIC1401 PIC1402 PIC1501 PIC1502 PIC1502 R3 4.7K COR3 PIR302 PIR301 PIR302 BQ_Enable 2 1 BAV99 PID1202 PID1202 PID1201 REGSRC CHG DSG COC13 C13 1µF COD12 D12 PIC1301 PIC1302 PIC1302 GND 3 BAT PID1203 PID1203 GND 15 9 8 2 18 13 6 5 3 23 22 21 19 14 7 20 4 1 10 PIU1015 PIU1010 PIU1018 PIU1013 PIU1023 PIU1022 PIU1021 PIU1020 PIU1019 PIU1019 PIU1018 PIU1015 PIU1014 PIU1014 PIU1013 PIU1010 PIU109 PIU109 PIU108 PIU108 PIU107 PIU106 PIU105 PIU105 PIU104 PIU104 PIU102 PIU102 PIU101 PIU101 PIU103 PIU1023 PIU1022 PIU1021 PIU103 NC NC NC TS3 TS2 TS1 SCL VSS BAT SDA DSG CHG CAP3 CAP2 CAP1 VC5X 4 4 VC10X REGSRC REGOUT PID1102 PID902 PID1002 PID1102 D9 SM4T6V7AY D10 SM4T6V7AY D11 SM4T6V7AY COD9 COD10 COD11 PID1101 PID901 PID1001 PID1101 ALERT VC15 VC14 VC13 VC12 VC11 VC10B VC10 VC9 VC8 VC7 VC6 VC5B VC5 VC4 VC3 VC2 VC1 VC0 SRP SRN ALERT NC NC NC NC U1 PartNumber COU1 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 11 12 16 17 PIU1025 PIU1026 PIU1027 PIU1028 PIU1032 PIU1033 PIU1038 PIU1039 PIU1024 PIU1025 PIU1026 PIU1027 PIU1028 PIU1029 PIU1029 PIU1030 PIU1031 PIU1031 PIU1032 PIU1033 PIU1034 PIU1035 PIU1036 PIU1036 PIU1037 PIU1038 PIU1039 PIU1040 PIU1040 PIU1041 PIU1042 PIU1043 PIU1043 PIU1044 PIU1044 PIU1011 PIU1011 PIU1012 PIU1012 PIU1016 PIU1016 PIU1017 PIU1017 PIU1030 SRP SRN VC15 VC14 VC13 VC12 VC11 VC10B 3 3 C3 470nF C4 470nF C5 470nF C6 470nF C7 470nF C8 470nF C9 470nF C10 470nF C11 470nF C12 470nF COC3 COC4 COC5 COC6 COC7 COC8 COC9 COC10 COC11 COC12 PIC301 PIC302 PIC401 PIC402 PIC501 PIC502 PIC601 PIC601 PIC602 PIC701 PIC701 PIC702 PIC801 PIC802 PIC901 PIC902 PIC1001 PIC1001 PIC1002 PIC1101 PIC1102 PIC1201 PIC1202 PIC702 PIC1202 GND C1 470nF C2 470nF COC1 COC2 PIC101 PIC102 PIC201 PIC202 GND Z1 Zener COZ1 PIZ103 PIZ101 PIR201 2 2 PIR101 R2 1K COR2 PIR202 PIR202 R1 1K COR1 PIR102 PIR102 D1 D2 D3 D4 D5 D6 D7 D8 COD1 COD2 COD3 COD4 COD5 COD6 COD7 COD8 SM4T6V7AY SM4T6V7AY SM4T6V7AY SM4T6V7AY SM4T6V7AY SM4T6V7AY SM4T6V7AY SM4T6V7AY PID102 PID101 PID202 PID202 PID201 PID302 PID302 PID301 PID402 PID401 PID502 PID502 PID501 PID602 PID602 PID601 PID702 PID701 PID802 PID802 PID801 C0 C10 C9 C8 C7 C6 C5 C4 C3 C2 C1 C0 NLC10 NLC9 NLC8 NLC7 NLC6 NLC5 NLC4 NLC3 NLC2 NLC1 NLC0 VC5X NLVC5X C15F(48V) C10F C5F C10 C5F VC5X 1 1 C9 C8 C7 C6 C5 C4 C3 C2 C1 C9 C8 C7 C6 C5 C4 C3 C2 C1 C15F(48V) C10F C5F C0 NLC15F(48V) NLC10F NLC5F PIP103 PIP102 PIP102 PIP101 PIP203 PIP202 PIP201 PIP303 PIP303 PIP302 PIP301 PIPOWER04 PIPOWER04 PIPOWER03 PIPOWER02 PIPOWER01 3 2 1 3 2 1 3 2 1 4 3 2 1 P1 3 way 2.54 molex P2 3 way 2.54 molex P3 3 way 2.54 molex POWER 4 Way 2.54mm molex header COP1 COP2 COP3 COPOWER B C D A

102 Stellenbosch University https://scholar.sun.ac.za

APPENDIX C. PCB SCHEMATICS 103 B C D A 6 6 Bartho Horn Mellowcabs Franshoek South Africa Engineer: 7 1.1 of 4 Revision: Sheet 09:50:18 PM 4 Time: Number: 5 5 Tabloid 2016/11/22 C:\Users\16687817\Dropbox\Meesters\PCB designs\PCB 1.1\PWR524A_AFE2.SchDoc BMS Title Size: Date: File: BAT VC10X VC5X COC29 C29 10µF PIC2901 PIC2902 VC15 VC14 VC13 VC12 VC11 VC10B 4 4 COC28 10µF C28 COC27 C27 10µF PIC2801 PIC2802 GND PIC2702 PIC2701 PIC2702 3 3 PIR701 COC22 COC23 COC24 COC25 COC26 C22 470nF C23 470nF C24 470nF C25 470nF C26 470nF R7 1K COR7 PIC2201 PIC2202 PIC2301 PIC2302 PIC2401 PIC2402 PIC2501 PIC2502 PIC2601 PIC2601 PIC2602 PIR702 COC21 C21 470nF PIC2101 PIC2102 Z3 Zener COZ3 PIZ303 PIZ303 PIZ301 PIR601 R6 1K COR6 PIR602 PIR602 PIR501 2 2 R5 1K COR5 PIR502 PIR502 PIR401 R4 1K COR4 PIR402 PIR402 D15 D16 D17 D18 D19 COD15 COD16 COD17 COD18 COD19 SM4T6V7AY SM4T6V7AY SM4T6V7AY SM4T6V7AY SM4T6V7AY PID1502 PID1501 PID1602 PID1602 PID1601 PID1702 PID1702 PID1701 PID1802 PID1802 PID1801 PID1902 PID1902 PID1901 D13 D14 COD13 COD14 SM4T6V7AY SM4T6V7AY PID1302 PID1301 PID1402 PID1401 C9 C4 C10 C15 C14 C13 C12 C11 C10 NLC15 NLC14 NLC13 NLC12 NLC11 NLC10 1 1 PIP403 PIP403 PIP402 PIP401 PIP503 PIP503 PIP502 PIP501 3 2 1 3 2 1 C5F P4 3 way 2.54 molex P5 3 way 2.54 molex COP4 COP5 BATT+ C10F C15F(48V) B C D A Stellenbosch University https://scholar.sun.ac.za

APPENDIX C. PCB SCHEMATICS 104 B C D A 3.3V GND 2 1 BAV99 PID3001 PID3002 PID3002 PID3001 COD30 D30 1 2 COCAN1 CAN1 3 3.3V PID3003 PID3003

Contactor Contactor_out Drive NLContactor NLContactor0out NLDrive PICAN101 PICAN102 PICAN102 6 6 COC49 C49 47nF 5 4 6 COR44 COR45 R44 10K R45 510 NLDrive0sense Drive_sense PIU804 PIC4901 PIC4902 PIR4402 PIR4402 PIR4401 PIR4502 PIR4502 PIR4501 PIU806 PIU806 PIU805 PIU805 GND GND Bartho Horn C Y Vcc A GND B COR46 COR47 R46 62 R47 62 COU8 GND U8 SN74LVC1G11 PIR4602 PIR4601 PIR4601 PIR4702 PIR4702 PIR4701 MellowCabs Franshoek South Africa 3.3V GND Engineer: 2 1 25 24 23 22 21 20 19 18 1 2 3 BAV99 PIU7025 PIU7024 PIU7023 PIU7022 PIU7021 PIU7020 PIU7019 PIU7018 PID2902 PID2901 PID2902

NLCHG0out DSG_out CHG_out PIU801 PIU802 PIU802 PIU803 PIU803 PIU804 NLDSG0out GND GND GND GND GND GND GND GND 7 COD29 1.1 D29 of AND Gate GND 3 5 PID2903 PID2903 COR42 COR43 R42 10K R43 10K

CAN_EN Key NLCAN0EN NLKey PIR4202 PIR4201 PIR4302 PIR4302 PIR4301 Revision: Sheet GND COR40 COR41 R40 330K R41 100K DSG_out 6 5 8 7 GPIO_0 GPIO_1 GPIO_2 GPIO_3 RESET_L SERIAL_4 SERIAL_3 SERIAL_2 SERIAL_1 SERIAL_0 GND VDD NC N N L L PIR4101 PIR4002 PIR4001 PIR4102 PIR4102 PIR4101 COR33 COR34 R33 10K R34 510 DSG GND COU7 NLKey0sense U7 GreenPHY mini stamp Key_sense PIR3401 PIU607 PIU606 PIU605 PIU608 PIU607 PIU606 PIU605 PIR3302 PIR3302 PIR3301 PIR3402 PIR3402 PIR3401 GND 1 2 3 4 5 6 7 8 9 Rs 10 11 12 13 14 15 16 17 CL EN CH 09:52:38 PM PIU701 PIU702 PIU702 PIU703 PIU703 PIU704 PIU705 PIU705 PIU706 PIU707 PIU707 PIU708 PIU708 PIU709 PIU7010 PIU7010 PIU7011 PIU7012 PIU7013 PIU7014 PIU7015 PIU7016 PIU7017 PIU7016 PIU7017 PIU7012 PIU704 PIU7011 PIU7014 PIU7015 5 COR38 COR39 R38 330K R39 100K CHG_out Key Switch PIR3802 PIR3801 PIR3902 PIR3902 PIR3901 3.3V CHG GND GND Green-PHY Communication 2 1 D GND Vcc R NLGreenP0R NLSPI0MOSI NLSPI0MISO NLSPI0CS NLSPI0CLK NLGreenP0I COU6 GreenP-R SPI-MOSI SPI-MISO GreenP-I Time: SPI-CS SPI-CLK U6 CAN-SN65HVD234 PID2502 PID2501 PID2502 PID2501 Number: COC48 C48 1 2 3 4 2.2uF Green-PHY GreenP-GPIO0 GreenP-GPIO1 GreenP-GPIO2 NLGreenP0GPIO0 NLGreenP0GPIO1 NLGreenP0GPIO2 NLGreen0PHY PIC4802 PIC4801 5 5 GND CAN Communication PIU601 PIU602 PIU603 PIU603 PIU604 PIU604 PIU602 COD25 D25 BAV99 R36 1K R37 1K COR36 COR37 GND 3.3V CANTx CANRx Tabloid 2016/11/22 C:\Users\16687817\Dropbox\Meesters\PCB designs\PCB 1.1\PWR524A_BQ78350DBT.SchDoc NLCANTx NLCANRx BMS PIR3602 PIR3601 PIR3702 PIR3702 PIR3701 3 PID2503 PID2503 NLCharge GND Charge Title Size: Date: File: COLED3 LED3 GND COR35 COR29 COR30 R35 10K R29 10K R30 510 NLLED3 NLCharge0sense Charge_sense LED3 PIR3001 PIR3502 PIR3501 PILED302 PILED302 PILED301 PIR2902 PIR2902 PIR2901 PIR3002 PIR3002 PIR3001 PILED301 GND GND COC47 C47 2.2uF PIC4702 PIC4701 3.3V GND LED2 COLED2 3.3V GND 2 1 COR32 R32 10K NLLED2 LED2 PID2602 PID2601 PID2602 PID2601 PIR3202 PIR3201 PILED202 PILED202 PILED201 GND Status LEDS COD26 D26 BAV99 GND LED1 COLED1 3 PID2603 PID2603 COR31 R31 10K NLLED1 NL12V0sense0measure

LED1 12V_sense_measure PIR3102 PIR3101 PILED102 PILED102 PILED101 GND GND GND COR49 COR50 R49 10K R50 510 NLOP4 NLOP5 NL12V0sense OP4 OP5 12V_sense PIR5001 PIR4902 PIR4902 PIR4901 PIR5002 PIR5002 PIR5001 GND 23 22 21 28 25 27 40 39 38 37 36 35 34 33 32 31 30 29 24 26 PIU5022 PIU5022 PIU5021 PIU5021 PIU5025 PIU5040 PIU5039 PIU5038 PIU5037 PIU5036 PIU5035 PIU5035 PIU5034 PIU5034 PIU5033 PIU5033 PIU5032 PIU5032 PIU5031 PIU5031 PIU5030 PIU5030 PIU5029 PIU5029 PIU5028 PIU5028 PIU5027 PIU5027 PIU5026 PIU5025 PIU5024 PIU5023 4 4

NC NC NC NC NC NC NC NC OP5 control 3.3V 32K- GND GND GND GND GND 32K+ Audio Audio Audio NL303V control PIR4801 PIR4801 1 2 COOP5 OP5 OP4/PG4 R28 1K COR28 OP5 COR48 R48 10K PIR2802 PIR2802 PIR2801 PIOP501 PIOP502 PIOP502 3.3V PIR4802 PIR4802 3.3V Bluetooth 2 1 PIU902 PIU901 PIU901 PIU902 S NC RESET GND GND NC MVcc PG6 XOSCEN Vcc_CORE Vcc Vcc_IO RXD TXD RTS CTS OP3 GND GND PG7 Audio 1 2 G OP4 U5 LMX9838 Bluetooth module COU5 COOP4 1 2 3 4 5 6 7 8 9 D COR27 R27 1K 10 11 12 13 14 15 16 17 18 19 20 COU9B U9B OP4 PIOP401 PIOP402 PIOP402 PIR2702 PIR2702 PIR2701 3.3V PIU5014 PIU501 PIU502 PIU5012 PIU5013 PIU501 PIU502 PIU503 PIU503 PIU504 PIU504 PIU505 PIU506 PIU507 PIU507 PIU508 PIU508 PIU509 PIU509 PIU5010 PIU5010 PIU5011 PIU5011 PIU5012 PIU5013 PIU5014 PIU5015 PIU5016 PIU5017 PIU5017 PIU5018 PIU5019 PIU5020 PIU5020 PIU5016 3 PIU903 PIU903 Current measure on/off control C44 COC44 1 2 OP3 BT1 2.2uF BT-LED1 SCI-transmit SCI-receive RTS CTS OP3 BT-LED2 NLBT1 NLBT0LED1 NLSCI0transmit NLSCI0receive NLRTS NLCTS NLOP3 NLBT0LED2 COOP3 PIC4402 PIC4401 3.3V controlled COR26 R26 1K OP3 PIOP301 PIOP302 PIOP302 PIR2602 PIR2602 PIR2601 3.3V GND 3.3V GND C43 COC43 4.7uF PIC4302 PIC4301 3.3V GND D23 3.3V COD23 GND BT Status LEDS and Inputs 2 1 BAV99 C45 COC45 PID2402 PID2401 PID2402 PID2401 COR25 R25 330K BT-LED2 22uF PIC4502 PIC4501 PIC4502 PIC4501 PIR2502 PIR2502 PIR2501 PID2302 PID2302 PID2301 3 3 3.3V 3.3V GND PIL502 PIL502 D24 COD24 3

D22

COD22 L5 Inductor 10uH PID2403 COL5 PID2403 PIL501 Pre-charge_out PIL501 R23 330K COR23 BT-LED1 NLPre0charge0out PIR2401 PIR2302 PIR2302 PIR2301 PID2202 PID2202 PID2201 PIR2401 R22 30.9K R19 10K COR22 COR19 3.3V PIR2202 PIR2202 PIR2201 PIR1902 PIR1902 PIR1901 PIR1901 GND C53 COC53 22uF C41 R24 100 COC41 COR24 PIC5302 PIC5301 PIC5301 PIC5302 2.2uF PIR2402 PIC4102 PIC4101 PIR2402 GND C42 COC42 3.3V 3.3V GND GND 22uF 2 1 2 1 PIC3902 PIC4202 PIC4201 PIC3902 GND BAV99 BAV99 C40 C39 100nF COC39 COC40 PID2002 PID2002 PID2001 PID2102 PID2102 PID2101 PID2101 2.2uF PIL302 PIC3901 PIC3901 PIC4002 PIC4001 GND COL4 L4 60 Ohm PIL402 PIL401 3.3V D20 D21 COD20 COD21

L3 Inductor 150uH COL3 3 3

I_measure COC34 Contactor_out C34 10pF PID2003 PID2103 PIL301 PID2003 PID2103 D27 Diode 100V COD27 NLI0measure PIC3401 PIC3402 PIC3402 GND C36 3.3nF PIR2001 COC36 PID2702 PID2702 PID2701 GND PIC3601 PIC3602 PIC3602 BQ_Enable GND PIR1801 PIC3701 PIR1801 NLTMS NLTDI NLTDO NLTCK Contactor Curent PCB connector Key Pre-charge_out CTS RTS Charge TMS TDI TDO TCK Drive SPI-MOSI SPI-CS SPI-MISO SPI-CLK 3.3V control LED3 LED2 LED1 BT1 SCI-receive SCI-transmit C37 3.3nF R20 100 COC37 COR20 COR21 R21 PIR2002 PIC3702 PIC3702 PIR2002 PIR2102 PIR2101 PIR2102 COR18 R18 100 69 68 67 66 63 62 50 49 43 52 51 80 79 78 77 76 75 74 65 64 61 60 59 58 57 56 55 48 47 46 45 44 42 41 71 53 72 54 70 73 2 2 PIR1802 PIU3076 PIU3060 PIU3059 PIU3058 PIU3057 PIU3080 PIU3080 PIU3079 PIU3079 PIU3078 PIU3078 PIU3077 PIU3077 PIU3076 PIU3075 PIU3075 PIU3074 PIU3074 PIU3073 PIU3072 PIU3072 PIU3071 PIU3070 PIU3069 PIU3069 PIU3068 PIU3068 PIU3067 PIU3067 PIU3066 PIU3065 PIU3065 PIU3064 PIU3063 PIU3062 PIU3062 PIU3061 PIU3061 PIU3060 PIU3059 PIU3058 PIU3057 PIU3056 PIU3056 PIU3055 PIU3055 PIU3054 PIU3053 PIU3052 PIU3052 PIU3051 PIU3051 PIU3050 PIU3050 PIU3049 PIU3049 PIU3048 PIU3048 PIU3047 PIU3047 PIU3046 PIU3046 PIU3045 PIU3044 PIU3043 PIU3042 PIU3041 PIU3041 PIR1802 PIU3045 R68K 10 8 6 7 9 X1 X2 12V_sense PIU1007 PIU1006 PIU10010 PIU1009 PIU1009 PIU1008 PIU1007 PIU1006 PIU10010 VSS VSS VDD VDD GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 GPIO7 GPIO8 VDDIO GPIO24 GPIO21 GPIO20 GPIO14 GPIO13 GPIO15 GPIO34 GPIO10 GPIO40 GPIO11 GPIO36 GPIO35 GPIO37 GPIO38 GPIO39 GPIO19 GPIO41 GPIO12 GPIO16 GPIO44 GPIO25 GPIO17 GPIO18 Vregenz PH GND COMP Vsense PWRGD PIC3802 C38 100nF COC38 3.3V controlled PIC3801 Boot VIN EN SS/TR CLK U10 TPS54060 Green-PHY Key_sense Drive_sense Charge_sense COU10 GND 1 2 3 4 5 GPIO22 GPIO32 GPIO33 GPIO23 GPIO42 GPIO43 VDD VSS nXRS nTRST ADCINA7 ADCINA6 ADCINA5 ADCINA4 ADCINA3 ADCINA2 ADCINA1 ADCINA0 Vrefhi VDDA VSSA Vreflo ADCINB0 ADCINB1 ADCINB2 ADCINB3 ADCINB4 ADCINB5 ADCINB6 ADCINB7 GPIO27 CANTX CANRX SCL VSS VDDIO GPIO26 Test2 GPIO9 SDA COU3 Buck regulator 3.3V U3 F28035 PIP7010 PIP709 PIP709 PIP708 PIP708 PIP707 PIP707 PIP706 PIP705 PIP704 PIP704 PIP703 PIP703 PIP702 PIP701 PIP7010 PIP706 PIP705 R11 300K COR11 9 8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 9 PIU1001 PIU1001 PIU1002 PIU1002 PIU1003 PIU1004 PIU1005 PIU1005 PIR1102 PIR1101 10 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 P7 COP7 PIU3026 PIU301 PIU302 PIU302 PIU303 PIU303 PIU304 PIU304 PIU305 PIU306 PIU307 PIU307 PIU308 PIU309 PIU3010 PIU3010 PIU3011 PIU3012 PIU3013 PIU3014 PIU3015 PIU3016 PIU3017 PIU3018 PIU3019 PIU3020 PIU3020 PIU3021 PIU3021 PIU3022 PIU3022 PIU3023 PIU3023 PIU3024 PIU3024 PIU3025 PIU3025 PIU3026 PIU3027 PIU3027 PIU3028 PIU3029 PIU3030 PIU3031 PIU3031 PIU3032 PIU3032 PIU3033 PIU3033 PIU3034 PIU3034 PIU3035 PIU3035 PIU3036 PIU3036 PIU3037 PIU3038 PIU3039 PIU3040 PIU3040 PIU3037 PIU306 C35 10nF COC35 PIR1701 CAN_EN CanTx CanRx TRST NLTRST PIC3502 PIC3501 GND I_measure R17 10K COR17 PIR1702 PIR1702 R15 330K R16 12K COR15 COR16 GreenP-R GreenP-GPIO0 GreenP-GPIO1 GreenP-GPIO2 GreenP-I PIR1502 PIR1501 PIR1602 PIR1602 PIR1601 PIR1502 PIR1601 R12 2.2K R13 2.2K R14 4.7K COR12 COR13 COR14 GND TRST ALERT PIR1401 PIR1202 PIR1202 PIR1201 PIR1302 PIR1302 PIR1301 PIR1402 PIR1402 PIR1401 3.3V GND 12V_sense_measure C52 COC52 2.2uF PIC5202 PIC5201 PIC5202 REGOUT C32 C33 PIP602 PIP604 PIP606 PIP608 PIP6012 PIP6014 COC32 COC33 PIP602 PIP604 PIP606 PIP608 PIP6010 PIP6012 PIP6014 2.2uF 2.2uF C31 2 4 6 8 COC31 PIC3202 PIC3201 PIC3302 PIC3301 PIC3201 PIC3301 10 12 14 GND GND 2.2uF PIL202 PIC3102 PIC3101 PIL202 GND 1 1 1 3 5 7 9 11 13 P6 Header 7X2 COP6 C30 100nF COC30 PIC3002 PIC3002 PIC3001 L2 60 Ohm COL2 BATT+ PIP601 PIP603 PIP603 PIP605 PIP607 PIP607 PIP609 PIP6011 PIP6013 PIP6013 PIP605 R8 10K R9 10K R10 4.7K COR8 COR9 COR10 PIL201 PIL102 PIR802 PIR802 PIR801 PIR902 PIR902 PIR901 PIR1002 PIR1002 PIR1001 PIR1001 3.3V 3.3V 3.3V 3.3V TMS TDI TDO TCK GND L1 60 Ohm COL1 SCL SDA PIL101 3.3V 3.3V B C D A Stellenbosch University https://scholar.sun.ac.za

APPENDIX C. PCB SCHEMATICS 105 B C D A 6 6 Bartho Horn MellowCabs Franshoek South Africa Engineer: 7 1.1 of 2 Revision: Sheet 09:57:09 PM 2 Time: Number: 5 5 Tabloid 2016/11/22 C:\Users\16687817\Dropbox\Meesters\PCB designs\PCB 1.1\PWR524A_FETs.SchDoc BMS Title Size: Date: File: 4 4 3 3 SRP SRN GND 2 2 BATT- BATT+ BATT- NLBATT0 COD31 D31 PID3102 PID3101 1SMA54AT3G C50 C51 10µF 10µF COC50 COC51 PIC5001 PIC5002 PIC5101 PIC5102 PIC5102 - + Input 0 - 60V C0 1 1 B C D A Stellenbosch University https://scholar.sun.ac.za

APPENDIX C. PCB SCHEMATICS 106

C.1.2 Balance Schematic B C A D 4 4 B. Horn Engineer: * * * * * * 1 2 P6 2 way 2.54mm molex COP1 COP3 COP5 COP6 * P1 Power P3 Measure P5 GND of * PIP301 PIP602 PIP101 PIP301 PIP501 PIP601 PIP602 Revision: Sheet PIRT101 PIRT101 t° 09:18:05 PM CORT1 RT1 NTC 10K 1% * PIRT102 PIRT102 NLVsense0nBalance Vsense/nBalance Time: Number: CELL-GND PIR102 PIR202 3 3 C:\Users\16687817\Dropbox\Meesters\PCB designs\BalancePCB\BalancePCB.SchDoc A4 2016/11/22 Balance circuit R1 Res3 0.8K R2 Res3 10K COR1 COR2 PIR201 PIR101 PIR201 PIR101 Title Size: Date: File: 2 1 PID102 PID101 COD1 D1 BAV99 diode 3 PID103 Generic board CELL+ 2 1 PIU302 PIU301 S G NLBlance0Resistor Blance_Resistor D COU3B U3B 3 PIU303 PIU303 2 2 D2 COD2 SM4T6V7AY PID202 PID202 PID201 PIF101 F1 SSQ COF1 PIF102 PIF102 + - NL0 NL0 1 1 B C A D

Figure C.1: Balance schematic Stellenbosch University https://scholar.sun.ac.za

APPENDIX C. PCB SCHEMATICS 107

C.1.3 Current Sense Schematic B C A D 4 4 High current B Horn Battery Output Battery Plus

COU2 U2 ACS758 Current sense Engineer:

* * * * *

1 IP- IP+ 1

Batt_out 1 5 1 NLBatt0out 4 PIH101 PIU205 PIU204 PIH201 H1 H2 COH1 COH2 1 3.1 of Vcc GND VIOUT 1 M6 hole M6 hole 1 2 3 Revision: Sheet PIU201 PIU201 PIU202 PIU203 PIU203 PIF102 PIR702 COC1 C1 2.2uF PIC102 PIC102 PIC101 3.3V 09:24:34 PM COF1 COR7 F1 5 A R7 100 *

PIR701 GreenPHY PIF101 PIF102 NLGreenPHY Time: C2 10nF COC2 GND Number: PIC201 PIC202 PIC202 PID201 PID201 PIF101 D2 SB5100-T COD2 3 3 C:\Users\16687817\Dropbox\Meesters\PCB designs\Current3.1 pcb\CurrentPcb.SchDoc A4 2016/11/21 PID202 PID202 Current Sensor COR6 R6 100 I_measure NLI0measure PIR601 PIR602 Title Size: Date: File: 3 word gedryf deur die 48V(5A fuse). Main_Contact_out gebruik as skakelaar. PID403 PID403 48V(5A fused) NL48V(5A fused) Contactor COD4 D4 BAV99 2 1 PID402 PID401 3.3V GND NLMain0Contact0out NLPre0Charge0out Main_Contact_out Pre_Charge_out Batt_out PIR302 PIR302 2 2 COD1 COD3 D1 D3 SMAJ54CA SMAJ54CA R3 470 COR3 PIR301 PID102 PID102 PID101 PID302 PID302 PID301 GND Driver 3.3V 3.3V GND GND 2 1 2 1 3 BAV99 BAV99 4 3 PIQ103 PID502 PID502 PID501 PID602 PID601 PIQ103 PIU104 PIU104 PIU103 D G S Load Load Q1B D5 D6 COQ1B COD5 COD6 1 2 3 3 + -

COU1 U1 CPC1008N Relay NO Main Contactor Pre-charge Resistor Driver Main_Contact PID503 Pre_Charge PID603 PID503 PID603 NLMain0Contact NLPre0Charge 1 2 PIQ101 PIQ102 C3 COC3 PIR801 PIR901 2.2uF PIU101 PIU102 PIU103 PIC302 PIC302 PIC301 PIC301 3.3V 3.3V PIL102 COR2 R2 1M R8 100 R9 10K COR8 COR9 PIR202 PIR202 PIR201 PIR101 PIR802 PIR902 COR5 R5 3K PIR501 PIR502 L1 Inductor 10mH COL1

R1 10K

COR1 3 PIL101 Main_Contact PIR102 PIQ203 PIQ203 D G S 1 1 Q2B COQ2B 1 2 12V_sense 12V_sense 48V(5A fused) Charge_sense Drive_sense Key _sense Main_Contact_out Pre_Charge_out GreenPHY Key _sense Drive_sense Charge_sense I_measure NLCharge0sense NLDrive0sense NLKey0sense NL12V0sense GND PIQ201 PIQ202 PIQ201 GND PIP101 PIP203 PIP107 PIP107 PIP106 PIP106 PIP105 PIP105 PIP104 PIP104 PIP103 PIP103 PIP102 PIP101 PIP2010 PIP209 PIP209 PIP208 PIP208 PIP207 PIP207 PIP206 PIP206 PIP205 PIP205 PIP204 PIP204 PIP203 PIP202 PIP201 7 6 5 4 3 2 1 9 8 7 6 5 4 3 2 1 10 R4

COR4

1M

Pre_Charge PIR402 PIR402 PIR401 PIR401

P1 7 way 2.54mm molex P2 COP1 COP2

Out connector Out connector In B C A D

Figure C.2: Current sense schematic