Design and Implementation of Software Calibrated Lead-Acid Monitoring System for Electric Motorcycle

Abstract: The electric motorcycle development rapidly in recent years. The electric motorcycle usually uses battery pack consisted of 4~6 lead-acid cells. A battery management system for lead-acid batteries will effectively improve the life length of the battery pack. A high precision of cell monitoring is necessary to SOC estimation. Monitoring schemes are usually too costly for mass production. In this paper, a low cost high precision cell voltage and current monitoring scheme is introduced. We use the voltage divide circuit to monitor the cell voltage, and manganin resistor was used to measure the current. They both software calibrated to improve the precision. The system was fully tested and the precision of monitoring meets the demand of further SOC estimation.


Introduction
Electric motorcycle generally use 4~6 lead-acid cells (12V) in series to form a 48V~72V battery pack for electric motorcycle power supply.General electric motorcycle are not equipped with battery management system (BMS), users can't know the exact state of the battery.
It is not easy to monitor the single cell voltage due to the series connection.The common scheme of cell voltage monitoring include: BMS chip monitoring [1], switching polling monitoring [2], master-slave multi module monitoring [3,6].All schemes mentioned above can guarantee high monitoring accuracy.BMS chip is generally suitable for low voltage battery (0~5V) monitoring.It do not suitable for high voltage lead-acid batteries.The cost of using PhotoMos to build a switching polling is higher.The structure of the master-slave module is complex, and it is not suitable for the occasion of 4~6 cells.
In terms of current monitoring, there are two schemes widely used.One is to use the hall effect of the current to test [7].The second is consisted of the sampling resistance and the conditioning circuit [8].Hall current sensors are generally expensive and unsuitable for the system.The second schemes have high requirements for the signal amplification, and are difficult to realize.
This system uses divider circuit to measure the cell voltage.The current is measured using a sampling resistor with an amplifier circuit.The voltage monitoring circuit and current monitoring circuit are calibrated by software.A high precision measurement is achieved, in the case of cost control.

Battery Monitoring System Hardware Design
The hardware of the monitoring system includes several functional modules, including: power supply circuit, current conditioning circuit, voltage conditioning circuit, CAN communication circuit and MCU circuit.The main function of the voltage monitoring circuit and current conditioning circuit  Because every single cell is connected in series, the cell voltage can't be directly step down and sampled.So we step down the every series node voltage.And the cell voltage can be calculated by subtraction between two series node voltage.One of the node voltage divider circuit diagram is shown in Fig. 2.

Fig. 2 One of the divider circuit diagram
The system adopt STM32F103ZET6 as microcontroller which provides multichannel 12bit A/D convertor.With reference voltage 3.3V, the theoretical voltage resolution is 3.3V/4096 ≈ 0.8mV.As shown in table 1 the min voltage divide ratio is r = RL/( RL+RH) = 36/(1000+36) = 36/1036.So we can draw that the worst cell voltage monitoring resolution is 0.8mV/r ≈ 23mV.

Current Conditioning Circuit
This monitoring system uses high stability manganin resistor as current sensor which has low temperature drift (<50ppm/℃) and high precision (error<1%).The current signal is amplified before sampled by MCU.The current amplifying circuit diagram is shown in Fig. 3. Low cost OP-LM358 is used due to the high performance price ratio.

Fig. 3 Current signal amplifying circuit diagram
It is easy to draw the theoretically current conversion equation-Eq. 1 from Fig. 3.The sensor resistance value is 2mΩ, the current monitoring range is -25A~25A, them the voltage drop on sensor resistor range -50mV to 50mV.According to Eq. 1, V cur_sample range to 0~3.3V theoretically.And because of the 12bit A/D, the current monitoring resolution is 50A/4096 ≈ 0.012A. (1)

