Application Report SLUA707 – March 2014
1
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
Richard Tang, Andy He Power FAE, MCU FAE / Shenzhen China
ABSTRACT
This application report describes how to use bq76925 and MSP430G2xx2 to implement a high-accuracy digital battery-management solution, which can support a complete pack monitoring, balancing, protection, and gas gauging system for 3 to 6 series cell Lithium-Ion / Polymer battery. This solution is designed to focus on power tool projects, while it can be also a reference design for other similar applications.
Please send questions or comments about this template to Richard Tang (mailto:[email protected]) or Andy He (mailto:[email protected]).
mailto:[email protected]:[email protected]:[email protected]
SLUA707
2 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
Contents 1 Features ........................................................................................................................................ 3 2 Introduction .................................................................................................................................. 3 3 Description ................................................................................................................................... 4
3.1 Major Hardware Functions and Design Guidelines ................................................................. 4 3.1.1 Cell Voltage Sense Circuits ......................................................................................... 4 3.1.2 External LDO .............................................................................................................. 5 3.1.3 SC Protection and Wake-up Circuits ........................................................................... 6 3.1.4 Voltage and Current Measurement ............................................................................. 7 3.1.5 Drivers ........................................................................................................................ 8 3.1.6 Precharge Control ....................................................................................................... 9 3.1.7 Load Removal Detection ............................................................................................. 9
3.2 MCU Software Description ................................................................................................... 10 3.2.1 MSP430G2xx2 Software Flow .................................................................................. 10 3.2.2 Accuracy ................................................................................................................... 15 3.2.3 Low-power Mode ...................................................................................................... 16 3.2.4 Over Temperature (OT) ............................................................................................ 17 3.2.5 Under Temperature (UT) ........................................................................................... 18 3.2.6 Over Current (OC) .................................................................................................... 19 3.2.7 Short Current (SC) .................................................................................................... 21 3.2.8 Over Voltage (OV) .................................................................................................... 24 3.2.9 Under Voltage (UV) ................................................................................................... 25
Appendix A. user.h ............................................................................................................................ 26
Figures Figure 1. Overall Schematic ........................................................................................................... 4 Figure 2. Cell Voltage Sense Circuits ............................................................................................ 5 Figure 3. External LDO .................................................................................................................... 6 Figure 4. SC Protection and Wake-up Circuits .............................................................................. 7 Figure 5. Voltage and Current Measurement ................................................................................. 7 Figure 6. Drivers .............................................................................................................................. 8 Figure 7. Precharge Control ........................................................................................................... 9 Figure 8. Load Removal Detection ............................................................................................... 10 Figure 9. Mainloop Flow................................................................................................................ 11 Figure 10. Measuring Flow ............................................................................................................. 12 Figure 11. Function Flow ................................................................................................................ 14
SLUA707
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2 3
1 Features To implement a high-accuracy digital battery-management solution, bq76925 + MSP430G2xx2 can support a complete pack monitoring, balancing, protection, and gas gauging system for 3 to 6 series cell Lithium-Ion / Polymer battery. This solution is designed to focus on power tool projects, while it can also be a reference design for other similar applications.
2 Introduction The bq76925 is a dedicated analog front end (AFE) for 3 to 6 series cell application that provides 3 analog outputs that allow a microcontroller to easily monitor cell voltage, current, and temperature. Cell voltages are level-shifted, scaled, and multiplexed to the VCOUT pin. Cell current is monitored through a sense resistor placed in series with the cell stack. The voltage across the sense resistor is amplified and driven to the VIOUT pin. The VTB pin supplies a switched bias to stimulate a thermistor network for temperature measurement. The bq76925 supplies a 3.3-V regulated output to power the MSP430G2xx2 and an accurate 3.3-V reference voltage for the MSP430G2xx2 analog-to-digital converter (ADC). The AFE also includes integrated cell balancing FETs that are under control of the MSP430G2xx2. Finally, the on-board comparator of the AFE signals an overcurrent condition to the MSP430G2xx2 for fast fault response.
The MSP430G2xx2 series is an ultra-low-power microcontroller with one built-in 16-bit timer, a fast 10-bit ADC with integrated reference, built-in communication capability using the universal serial communication interface, and up to 24 I/O pins. The architecture, combined with five low-power modes, is optimized to achieve extended battery life in portable measurement applications. The MSP430G2xx2 application circuit is provided to read the analog signals from the bq76925 and let the user create custom firmware based on the application code.
With the AFE of bq76925, the MSP430G2xx2 is evaluated as the host to control bq76925 by I2C of USI module, the MSP430G2xx2 can read the data of analog signals from bq76925 by ADC10.Then the MSP430G2xx2 can easily monitor individual cell voltages, pack current, and temperature to achieve battery charge and discharge management. Although it is only a 10-bit ADC result for the MSP430G2xx2, bq76925 can calibrate it into a high-accuracy value with the particular compensated algorithmic of correction factors. For example, the ADC10 value deviation of cell voltage does not exceed 5 mV, which can strongly make this solution outstanding in this field requirement. To make this solution more competitive, the MSP430G2xx2 is selected for its advantages of low power and low cost.
The user can choose the part number of the MSP430G2xx2 from MSP430G2x32/G2x52, as there are eight part numbers for the different configurations, like flash size, Comparator_A+. More software functions mean more flash size is need. The user can choose the right part number based on the necessary functions of the MSP430G2xx2.
SLUA707
4 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
3 Description This application note, which can help designers evaluate the bq76925 + MSP430G2xx2 battery-management system, discusses the important setup and operation of the module, and contains schematics, bill of materials, and printed circuit board layout. Before designing a battery-management system based on the bq76925 + MSP430G2xx2 solution, designers are advised to read the bq76925 and MSP430G2xx2 data sheet.
3.1 Major Hardware Functions and Design Guidelines
VC5
Q1ZXTP25040DFH
RIN6
47
Q16
BSS84P
Q17
2N7002ELED1/XIN
LED0/XOUT
LED2/COM2
R202K
Q10IRFS3206PBF
C16
1uF/25V
C17 0.1uF/50V
D17LED
D16LED
R27
10M
D18LED
R33 471
R35 471
VC2
R36 471
R522M
R26
100R
R5
3.3K
R7
3.3K
CB1
CIRCUIT BREAKER
1 2
R810K
VDRVPACK+
DVCC
CB10
CIRCUIT BREAKER
1 2
Y1
32768
C20 12p
C14
0.1uF
C2112p
C8
470pF
VIOUT
VCOUT
R10
10K
RIN5
47C9
0.1uF
NTC110K
CIN61uF
THERM
Q11IRFS3206PBF
RIN4
47
C18 0.1uF/50V
RIN3
47
C70.33uF/50V
R28
2.2M
R17
1K
D13
18V
RIN2
47
CIN51uF
PAD4PACK-
11
RIN1
47
Q5BSS84P
R131M
SW1
EVQPE504K
R182.2M
PAD3PACK+
11
Q82N7002ER21 1K
R245.1M
CHG
DVCC
VDRV
D6CD4148WT
MCU
D11CD4148WT
SDA
C22
0.1uF
VC1
R221K
PAD1BATT+
11
SW2
EVQPE504K
CIN41uF
C23
1000pF
R2
100R
+C2
10uF/50V
VC3
Z1AZ23C5V6-7-F
31 2
R42 100R
R44 100R
R481M
R461M
R45 100R
R43 100R
J21
SMBUS
1 23 45 67 89 10
U2 MSP430G2452IPW20
P1.2/A24
P2.210
P1.1/A13
P1.5/A57
P1.0/A02
P1.4/Vref /A46
XOUT/P2.718
DVCC1
P1.3/A35
DVSS20
SDA/P1.715
RST/NMI16
P2.08
XIN/P2.619
P2.19
P2.311
P2.412
P2.513
SCL/P1.614
TEST17
CIN31uF
R12 0
R11 0
C10
DNP
C11
DNP
C510uF
CB3
CIRCUIT BREAKER
1 2
CB4
CIRCUIT BREAKER
1 2
C4
0.1uF
J5
TestPoint
1DVCC SCL
J6
TestPoint
1
DVSS
J10
TestPoint
1
J11
TestPoint
1SDA
J7
TestPoint
1VREF
J12
TestPoint
1THERM
J8
TestPoint
1VCOUT
DISP/LOADCHK
J13
TestPoint
1VIOUT
PRECHG
J22
SBW
12345
SDA
SCL
CB6CIRCUIT BREAKER
1 2
CB7CIRCUIT BREAKER
1 2
DVCC
RST
R4747K
R531M
TCKR41
331
LED3/COM1 D20LED R38 471
CIN21uF
LED1/XIN
CB8CIRCUIT BREAKER
1 2
LED0/XOUT
CB9CIRCUIT BREAKER
1 2
VC4
LED2/COM2
LED3/COM1
RSENS1
0.002/1W 1%
RSENS2
0.002/1W 1%
R34200R
R371M
R31
3.3K R321M
Q13BSS84P
Q122N7002E
D22
MBR0540T1G
D19LED
CB2CIRCUIT BREAKER
1 2
ALERT
DVCC
CB5CIRCUIT BREAKER
1 2
J23
COM
123
J24
TestPoint
1
J2
CON7
1234567
C12
DNP
DISP/LOADCHK
LED2/COM2
J3TestPoint
1
PACK-
J1TestPoint
1
Q4
2N7002E
ALERT
DSG
CHG
PACK+
J15
TestPoint
1
J14
TestPoint
1 LOADADCIN
VC3
J17
TestPoint
1DSG
LED3/COM1
R29
47K
D14
CD4148WT
R30
NA
J4
TestPoint
1
D153.3V
DVCC
J9
TestPoint
1DVSSC19
0.1uF
R4047K
PACK-LOADADCIN
J16
TestPoint
1TCK
J19
TestPoint
1
J20
TestPoint
1RST
TEST
U1
bq76925VC5
4
VSS10
VC63
VC27
BAT2
VC36
SDA18
VCTL1
VC45
V3P320
VCOUT15
VTB16
VC18
SCL19
VC09
SENSEN11
SENSEP12
ALERT13
VIOUT14
VREF17
D1
18V
R1100K
R4100K
Q32N7002E
D718V
Q92N7002E
R9
100K
R161M
Q6BSS84P
R192.2M
Q2BSS84P
R610K
ALERT
PACK-
SCL
VREF
Q72N7002ER23 1K
R255.1M
VDRV
DSG
J18
TestPoint
1CHG
C3
4.7uF/10V
C6
0.1uF
D21
BAT46W
LED0/XOUT
LED1/XIN
LOADADCIN
D5DNP
D8SMBJ28CA
PACK+
C1
0.1uF
VC6
D2
MBR0540T1G
D10MURS120T3
D1218V
ALERT
D4
BZT52C30-13-F
CIN71uF
RIN7
47
J25TestPoint
1
VC0
J26TestPoint
1
J27TestPoint
1
J28TestPoint
1
J29TestPoint
1
Driver improvement
wakeup circuits
Q14
BSS84P
R75
1K
R74
1M
Z512VDC
Q15
BSS84P
R64
200K
R491M
DVCC
PRECHG
Load removal detectionDisplay button detection
DVCC
RST
TEST
J30TestPoint
1
J31TestPoint
1
DVSS
D23SMBJ28CA
TEST
R3 1M
D3BZT52C4V7-7-F
DVSS
C13
1uF
CIN11uF
PAD2BATT-
11
R50
0
R141K
R151K
C15 0.1uF
Figure 1. Overall Schematic
3.1.1 Cell Voltage Sense Circuits
At each cell voltage input port, an RC filter circuit is necessary (as are RIN and CIN in the following circuits), which can filter the input noise to improve the accuracy of cell voltage sense. Considering the internal cell balancing current, input resistor RIN cannot be selected too largely. For example, selected 47-Ω RIN can provide balancing current of about 40 to 50 mA. Moreover, because the pack current will be up to hundreds of amperes when SC occurs, a very large peak voltage exists when SC protection occurs, which may exceed the max input voltage range of the device. One TVS diode D23 can provide good protection for this situation.
SLUA707
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2 5
VC5
RIN6
47
VC2RIN5
47
CIN61uF
RIN4
47
RIN3
47
RIN2
47
CIN51uF
RIN1
47
VC1
CIN41uF
VC3
CIN31uF
CIN21uF
VC4
J2
CON7
1234567
U1
bq76925VC5
4
VSS10
VC63
VC27
BAT2
VC36
SDA18
VCTL1
VC45
V3P320
VCOUT15
VTB16
VC18
SCL19
VC09
SENSEN11
SENSEP12
ALERT13
VIOUT14
VREF17
VC6
CIN71uF
RIN7
47
VC0
D23SMBJ28CA
CIN11uF
Figure 2. Cell Voltage Sense Circuits
3.1.2 External LDO
bq76925 integrates one internal LDO but the drive capability is only 3 mA. To provide enough power to the MCU and external controlling circuits, external LDO is necessary. bq76925 can support the external LDO extension. The VCTL pin can control an external NPN transistor or MOSFET to generate the 3.3-V power supply to bq76925 and other external circuits.
SLUA707
6 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
Q1ZXTP25040DFH
PAD1BATT+
11
R2
100R
+C2
10uF/50V
U1
bq76925VC5
4
VSS10
VC63
VC27
BAT2
VC36
SDA18
VCTL1
VC45
V3P320
VCOUT15
VTB16
VC18
SCL19
VC09
SENSEN11
SENSEP12
ALERT13
VIOUT14
VREF17
C3
4.7uF/10V
D5DNP
D2
MBR0540T1GD4
BZT52C30-13-F
R3 1M
D3BZT52C4V7-7-F
Figure 3. External LDO
3.1.3 SC Protection and Wake-up Circuits
bq76925 integrates a hardware comparator for current sense, which can be used for SC protection. The output of the comparator is the ALERT pin that can be connected to the external interrupt input pin of the MSP430G2xx2. When an SC event occurs, the protection activity can execute most quickly. The ALERT pin is an open-drain structure, so one pullup is necessary just as R8 and D6. Moreover, the ALERT pin can be used to wake up the bq76925 from sleep mode. As shown in Figure 4, R1, R4, R6, R9, Q2, and Q3 form the wake-up circuits that can wake up bq76925 when the charger is plugged in. D6 blocks the high voltage to 3.3-V power supply. The special attention that should be paid is that D21 is mandatory. The ESD structure of the MSP430G2xx2 I/O pin inducts a reverse diode to the VDD pin, which clamps the voltage level of the ALERT pin so that the bq76925 cannot be woken up successfully. Here, D21 is used merely to remove the clamp effect of the internal diode.
SLUA707
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2 7
R5
3.3K
R7
3.3K
R810K
C14
0.1uF
C8
470pF
VIOUT
VCOUT
R10
10K
C9
0.1uF
NTC110K
THERM
D6CD4148WT
SDA
U2 MSP430G2452IPW20
P1.2/A24
P2.210
P1.1/A13
P1.5/A57
P1.0/A02
P1.4/Vref /A46
XOUT/P2.718
DVCC1
P1.3/A35
DVSS20
SDA/P1.715
RST/NMI16
P2.08
XIN/P2.619
P2.19
P2.311
P2.412
P2.513
SCL/P1.614
TEST17
R12 0
R11 0
C10
DNP
C11
DNP
C510uF
C4
0.1uF
PRECHGC12
DNP
DISP/LOADCHK
LED2/COM2
DSG
CHG LED3/COM1
U1
bq76925VC5
4
VSS10
VC63
VC27
BAT2
VC36
SDA18
VCTL1
VC45
V3P320
VCOUT15
VTB16
VC18
SCL19
VC09
SENSEN11
SENSEP12
ALERT13
VIOUT14
VREF17
D1
18V
R1100K
R4100K
Q32N7002E
D718V
R9
100K
Q2BSS84P
R610K
ALERT
PACK-
SCL
VREF
C3
4.7uF/10V
C6
0.1uF
D21
BAT46W
LED0/XOUT
LED1/XIN
LOADADCIN
PACK+
C1
0.1uF
ALERT
wakeup circuits
DVCC
RST
TEST
DVSS
C13
1uF
R50
0
Figure 4. SC Protection and Wake-up Circuits
3.1.4 Voltage and Current Measurement
bq76925 can accurately transfer the cell voltage and current of the AFE to a single-end analog signal. This signal, in turn, can be output to the input channels of the ADC of the MSP430G2xx2. Thereby, the MSP430G2xx2 can accurately monitor the voltage, current, and temperature. Moreover, bq76925 provides a very accurate reference voltage that can be used for the ADC reference. Here, C8 and C14 are used to filter some noise. See Figure 5.
R7
3.3K
R5
3.3K
R810K
C14
0.1uF
C8
470pF
VIOUT
VCOUT
R10
10K
C9
0.1uF
NTC110K
THERM
D6CD4148WT
SDA
U2 MSP430G2452IPW20
P1.2/A24
P2.210
P1.1/A13
P1.5/A57
P1.0/A02
P1.4/Vref /A46
XOUT/P2.718
DVCC1
P1.3/A35
DVSS20
SDA/P1.715
RST/NMI16
P2.08
XIN/P2.619
P2.19
P2.311
P2.412
P2.513
SCL/P1.614
TEST17
R12 0
R11 0
C10
DNP
C11
DNP
C510uF
C4
0.1uF
PRECHGC12
DNP
DSG
CHG
U1
bq76925VC5
4
VSS10
VC63
VC27
BAT2
VC36
SDA18
VCTL1
VC45
V3P320
VCOUT15
VTB16
VC18
SCL19
VC09
SENSEN11
SENSEP12
ALERT13
VIOUT14
VREF17
SCL
VREF
C3
4.7uF/10V
D21
BAT46W
LOADADCIN
ALERT
DVCC
C13
1uF
R50
0
Figure 5. Voltage and Current Measurement
SLUA707
8 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
3.1.5 Drivers
The drivers must solve two problems. One problem is that the driver power must provide enough high voltage and driving capability; the other problem is to ensure that the FETs can be turned on and off quickly enough. Because the controlling signals come from the MSP430G2xx2, the voltage level transfer circuits are necessary. Certainly, the user must also carefully consider total power consumption.
R7, C16, and Q4 generate the driver power supply that avoids cell imbalance by getting the power from the top side of the pack, and also gets the suitable driver power level with the simplest structure. C16 is the buffer capacitor that can provide the dynamic current when the FETs are switched.
Q6, Q7, Q9, R16, R19, R20, and R26 form the discharging controlling circuits. When DSG is high, Q6 and Q7 are turned off and Q9 is turned on to turn off the discharging FET quickly. Special attention must be paid when selecting these resistors. R16 and R19 should not be too small; otherwise, the power consumption will be large. However, it is better to select bigger proportion for R20 and R26. Because the turn-off speed of Q7 is somewhat slow, both Q7 and Q9 are turned on for a short period. The low voltage on R26 must be able to turn off the discharging FET quickly and reliably. If necessary, one 0-Ω resistor can be used. But R20 must ensure enough driving capability.
Q5, Q8, R13, R18, R22, R28, and D11 form the charging controlling circuits. When CHG is high, the driver turned on the charging FET through R22. When CHG is low, Q5 is turned off then the charges on the gate of the charging FET are discharging through R28 to turn off the charging FET. Here, R28 cannot be too large; otherwise, the turn-off time will be too long. D11 is used to block the reverse high voltage when discharging FET is turned off.
R202K
Q10IRFS3206PBF
C16
1uF/25V
C17 0.1uF/50V
R27
10M
R26
100R
CB1
CIRCUIT BREAKER
1 2 VDRVPACK+
Q11IRFS3206PBFC18 0.1uF/50V
R28
2.2M
D13
18V
R17
1K
Q5BSS84P
R131M
R182.2M
Q82N7002E
CHGR21 1K
R245.1M
VDRV
D11CD4148WT
R221K
Q4
2N7002E
PACK+
VC3
Q92N7002E
Q6BSS84P
R161M
R192.2M
Q72N7002E
R255.1M
R23 1KDSG
VDRV
D1218V
Driver improvement
Figure 6. Drivers
SLUA707
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2 9
3.1.6 Precharge Control
Q14, Q15, Z5, R49, R64, R74, and R75 form precharge controlling circuits that can support 0-V charging. When the pack voltage is 0 V, the chip does not work and DVCC is 0 V. When a charger is plugged in at the moment, Q14 is turned on and the pack is charged through R75. If the pack voltage arises up to a certain level, the chip is powered on and DVCC is 3.3 V. The MSP430G2xx2 will work and output high PRECHG signal. The pack continues to be charged through R75. When the pack voltage rises to exceed the threshold of rapid charging, PRECHG outputs low, the precharge path is turned off, and the main charging path is turned on.
Q10IRFS3206PBF
C17 0.1uF/50V
Q11IRFS3206PBFC18 0.1uF/50V
J24
TestPoint
1 R75
1K
Q14
BSS84P
R74
1M
Z512VDC
Q15
BSS84P
R64
200K
R491M
DVCC
PRECHG
Figure 7. Precharge Control
3.1.7 Load Removal Detection
C19, D15, R29, Q16 (optional), and Q17 (optional) form the detection circuits for load removal. When an SCD or an OCD event occurs, the discharging FET is turned off. If the load is still present, the voltage of PACK– is close to that of PACK+. But if the load is removed, the voltage of PACK– drops to 0 V. By checking the voltage of PACK–, the load removal can be detected to release the protection. When the load is present and protection works, the discharging path for the PACK– causes somewhat larger power consumption; Q16 and Q17 can be used to control the detection path. If the detection is finished, the discharging path can be cut off to reduce the power consumption. If Q16 and Q17 are not used, the circuits are simpler but R29 must be larger to limit the discharging current. Moreover, the relevant detection interval must be selected accordingly.
SLUA707
10 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
Q16
BSS84P
Q17
2N7002E
R522M
CB10
CIRCUIT BREAKER
1 2
SW1
EVQPE504K
DVCC
C22
0.1uF
DISP/LOADCHK
R531M
R29
47K
D14
CD4148WT
R30
NAD153.3V
C19
0.1uF
R4047K
PACK-LOADADCIN
Figure 8. Load Removal Detection
3.2 MCU Software Description
The MSP430G2xx2 can monitor individual cell voltages, pack current, battery alert, and temperature, in order to achieve battery charge and discharge management. Basically, the user can set user.h to adjust these parameters of BMS. See Appendix A for more detail on user.h. User can also refer to the following sections for software flow.
3.2.1 MSP430G2xx2 Software Flow
3.2.1.1 Mainloop and Initial
After the Initial loop, the MSP430 keeps running the Measure and Func loop. In the Initial loop, BQ Init is to get the correct factor, which is used for the ADC calibrated in Measuring. There are eight sections for the Measure and Func loop: Alert Measuring, Temp Measuring, Vol Measuring, Cur Measuring, Func Set, Func Ctrl, Func Resume, and Gauging Display. These sections can be defined in two main sections (Measuring and Func); in other words, the MSP430 must monitor the status of cells by Measuring, and then do the charge and discharge management by Func.
SLUA707
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2 11
As for the interrupt-enables in this system, TimerA0 INT is used for the counter to meet the required function delay time, such as LPM keep time, Balance keep time, OC keep time, and so on. Port1 INT is for Alert monitor. ADC10 INT is for ADC sample conversion trigger. USI INT is for I2C communication control.
Figure 9 shows the Mainloop flow.
Figure 9. Mainloop Flow
SLUA707
12 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
3.2.1.2 Measure and Function Loop
Measuring Section
• Alert Measuring monitors whether there is short circuit among the batteries of pack.
• Temp Measuring monitors the temperature for pack.
• Vol Measuring monitors the voltage for each cell.
• Cur Measuring monitors the current for pack.
In the Measuring section, although it is only 10-bit ADC result for MSP430G2xx2, it can be calibrated into a high-accuracy value with the particular compensated algorithmic of correction factors in bq76925. TI does not recommend that users modify the particular compensated algorithmic in Measuring.
Figure 10 shows the Measuring flow.
Figure 10. Measuring Flow
SLUA707
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2 13
Function Section
• Func Set sets the flag for each cell status.
• Func Ctrl controls the cell in the right status by the flag of cells.
• Temp Ctrl protects the pack from OT and UT.
• Cur Ctrl protects the pack from OC and UC.
• Vol Ctrl protects the pack from OV and UV.
• Balance Ctrl balances the cell current when the voltage and offset are both over range.
• Sleep Check Ctrl, lets BQ go to sleep by checking the Min-voltage of cells.
• Open Cell Check Ctrl checks if the cell pack was open in connect.
• LPM Check Ctrl lets the MSP430 go to sleep by checking the idle time.
• Func Resume reset s the flag by the cells status.
• Gauging Display shows the capacity of the pack (increased number of LEDs indicates greater capacity).
To match the different condition of protected mode, the user can also customize the parameter which is defined in user.h (see Appendix A). For example, the threshold value.
Figure 11 shows the Function flow.
SLUA707
14 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
Figure 11. Function Flow
SLUA707
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2 15
3.2.2 Accuracy
A test platform was set up with battery pack to test the measurement accuracy of cell voltage, current, and temperature. We determined the Calculated Value by the MSP430G2 software algorithm. See the following tables.
Cell Voltage
Cell ADC Value
(mV) Calculated Value
(mV) Measured Value
(mV) Delta (mV)
1 2179 3631.7 3636.6 4.9 2 2180 3633.3 3638.2 4.9 3 2179 3631.7 3633.9 2.2 4 2182 3636.7 3640.6 3.9 5 2162 3603.3 3606.8 3.5 6 2188 3646.7 3650.0 3.3
Current
ADC Value
(mV) Calculated Value
(mV) Measure Value
(mV) Delta (mV)
111 13.88 14.67 0.80 366 45.75 46.14 0.39
Temperature
ADC Value
(mV) Measured Value
(mV) Delta (mV) 1068 1065.1 –2.9
SLUA707
16 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
3.2.3 Low-power Mode
Set up the test platform with battery pack. When the system continues to remain in normal mode (there is no OV, UV, COC, DOC, SC, charge current, discharge current, and balance) for longer than a user-defined time, MSP430G2 enters low-power mode (LPM). In LPM, MSP430G2 only keeps the current comparator enabled for SC detection, while turning off bq76925 current amplifier, cell amplifier, thermistor bias, and voltage reference. Then MSP430G2 enter s LPM to save power consumption. Also, LPM is kept for a user-defined time. MSP430G2 does not detect anything during this time and does not wake up until time-out. After wakeup, if there is still no OV, UV, COC, DOC, SC, charge current, discharge current, and balance, MSP430G2 re-enters LPM. If any of these events occur, the system wakes up from LPM.
Current Total Current
(uA) MCU Current
(uA) 925 Current
(uA) Normal 165 115 50
LMP 55 43 12
Ch1 = MSP430 DSG pin, Ch2 = MSP430 CHG pin, Ch3 = Voltage on NTC
SLUA707
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2 17
3.2.4 Over Temperature (OT)
Set up the test platform with battery pack. The system detects the voltage on NTC once in main loop. If the voltage is lower than the OT protection threshold, the system will keep detecting it; after voltage detection exceeds the user-defined times, both CHG and DSG will be off.
Ch1 = Voltage on NTC, Ch2 = MSP430 CHG pin, CH3 = MSP430 DSG pin
SLUA707
18 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
3.2.5 Under Temperature (UT)
Set up the test platform with battery pack. The system detects the voltage on NTC once in main loop. If the voltage is higher than the UT protection threshold, the system will keep detecting it; after voltage detection exceeds the user-defined times, DSG will be on, but CHG will be off.
Ch1 = Voltage on NTC, Ch2 = MSP430 CHG pin, Ch3 = MSP430 DSG pin
SLUA707
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2 19
3.2.6 Over Current (OC)
OC occurs when battery is in discharge (DOC) and in charge (COC), and the protection is different.
• COC: OC in charge
Set up the test platform with a DC source to charge the battery. The system detects the charge current once in main loop. If the charge current is higher than the COC protection threshold, the system will keep detecting it; after charge current detection exceeds the user-defined times, CHG will be off. After 4 seconds in COC protection, CHG will be on again.
Ch1 = Voltage on sense resistor tranferred from Current, Ch2 = MSP430 CHG pin
• DOC: OC in battery discharge
Set up the test platform with battery pack. The system detects the discharge current once in main loop. If the discharge current is higher than the DOC protection threshold, the system will keep detecting it; after discharge current detection exceeds the user-defined times, DSG will be off. If the load is removed in DOC protection, DSG will be on again.
SLUA707
20 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
Ch1 = MSP430 DSG pin, Ch2 = MSP430 CHG pin, Ch3 = Voltage on sense resistor
Ch1 = MSP430 DSG pin, Ch2 = MSP430 load detection pin, Ch3 = Pack–
SLUA707
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2 21
3.2.7 Short Current (SC) Set up the test platform with the real battery. System will detect the discharge current once in main loop, if it is higher than the SC protection threshold, system will keep detecting it and after it exceeds 80 µs, DSG will be off. The SC delay time depends on the voltage on the sense resistor. The higher for the voltage, the less for the SC delay time.
SC threshold is 50 mV, SC delay time is 418 µs, Ch1 = MSP430 DSG pin, Ch2 = Gate of MOS, Ch3 = Voltage on sense resistor current transferred by current
SLUA707
22 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
SC threshold is 50 mV, SC delay time is 90 µs, Ch1 = MSP430 DSG pin, Ch2 = Gate of MOS, Ch3 = Voltage on sense resistor transferred by current
During SC protection, MSP430G2 simply waits for the release condition. If the load is removed, DSG will be on after one main loop time.
Ch1 = MSP430 DSG pin, Ch2 = MSP430 load detection pin, Ch3 = Pack–
SLUA707
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2 23
In LPM, DSG will be off immediately. MSP430G2 will not wake up from LPM until timer-out.
Ch1 = MSP430 DSG pin, Ch2 = Main loop count, Ch3 = Pack–
SLUA707
24 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
3.2.8 Over Voltage (OV)
Set up the test platform with battery emulator of resistance. Adjust the DC source output voltage to higher than the OV protection threshold. The system detects the cell voltage once in main loop. If any cell voltage is higher than the OV protection threshold, the system will keep detecting it; after cell voltage detection exceeds the user-defined times, the OV protection will be enabled to turn off CHG. After OV protection, CHG will remain off. The OV protection, however, will turn on CHG if there is discharge current, and then CHG will turn off again if there is no discharge current.
Ch1 = MSP430 DSG pin, Ch2 = MSP430 CHG pin, Ch3 = Voltage on sense resistor
SLUA707
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2 25
3.2.9 Under Voltage (UV)
Set up the test platform with battery emulator of resistance. Adjust the DC source to less than the UV protection threshold. Use another DC on PACK+ and PACK– to act as the charger. The system detects the cell voltage once in main loop. If any cell voltage is less than the UV protection threshold, the system will keep detecting it; after cell voltage detection exceeds the user-defined times, the UV protection will be enabled to turn off DSG. After UV protection, DSG will remain off. The UV protection, however, will turn on DSG if there is charge current, and then DSG will turn off again if there is no charge current.
Ch1 = MSP430 DSG pin, Ch2 = MSP430 CHG pin, Ch3 = Voltage on sense resistor
SLUA707
26 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
Appendix A. user.h
This appendix provides easy-to-understand explanations of the data in user.h.
// ============================================================================= // Define the operation function for choosing // Defined => Chosen, Undefined => Not chosen // ============================================================================= //#define MSP430_ADC_Cal 1 //Enabled if ADC value need calculated by Gain and Offset //#define ADC_MultSamples 1 //Enabled if ADC need sample for multiple times to get the average value //#define PRE_RELEASE_SAMPLES 1 //Enabled if it is the prereleased samples #define OpenCell_ADCDet 1 //Enabled if open cell need to be detected // ============================================================================= // Define references for measurement calculations // // VREF_NOM : Nominal reference voltage. Set by writing REF_SEL in the CONFIG_2 // register (REF_SEL = 0, 1 => VREF_NOM = 1.5, 3.0). // GVCOUT : Nominal cell voltage gain. Also set by writing REF_SEL in the // CONFIG_2 register (REF_SEL = 0, 1 => GVCOUT = 0.3, 0.6) . // GVSENSE : Current amplifier gain. Set by writing the I_GAIN bit in the // CONFIG_1 register (I_GAIN = 0, 1 => GVSENSE = 4, 8). // FS_CNT : ADC full-scale count. For an 'n' bit ADC, FS_CNT = pow(2,n) - 1. // ============================================================================= #define VREF_NOM 3 #define GVCOUT 0.6 #define GVSENSE 8 #define FS_CNT 1023L // ============================================================================= // Define fault thresholds // // The fault thresholds are transformed using function like macros. The trans- // formation reduces code size by avoiding floating-point arithmetic and // division. // // VC_TRANS(x) : Transforms voltage threshold. 'x' is in Volts. // VI_TRANS(x) : Transforms current threshold. 'x' is in Volts. // VT_TRANS(x) : Transforms temperature threshold. 'x' is in Volts. // ============================================================================= #define VC_TRANS(x) ((unsigned int) (x * GVCOUT * 1000)) //unit mV #define OV_THRESHValue 4.250 // OV threshold in Volts/V #define OV_ResetValue 4.050 // OV Reset threshold in Volts #define UV_THRESHValue 2.800 // UV threshold in Volts #define UV_ResetValue 3.000 // UV Reset threshold in Volts #define PreCHG_Value 2.500 //Cell voltage for Prechange in Volts #define PreCHG_ResetValue 2.600 //Cell reset voltage for Prechange in Volts #define CELL_BalMax 3.500 //Cell max voltage value for balance in Volts #define CELL_BalDif 0.100 //Cell difference voltage value for balance in Volts #define BQSleep_THRESHValue 1.500 // BQSleep threshold in Volts/V
SLUA707
3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2 27
#define BQSleep_ResetValue 1.600 // BQ Reset threshold in Volts #define VI_TRANS(x) ((unsigned int) (x * GVSENSE)) // x*8 #define DOC_THRESHValue 20.000//1 // OC threshold in Volts //2mv 1mohm => 2*8 = 16(A) #define COC_THRESHValue 20.000//1 // OC threshold in Volts //2mv 1mohm => 2*8 = 16(A) #define OC_ResetValue 19.000//1 // OC threshold in Volts //2mv 1mohm => 2*8 = 16(A) #define VT_TRANS(x) ((unsigned int) (x * 1000)) //unit mV #define DOT_THRESHValue 0.469 // DOT threshold in Volts/V, 0.469V->70 degree #define DOT_ResetValue 0.547 // DOT Reset in Volts, 0.547V->65 degree #define COT_THRESHValue 0.855 // COT threshold in Volts/V, 0.855V->50 degree #define COT_ResetValue 0.992 // COT Reset in Volts, 0.992V->45 degree #define UT_THRESHValue 2.475 // UT threshold in Volts/V, 2.475->0 degree #define UT_ResetValue 2.360 // UT Reset in Volts, 2.360V->5 degree #define VL_TRANS(x) ((unsigned int) (x * 1000)) //unit mV #define OL_THRESHValue 2.000 // OverLoad Reset in Volts/V // ============================================================================= // Define Protect condition enable times. // Detect multiple times to confirm the protection start and keep some delay. // ============================================================================= #define UV_EnData 10 //UV detect times to delay confirm #define OV_EnData 10 //OV detect times to delay confirm #define OC_DSG_EnData 10 //Discharge OC detect times to delay confirm #define OC_CHG_EnData 10 //Charge OC detect times to delay confirm #define COT_EnData 10 //Charge OC detect times to delay confirm #define DOT_EnData 10 //Discharge OC detect times to delay confirm #define UT_EnData 10 //UT detect times to delay confirm #define PreCHG_EnData 10 //Pre-Charge detect times to delay confirm #define AL_EnData 10 //Alert detect times to delay confirm #define OpenCell_EnData 90 //Cell open detect times to delay confirm #define OpenCell_Cycle 100 //Cell open detect once in mainLoop times #define OpenCell_CompCycle 200 //Clear once in mainLoop times when keep cell open // ============================================================================= // Define operation parameter. // Set it for the battery-management system requirement. // ============================================================================= #define ADCCur_Idle 3 //ADC current value offset set for charge and discharge confirm #define OCTime_4s 255 //OC flag clear and time for resume from OC, 255*8ms = 2s #define BLANCE_TIME 255 //Set for cell balance time set, 255*8ms = 2s #define CB_LPMKeepTime 2 //Set keeping time in LPM, 125*32ms = 4s #define CB_LPMCount 8000 //Set time to go to LPM when idle, 2000 -> 16S #define LoadCheck_Times 3 //Detect times for load check to confirm #define OpLoad_Interval 60 //ADC margin set for open load check, 60->0.6 mV // ============================================================================= // Define coulometer LED display level. // Set it by cell voltage for reference, it is different from gauge level. // =============================================================================
SLUA707
28 3 to 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
#define V_SOC100 4.180 //Cell voltage set when in 100% coulometer #define V_SOC75 3.800 //Cell voltage set when in 75% coulometer #define V_SOC50 3.400 //Cell voltage set when in 50% coulometer #define V_SOC25 2.800 //Cell voltage set when in 25% coulometer
IMPORTANT NOTICETexas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and otherchanges to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latestissue. Buyers should obtain the latest relevant information before placing orders and should verify that such information is current andcomplete. All semiconductor products (also referred to herein as “components”) are sold subject to TI’s terms and conditions of salesupplied at the time of order acknowledgment.TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TI’s termsand conditions of sale of semiconductor products. Testing and other quality control techniques are used to the extent TI deems necessaryto support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not necessarilyperformed.TI assumes no liability for applications assistance or the design of Buyers’ products. Buyers are responsible for their products andapplications using TI components. To minimize the risks associated with Buyers’ products and applications, Buyers should provideadequate design and operating safeguards.TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, orother intellectual property right relating to any combination, machine, or process in which TI components or services are used. Informationpublished by TI regarding third-party products or services does not constitute a license to use such products or services or a warranty orendorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of thethird party, or a license from TI under the patents or other intellectual property of TI.Reproduction of significant portions of TI information in TI data books or data sheets is permissible only if reproduction is without alterationand is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for such altereddocumentation. Information of third parties may be subject to additional restrictions.Resale of TI components or services with statements different from or beyond the parameters stated by TI for that component or servicevoids all express and any implied warranties for the associated TI component or service and is an unfair and deceptive business practice.TI is not responsible or liable for any such statements.Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirementsconcerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or supportthat may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards whichanticipate dangerous consequences of failures, monitor failures and their consequences, lessen the likelihood of failures that might causeharm and take appropriate remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the useof any TI components in safety-critical applications.In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI’s goal is tohelp enable customers to design and create their own end-product solutions that meet applicable functional safety standards andrequirements. Nonetheless, such components are subject to these terms.No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the partieshave executed a special agreement specifically governing such use.Only those TI components which TI has specifically designated as military grade or “enhanced plastic” are designed and intended for use inmilitary/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI componentswhich have not been so designated is solely at the Buyer's risk, and that Buyer is solely responsible for compliance with all legal andregulatory requirements in connection with such use.TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use ofnon-designated products, TI will not be responsible for any failure to meet ISO/TS16949.Products ApplicationsAudio www.ti.com/audio Automotive and Transportation www.ti.com/automotiveAmplifiers amplifier.ti.com Communications and Telecom www.ti.com/communicationsData Converters dataconverter.ti.com Computers and Peripherals www.ti.com/computersDLP® Products www.dlp.com Consumer Electronics www.ti.com/consumer-appsDSP dsp.ti.com Energy and Lighting www.ti.com/energyClocks and Timers www.ti.com/clocks Industrial www.ti.com/industrialInterface interface.ti.com Medical www.ti.com/medicalLogic logic.ti.com Security www.ti.com/securityPower Mgmt power.ti.com Space, Avionics and Defense www.ti.com/space-avionics-defenseMicrocontrollers microcontroller.ti.com Video and Imaging www.ti.com/videoRFID www.ti-rfid.comOMAP Applications Processors www.ti.com/omap TI E2E Community e2e.ti.comWireless Connectivity www.ti.com/wirelessconnectivity
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265Copyright © 2014, Texas Instruments Incorporated
http://www.ti.com/audiohttp://www.ti.com/automotivehttp://amplifier.ti.comhttp://www.ti.com/communicationshttp://dataconverter.ti.comhttp://www.ti.com/computershttp://www.dlp.comhttp://www.ti.com/consumer-appshttp://dsp.ti.comhttp://www.ti.com/energyhttp://www.ti.com/clockshttp://www.ti.com/industrialhttp://interface.ti.comhttp://www.ti.com/medicalhttp://logic.ti.comhttp://www.ti.com/securityhttp://power.ti.comhttp://www.ti.com/space-avionics-defensehttp://microcontroller.ti.comhttp://www.ti.com/videohttp://www.ti-rfid.comhttp://www.ti.com/omaphttp://e2e.ti.comhttp://www.ti.com/wirelessconnectivity