Battery management system on electric bike using lithium-ion 18650

Received Sep 29, 2018 Revised Jan 27, 2019 Accepted Mar 13, 2019 Electric bike (E-Bike) is a bicycle driven using an electric motor and uses batteries as the energy source. It is environmentally friendly as no exhaust gas is resulted during its operation. More than one battery is normally required, being arranged in series or in parallel connection. Over limit or overloaded conditions of battery usage will reduce the lifecycle of battery, speed up its replacement and add to the maintenance cost of electric bike. This paper proposes the prevention of such degrading condition using a tool to manage the battery usage both during the charging and discharging process. The proposed electronic Battery Management System (BMS) serves to regulate, monitor, and maintain the condition of batteries to prevent any possible damage. The resulted BMS design could provide a well balancing action in a battery system consisting of 13 cells utilizing the cell-to-cell active balancing method. The test results showed that the proposed BMS could monitor the individual cell voltage with an average error of 0.032 V (0.824%), while reading the charge and discharge current with an average error of 0.04 A (6.25%), and the battery pack temperature with an average error of 1.21oC (2.9%). Additionally, the BMS could offer a functional battery pack protection system from conditions such as undervoltage, overvoltage, overheat, and overcurrent.


INTRODUCTION
Battery which is normally used to compose the battery pack in an electric bike (E-Bike) is lithiumion 18650 [1][2][3][4][5][6][7][8]. It has a nominal voltage of 3.7 V and a capacity which varies between 2000 mAh -3000 mAh. The main reason for the use of lithium-ion battery is due to its high energy density [9]. Battery packs as an energy source on electric vehicles such as E-Bike are composed of a number of Li-ion batteries arranged in series and parallel to obtain high voltage and capacity [10][11][12][13][14][15]. For safety consideration and to reach a long life-time, each cell in a battery pack needs to be in the same energy condition [16,17]. Once there is a cell with a prohibited condition (overvoltage, undervoltage, overcurrent, overheat), the charging and discharging process must be stopped immediately. In addition, all cells in the battery series must be kept at the same voltage level, which is called as 'balance'. If they are in 'unbalance' condition, the protection system will stop the charging or discharging process. When only one cell of the battery pack is in an overvoltage or undervoltage condition while the other cells are in a safe condition, the overall battery pack performance will decrease [18][19][20][21]. To overcome this problem, the balancing process is carried out on the battery pack, using two basic methods, either passive or active balancing [21]. The passive method, which is cheap and whose mechanism is easy even though not efficient, is implemented by releasing the energy from each cell into a resistor until the voltage reaches the equal value as the smallest cell's voltage [22][23][24]. The active method is realized by releasing the energy of the cell with the largest voltage into the one with the smallest voltage until reaching the same voltage on each cell. This method is more expensive because it requires complex components, complicated mechanisms, but with more energy efficiency [24][25][26][27].
BMS (Battery Management System) is a device employed to monitor battery's voltage and current, and it performs battery pack balancing system to protect the battery from damage [3,6,7,16,17]. The BMS presented in this paper uses the active balancing method with a cell-to-cell balancing mechanism and series capacitor inductor circuit (resonant LC) as energy transfer media. The resonant LC circuit contains inductors and capacitors arranged in series, utilizing the charging and discharging process of the capacitors as temporary energy storage and the inductors as balancing current suppressors [11]. The resonant frequency of the LC circuit is the frequency that causes the maximum current and voltage amplitudes in the circuit because the inductor's and capacitor's impedance values are the same but at different phases (ZL = ZC).

BMS DESIGN
The active balancing method with a cell-to-cell balancing mechanism and series capacitor inductor circuit (resonant LC) as energy transfer media to be adopted in the BMS design is shown in Figure 1 [11], whereas the related schema consisting of several sub-modules is illustrated in the block diagram of Figure 2. The BMS design is to be implemented on a battery pack consisting of 52 Li-Ion batteries in a 13series, 4-parallel arrangement with a nominal voltage of 48.1 volts, a maximum voltage of 54.6 volts, and a total capacity of 10 Ah.

Design of voltage sensor
The voltage sensor circuit design shown in Figure 3 uses the principle of a voltage divider. A potentiometer of 100kΩ is added with an N-Mosfet 2N7000 as a battery selector and a CD74HC 16 analogue multiplexer to connect to the analog-to-digital conversion (ADC) pin contained in the ATMega 2560 microcontroller. By knowing the total voltage of the battery pack at each level, the voltage of each cell can be determined by the reduction of it.
The voltage divider circuit uses a linear trimpot with a value of 100kΩ, which is installed on each cell of battery series, as specified in Figure 3. The ratio of potentiometer values is calculated so that the maximum Vout of each battery pack level is not more than 4.5 volts in order not to exceed the Vin limits of multiplexer and ADC. The calculation results are given in Table 1.
. Ω  The algorithm used in the microcontroller utilizes the process of reading the voltage sensor as shown in the flowchart in Figure 4.