CAN Communication Circuit.
The system send battery monitoring data via CAN bus.Both communication and power supply are isolated from the monitoring system to ensure the stability of data transmission.The CAN driver can provide up to 5KV voltage isolate, while the isolated power module provide 1KV, therefore the max isolation voltage is 1KV which fully meet the needs of electric motorcycles.The CAN circuit diagram is shown in Fig. 4. The whole monitoring system is powered by the battery pack.The stability of the power system and voltage reference influence the monitoring directly.As shown in Fig. 5, the DC/DC convert circuit step-down the battery pack voltage.And linear s regulator is used to stable the power voltage.Otherwise, high-precision voltage reference chip is used as system voltage reference.

Calibration Software Design
The monitoring resolution is ensured by hardware design.However, due to the discrete parameters of components, the monitoring system still suffer from low accuracy.Software calibration is used to reduce monitoring error.
As shown in Fig. 6 the A/D value converted by MCU is linear with the actual voltage and current value.We use two point calibration method to calibrate the voltage and current monitoring, and calculate the actual relationship between A/D value and actual value.
The calibration process contains the following steps.Firstly, the actual cell voltages/current would be measured by high-precision multimeter and record on PC Calibration Software.Secondly, we connect the monitoring circuit to the battery pack.The system would sample the A/D values of conditioning circuits.Thirdly, after clicking the send button, the PC software would send the actual cell voltages to the monitoring circuit.We use USB-serial circuit module to connect PC with monitoring circuit.Monitoring data is displayed on the PC software, and calibration command would be sent by clicking the appropriate button.Fig. 7 shows the software process of PC software.

Fig. 4 PC calibration software
There two main thread on PC software.The "Display Thread" deal with data receiving, and display monitoring data on software interface.The "Calibration Thread" send the actual data to the monitoring circuit.Fig. 8 shows the design of PC calibration software user interface.After receiving the calibration command sent by PC, MCU calls the UART data processing function to deal with calibration request.As shown in Fig. 9. Firstly, the data frame would be checked.Then the actual monitoring value can be extracted and written into flash.At the mean time, the corresponding A/D channel value was stored.Finally, after two sets of calibration command has been received, the actual equation can be calculate.(2) 3.3.Monitoring Software.
After the calibration has been done, the software would calculate voltage/current by the calibrated equation instead of theoretical equation.And monitoring data would be send to front panel board by CAN bus.Fig. 10 illustrates the monitoring loop.From Fig. 13 We find out that there is a bias voltage on current conditioning circuit.And the software corrected the bias.The practical magnification is figured out, so that the measurement error doesn't increase with the increase of current.

Conclusion
After assembling and testing, the battery monitoring system can be applied to the monitoring of lead-acid batteries for electric motorcycles with 6 12V series battery.The cell voltage error is less than 50mV.A current monitoring scheme for motorcycle with less current monitoring error has been Designed and implemented.
is to convert cell voltage and current to 0~3.3V voltage signals.The voltage and current signals are sampled and processed by MCU to obtain the voltage and current values.The CAN communication circuit is composed of MCU internal CAN controller and external CAN driver to send the battery monitoring data [9].The power supply circuit provides power supply and reference source for each function circuit module.The hardware framework is shown in Fig. 1.

Fig. 5
Fig. 5 Power supply circuit diagram Finally, repeat the previous steps with another battery pack of different cell voltage/current.The MCU would figure out the precise relationship equation between A/D value and the actual voltage.

Fig. 6
Fig. 6 The theoretical relationship between A/D value and voltage/current 3.1 PC Calibration Software Design.

Fig. 8
Fig. 8 PC calibration software interface 3.2 MCU Calibration Software Design.

Fig. 9
Fig. 9 UART data processing function The actual equation can be assumed to be Eq.2.V ad is the A/D value.X is the actual cell voltage/current.The parameter a, b is unknown.After two sets of data has been obtained, we can list Eq.3.And the parameter a, b can be figure out by Eq. 4. b V X    ad a .(2)

Fig. 11
Fig. 11 Battery Monitoring System Testing During the operation of the electric motorcycle, the voltage and current accuracy of the system is tested.The actual battery date is measured by multimeter (Agilent 3441A).The monitoring error is shown in Fig. 12 and Fig. 13.

Table 1
Divide ratio of every channel