Design of current sensor
The current sensor used is IC ACS712 30A. This sensor can measure currents with a range of 30 A to -30 A with a sensitivity of 66mV/A and Vout at 0A current is 2.5 volts [5]. The output of this current sensor is connected to the ATMega 2560 ADC pin which has a resolution of 10 bits, and the reading process is programmed every 1 second to find out the battery capacity. The current sensor used is only 1 piece and is placed between the battery pack and the charger/load. The current sensor circuit used is shown in Figure 5.

Design of temperature sensor
The temperature sensor used is the LM35 IC with 10mV/ o C sensitivity and the reading range is -50 o C to 150 o C. This temperature sensor has 4 pieces which are placed on each side of the battery pack, and the sensor output pin is connected directly to the ATMega 2560 pin ADC microcontroller which has a 10-bit resolution.

Design of the cells balancing circuit
The cell balancing circuit being used as an energy transfer medium is an LC series circuit with a switching mechanism at the LC resonance frequency in order to make the energy transfer more maximal. The inductor value is determined as small as possible, i.e. of 33 uH, so the capacitor value can be calculated using (2) with a determined value of 220uF in order to obtain an underdamping response. By using (3), the circuit resonance frequency of 1.8 kHz is obtained. The switching mechanism is carried out by connecting the cell with large voltage to an LC series circuit to store its energy, and then connecting the LC series circuit to the cell with low voltage to release the stored energy. The switching circuit uses a 2-way switch concept which means that the switch can flow in 2 directions, as shown in Figure 6. As shown, the circuit uses two components of N-channel MOSFET IRF540 in series, except the uppermost cells series which uses P-channel MOSFET IRF9540. The PC817 optocoupler is used as the MOSFET driver, and the optocoupler input is connected to the ATMega 2560 microcontroller digital pin to select the cell to be balanced. The entire balancing circuit is shown in Figure 7.

Design of protection circuit
The purpose of the protection circuit is to disconnect the power lines between the battery and the load using a 30 Ampere relay and fuse as shown in Figure 8. Fuse is useful for preventing component damage when a sudden overcurrent occurs. Fuse is used because it has a faster response time compared to relay. Relay on the other hand is used because it decides the path mechanically to prevent overvoltage, undervoltage, overheat, overcurrent conditions. Relay is activated through ATMega 2560 pin digital based on information from voltage sensors, current sensors and temperature sensors.

Software development
The software development has been done using C-language (Arduino IDE). The sequence of operational instructions has been uploaded into the ATmega 2560 microcontroller.

Voltage sensor testing
This test was aimed to measure the cell voltage of each battery in the battery pack which is composed of 13 series. The results are given in Table 2.  Table 2, it is known that the pack voltage state had a maximum difference of 0.14 V for the 8 th battery pack with an average difference of 0.054 V, and for the maximum cell voltage difference of 0.09 V for the 13 th battery cell with an average difference of 0.032 V.
The reading error occurred because of the voltage drop on the MOSFET and multiplexer, the voltage reading error of 0 volt, and the accuracy of the potentiometer value used to calculate the voltage value in the program. The method of calculating cell voltage by knowing the voltage of the pack being followed with the calculation of the related difference was prone to errors, because the error reading voltage of the pack would affect the reading of the cell's voltage and also the following steps.

Current sensor testing
Current sensor testing was carried out during the charging process using a battery charger and the battery discharging process using a resistor.
The testing results of ACS712 sensor output voltage are given in Table 3. It indicates a linear characteristic to current with a sensitivity of 66mV/A and the output voltage is 2.5 V at the current of 0 A. Using the straight-line equation approximation, the sensor output voltage function has been obtained.
The maximum difference of the ACS712 30A sensor current reading was 0.16 A, with an average error of 0.04 A. The error of the current sensor reading occurred because the sensor output error itself was 1.5% at 25 o C and the ADC resolution was used.
Testing the reading time of current sensor was done using the millis function available on the microcontroller to ensure whether the current sensor reading had been performed every 1 second. From Table  4, it can be seen that the current sensor reading process was carried out every 1 second with a minimum error of 1 millisecond and a maximum error of 104 milliseconds.

Temperature sensor testing
Testing the temperature sensor was done by comparing 4 temperature sensors with a digital thermometer TP3001, placed on the heater by conduction. Test results of 4 temperature sensors are shown in Table 5, whereas the related characteristic obtained is given in Figure 9.
From the results shown, it is known that the difference in measurement of the largest temperature occurred in sensor 2 of the 7 th measurement which was equal to 5.7 o C. The average sensor 1 difference was 1.58 o C, sensor 2 was 2.1 o C, sensor 3 was 1.88 o C, and sensor 4 was 1.5 o C. Figure 9 shows that there was a small difference between the characteristic curve of the sensors and that of the digital thermometer, with a maximum difference of 2.5 o C of the 7 th measurement.  Figure 9. Temperature sensor characteristic

Cells balancing circuit testing
Testing the cell balancing circuit was carried out between the two highest-voltage batteries with the lowest-voltage battery. The results are given in Table 6.  Figure 10. Output signal The balancing process took 6 hours to reduce the difference between the strong and weak battery voltage from 0.46 V to 0.336 V with effective balancing current of 22.5 mA.
In Figure 10, the yellow signal indicates the signal of the MOFET switch which connected the higher voltage battery to the series LC circuit. The blue signal indicates the capacitor voltage signal, whereas the red signal was the current signal flowing in the capacitor. When the MOFET switch logic was High, the capacitor voltage roses to 4.04 V, which means there was charging on the capacitor with a current of 24 mA. When the MOFET switch logic was Low, the capacitor voltage dropped to 3.84 V, which means discharging the capacitor with a current of -24 mA.

Protection circuit testing
This test was conducted to find out the protection system in the form of relay working according to the conditions of the battery. The conditions which needed to be protected were undervoltage, overvoltage, overheat, and overcurrent. Undervoltage and overvoltage tests were carried out using a variable voltage source, whose limits could be set. The undervoltage limit was 2.75 V while the overvoltage limit was 4.2 V. The observation during experiment showed that the undervoltage protection and overvoltage protection were working by interrupting the relay when it exceeded the voltage limit.
Overheat testing was done using a heat source which could be adjusted, with the temperature limit was under 45 o C. The experiment brought to a conclusion that the overheat protection system worked by interrupting the relay when the temperature was above 45 o C.
Overcurrent testing was carried out during charging and discharging conditions with a current limit set to 1A when charging and 4A during the discharging process. Charging process was tagged by a positive current, whereas during the process of discharging, the current flew negatively. From experiment, it could be concluded that the overcurrent protection system worked well during the charging and discharging process with the relay disconnected when it crossed the line.

CONCLUSIONS
The analysis of results obtained from the experiment in this research brings to some conclusions that the designed BMS could monitor the voltage of individual battery cell in a pack with an average error of 0.032 V (0.824%), the charging and discharging currents of battery pack with an average error of 0.04 A (6.15%), and the temperature of the battery pack with an average error of 1.21 o C (2.9%). The constructed BMS also could provide the protection when an undervoltage, overvoltage, overheat, or overcurrent condition occured. The active balancing could be well achieved using the designed BMS, with the voltage difference between the strong battery and weak battery reaching 0.336 V within 6 hours.
It is also to be suggested that in the future the voltage readings use a differential ADC IC so that it would not require a resistor which could absorb energy. Addition of series LC circuit could also be made, so that two balancing processes could occur at once to accelerate the balancing time.

BIOGRAPHIES OF AUTHORS
Soeprapto was graduated in electrical engineering from Brawijaya University, Indonesia and got his master degree in electrical engineering from Sepuluh Nopember Institute of Technology in Surabaya, Indonesia. She joined the Electrical Engineering department at Brawijaya University, Indonesia in 1989 where she is currently the head of Power Electronics Laboratory. Her research interests include power electronics, electric drives and renewable energy, especially electric bikes and rooftop photovoltaic power generation and its integration into power grids.
Rini Nur Hasanah was graduated in electrical engineering from Bandung Institute of Technology -Indonesia, got her postgraduate master degree in energy from the Swiss Federal Institute of Technology in Lausanne (EPFL), Switzerland, and got her doctoral degree from the same university. She joined the Electrical Engineering department at Brawijaya University, Indonesia in 1995 where she is currently the Chair of Electrical Power Engineering Section. Her research interests include electrical machines and drives, power electronics, rural electrification, renewable energy, energy management, and power systems.
Taufik received his Doctor of Engineering from Cleveland State University. He joined the Electrical Engineering department at Cal Poly State University in 1999 where he is currently a tenured Full Professor and the Director of Electric Power Institute. He received numerous teaching awards, most notably the 2012 Outstanding Teaching Award from the American Society of Engineering Education -Pacific Southwest Section. He is a Senior Member of IEEE and has industry experience with several international companies. His areas of research include power electronics, power systems, rural electrification, energy harvesting, renewable energy and smart grid. He has published over 200 technical papers and journals, reports, books, course readers, and served on the editorial review boards of several journals.