ATA6870-DK10 App. Note

advertisement

APPLICATION NOTE

User Guide for Atmel ATA6870 and Atmel ATmega32HVB

Evaluation Kit Hardware

ATA6870-DK10

Features

Evaluation of Atmel

®

ATA6870

Monitoring of 12 battery cells

● Monitoring:

● Overvoltage (every cell)

● Undervoltage (every cell)

● Overheating

● Overcurrent

Open clamp detection

12-bit battery cell measurement

12-bit temperature measurement

Controlling of charge/discharge FETs

Status LEDs for easy evaluation

Charge balancing

Coulomb counting for SOC determination

Figure 1.

Atmel ATA6870-DK10

9228C-AUTO-02/15

1.

Introduction

The Atmel ® ATA6870-DK10 is a demonstration board for the Atmel ATA6870, which offers an easy way to start evaluation of battery applications using the Atmel ATmega32HVB in combination with the Atmel ATA6870. The included software demonstrates implementation of a 12 Cell Battery Management System. The supplied code serves as an example of how to use the Atmel ATMega32HVB and Atmel ATA6870 together. The example is not a complete application intended for use with smart batteries, and it is best to use the devices in a slightly different way in a smart battery application.

2.

Safety Precautions When Using Li-ion Batteries

Please observe the safety guidelines supplied with the batteries. If improperly used or defective, li-ion and polymer batteries and packs may explode and cause a fire.

3.

Demonstration Board

The Atmel ATA6870-DK10 was developed to allow easy evaluation of control software for a microcontroller which controls multiple Atmel ATA6870s. The sample code supplied demonstrates a simple permanent running measurement of voltages and temperatures.

Figure 3-1.

Board Concept

Cell 12

Cell 11

ATA6870

Cell 02

Cell 01

ATA6870

Charge/

Discharge

Control Unit

Monitoring (V,T)

Coulomb counting

ATmega32HVB

2 ATA6870-DK10 [APPLICATION NOTE]

9228C–AUTO–02/15

3.1

System Start

Follow these steps to launch the system.

3.1.1

Installing the Hardware

● Connect the load/charger to be powered between pack+ and pack- on J1

● For demonstration purposes it is possible to use a resistor to simulate a load

● Connect the battery cell stack to the screw connectors on the demonstration board

● Led 1 indicates the enabled status of the demonstration board (controlled by microcontroller SW)

● In case of emulating cells such as a voltage divider, apply sufficient voltage (see

Section 3.3 “Powering the Board” on page 5

)

3.1.2

Number of Cells

It is possible to run the board with a reduced number of cells. The minimum voltage for each IC is 6.9V. Cell 1 and cell 6

(MBAT) have to be connected. The missing cells should be connected to the upper cell potential of the module. For further information refer to the Atmel ATA6870 datasheet Section 7.3: Reduced Number of Battery Cells Configuration. For the voltage range see

Section 3.3 “Powering the Board” on page 5

. If fewer than 6 cells are used per IC, the config.h file should

be adjusted (CELLSIC# under General Setting). See Section 4.1 “Supplied Code” on page 7

for further information on how to configure the supplied software correctly.

3.2

The Demonstration Board

Figure 3-2.

Evaluation Board with 2 Stacked Atmel ATA6870 and Atmel ATMega32HVB

ATA6870-DK10 [APPLICATION NOTE]

9228C–AUTO–02/15

3

3.2.1

On-board Features

The demonstration board includes the following items:

● 2  Atmel ® ATA6870 QFN 7mm  7mm

● Atmel ATMega32HVB

● 12 external N-channel MOSFETs for balancing of battery cells

● Connectors

● ISP connector for programming/debugging the Atmel ATMega32HVB

● Screw connectors for connecting up to 12 battery cells

Table 3-1.

Connector Overview

J7

7

8

5

6

3

4

1

2

9

10

Function

CELL-

PACK-

VFET

GND

OD

OC

RESET

GND

J8

9

10

7

8

5

6

3

4

1

2

Function

VDDHVM

VCC

GND

IRQ

CLK

MISO

MOSI

SCK

CS_N

J1

J2

J3

J4

J9

Connector for charger/device to be powered

ISP connector

Upper battery stack (cells 7-12)

Bottom battery stack (cells 1-6)

Jumper to enable/disable MISO line of Atmel ATA6870

J9 should never be set while the Atmel ATmega32HVB is being programmed or while it is entering debug mode. It can be mounted as soon as AVR Studio prompts for additional SPI lines to be connected in debug mode or after the device has been correctly programmed.

4 ATA6870-DK10 [APPLICATION NOTE]

9228C–AUTO–02/15

Figure 3-3.

Connectors

3.3

Powering the Board

3.3.1

Power Supply

The board supports supply voltages from 13.8V (6.9V per Atmel ATA6870) to 60V. However, to run the board on voltages below 24V the ZDiode D3 needs to be replaced with a jumper to supply the Atmel ® ATmega32HVB with sufficient voltage. If the jumper is mounted, the stack voltage should not exceed 48V! The Atmel ATmega32HVB supports operating voltage from

4V to 24V.

3.3.2

Emulating Cells

Battery cells can be emulated by connecting a voltage divider to the specified clamps.

Section 3.1.1 “Installing the Hardware” on page 3 describes how to connect cells. The voltage limits for this setup are the same as for real batteries.

Section 3.3.1

“Power Supply” on page 5 specifies these limits.

ATA6870-DK10 [APPLICATION NOTE]

9228C–AUTO–02/15

5

4.

Software Description: Monitoring of Up to 12 Battery Cells

The supplied code is documented and easy to adjust for verifying the functions of the Atmel ® ATA6870 and start BMS application development work.

After the board has been connected as described above the microcontroller automatically starts a cyclic measurement of voltages, temperature, and current. LED 1 indicates these cyclic measurements. It toggles in default operation. A continuously illuminated LED1 indicates an open clamp. See

Section 4.2 “Open Cell Check” on page 7

for more information about open clamp detection. LED 2 indicates that for some reason the MOSFETS have been disabled. The default software disables the FETs in case of these events:

● Overvoltage (at least 1 cell exceeds the upper default threshold of 4.2V)

● Undervoltage (at least 1 cell exceeds the lower default threshold of 2.5V)

● Overcurrent (the current through the shunt exceeds the default threshold of 80mA)

● Overheating (the temperature exceeds the upper threshold, default value is 60°C)

● Low temperature threshold (the default threshold is -20°C)

LED 3 indicates whether the Atmel ATA6870s are turned on or not. An active LED indicates that the Atmel ATA6870s are enabled.

Table 4-1.

LED Functions

LED

LED 1

LED 2

LED 3

Function

Indicates clamp is open when permanently illuminated

Indicates cyclic measurements when blinking

On indicates disabled MOSFETs for one of the reasons listed above

On indicates active Atmel ATA6870

The Atmel ATmega32HVB has no clock divider to provide an external slower clock than 1/2 CPU clock. Requirement of

Atmel ATA6870 is f

CLK

> 2  f

SPI

. Hence, the clock frequency of 1MHz is mandatory to provide a 500kHz clock for the ADCs of the Atmel ATA6870 and 250kHz for SPI.

6 ATA6870-DK10 [APPLICATION NOTE]

9228C–AUTO–02/15

4.1

Supplied Code

4.1.1

config.h

This section refers to the config.h file provided in the zip archive with this Application Note. Only values in the User Setting paragraph should be changed!

------------- GENERAL SETTING--------------------------------

CELLSIC# Selecting which Cells are used Bits 0-5 -> Cells 1-6

------------- TEMPERATURE SETTING----------------------------

RES_REF#

T_TLS

Value of the mounted reference resistor (default: 3300)

Temperature belonging to the first Value in the lookup

T_TLE table (index 0, default: -20)

Temperature belonging to the last value in the lookup table (default: 80)

Temperature step size used in the lookup table (default: T_TLSZ

1)

T_LOWERTHRESHOLD Lower temperature threshold

T_UPPERTHRESHOLD Upper temperature threshold

------------- COULOMBCOUNTER SETTING-------------------------

SHUNT_RESISTANCE

RCC_CONVERSIONPERIOD

Value of the shunt resistor in mOhm

The cycle times for the Regular Current Check

0x00 - 256ms (default)

0x01 - 512ms

RCC_DIVIDEDSZ

RCC_CHARGETHRESHOLD

RCC_DISCHARGETHRESHOLD

0x02 - 1s

0x11 - 2s

0x01 to enable divided Voltage (Current) stepsize

Threshold for charging current, exceeding the threshold will turn off the Mosfets

Threshold for discharging current, exceeding the threshold will turn off the Mosfets

Other values should not be changed in the default HW setup!

4.2

Open Cell Check

The implemented function checks for open clamps by measuring the cell voltages two times. During the first check a normal measurement is completed and the values stored. During the second check the voltages are measured while the discharge function for all cells is active. If the two measurements for the same cell differ by more than 100mV it is very likely that one or more cells are not properly connected. The implemented method cannot be used to determine which cell is not properly connected. A continuously illuminated LED1 indicates an open clamp.

4.3

Voltage Measurements

The standard software loop measures the voltage ADC value and the offset ADC value for every cell and checks for overvoltage and undervoltage once per cycle. Further information about the acquiring of voltages can be found in the Atmel ®

ATA6870 datasheet Section 7.5.1. The formula for calculating the voltage:

Voltage (Cell) = 4V

V – V

---------------------------------

3031 – V offset

ATA6870-DK10 [APPLICATION NOTE]

9228C–AUTO–02/15

7

4.4

Temperature Measurements

The default software only measures channel 1 of chip 1. The temperature sensors are based on a resistor divider using a standard resistor and an NTC resistor. This resistor divider is connected to the reference of the ADC for temperature measuring. Because the ADC is sharing the same reference value, the output of temperature measurement with ADC is ratio metric. Further information is found in the Atmel ATA6870 datasheet Section 7.5.3: Temperature Channel.

For this application Atmel recommends using Res_Ref1 = 3.3k

 and RES_NTC1 R25 = 10k  , B = 3435. The software supplied for this board uses these values as default. The function uses a lookup table to determine the temperature. This table has to be edited if an NTC other than the recommended one is used. The values in the lookup table range from –20°C

(index 0) to +80°C (index 100). These values can be edited via the config.h file in the User Settings section. More

Information about this file can be found in

Section 4.1 “Supplied Code” on page 7

. The calculation of RES_NTC is carried out based on the formula provided in the Atmel ATA6870 datasheet Section 7.5.3: adc (out) = 2048

1 +

(RES_NTC(1) + RES_REF(1))

15

10

When using another NTC, the LookupADC.txt has to be edited to match the NTC used.

4.5

State of Charge Measurements

Highly precise SOC measurement is possible by combining the features of the Atmel ATmega32HVB and the Atmel

ATA6870. The coulomb counting feature of the Atmel ATmega32HVB enables highly precise measurements of the change in the state of charge. Frequent reading of the current in a shunt is used to update the SOC frequently. The acquired cell voltages and temperatures can be used to determine the SOC without the Atmel ATmega32HVB. The easiest way is to compare the SOC measured by the added/extracted charge with the calculated SOC using the cell voltage, temperature, and the data provided by the manufacturer of the cells. Further information regarding the coulomb counting ADC as well as an implementation suitable for the Atmel ATmega16HVA is found in Application Note AVR352.

4.6

Overcurrent Protection

The current through the shunt is calculated by measured voltage drop. The limit can be set via the CADRDC/CADRCC register. The step size depends on the settings of the CADCSRC register and the shunt used. For further information about limiting current see the Atmel ATmega32HVB datasheet Section 19.4: Regular Current Detection Operation. The supplied software allows the feature to be tested by adjusting the values in the config.h file. More Information about this file can be found in

Section 4.1 “Supplied Code” on page 7

. Values/part of the code should only be changed if you are aware of possible consequences. The default implementation continuously measures the current and generates an interrupt if the entered thresholds are exceeded. The thresholds are defined in the config.h file. The thresholds are written to the registers in the function CCinit in the Atmel ATA6870_func.c file. Refer to the features of the Atmel ATmega32HVB in the coulomb counter section to learn more about the time the controller waits for the values to be written.

C Code Example

CADRCC = RCC_CADRCC; while(CADCSRA & (1 << CADUB));

CADRDC = RDC_CADRDC; while(CADCSRA & (1 << CADUB));

// Charge Threshold

// Wait values to be written

// Discharge Threshold

// Wait values to be written

8 ATA6870-DK10 [APPLICATION NOTE]

9228C–AUTO–02/15

5.

Features of the Atmel ATmega32HVB

Since the Atmel ® ATmega32HVB is a part of the Atmel AVR ® family which is dedicated to battery management there are several special features such as coulomb counting and the control of the two charge/discharge MOSFETs.

5.1

Coulomb Counter

The coulomb counter ADC runs on a different clock than the CPU. This clock is slower and therefore several things have to be kept in mind before using it. Writing several registers in sequence takes a long time depending on the delays between each write cycle. A possible solution is given in the supplied software example:

C Code Example void CCinit(){

CADRCC = RCC_CADRCC; while(CADCSRA & (1 << CADUB));

CADRDC = RDC_CADRDC; while(CADCSRA & (1 << CADUB));

SETBIT(CADCSRB,1<<CADRCIE); while(CADCSRA & (1 << CADUB));

// Charge Threshold

// Discharge Threshold

// Interrupt Enable

// Voltage Scaling

SETBIT(CADCSRC,RCC_DIVIDEDSZ<<CADVSE); while(CADCSRA & (1 << CADUB));

SETBIT(CADCSRA,((1<<CADEN)|(1<<CADSE)|(RCC_CONVERSIONPERIOD<<1)));

// ADC Enable, RCC Mode, Sampling

// Interval while(CADCSRA & (1 << CADUB));

}

The Update Busy (CADUB) bit in CADSRA is cleared and written by hardware.

5.2

Charging/Discharging FETs

The two FETs are controlled by an N-channel FET driver. The pins (OC and OD) are designed for outputting a high voltage of approx. 13V. The status of the pins is controlled by software via the FCSR - FET control and status register.

C Code Example void Configure_Fet(unsigned char Fet){ if(Fet&0x01)

SETBIT(FCSR, (1<<DFE)); else

CLEARBIT(FCSR,(1<<DFE)); if(Fet&0x02)

SETBIT(FCSR,(1<<CFE)); else

CLEARBIT(FCSR,(1<<CFE));

}

The example above implements an easy method to enable or disable the two FETs independently of each other. For more information, see the Atmel ATmega32HVB datasheet page 148ff.

ATA6870-DK10 [APPLICATION NOTE]

9228C–AUTO–02/15

9

6.

Power Consumption

There are several ways to reduce the power consumption of the Atmel ATA6870 and the Atmel ATmega32HVB. Sleep modes are documented in the datasheet of the Atmel ATA6870 Section 7.1.1 and in the Atmel ATmega32HVB datasheet

Section 10. This board allows the Atmel ATA6870 to be enabled/disabled using the Atmel ATmega32HVB software. The pin

PB2 is used to control a transistor for activating/deactivating the Atmel ATA6870. Other options which are not implemented are the use of interrupts and a timer (sleep between cycles).

10 ATA6870-DK10 [APPLICATION NOTE]

9228C–AUTO–02/15

7.

Schematic

Figure 7-1.

Schematic

J1-1

J1-2

J1-3

J1-4

S

R96 R109

56kΩ

D2

56kΩ

MM3Z13VC

G

Q5

IRF5210SPBF

Q2

MMBT2222A

D

D

S

Q4

IRF5210SPBF

G

D1

MM3Z13VC

R93

56kΩ

PACK+

R94

56kΩ

Q1

MMBT2222A

R10

4.7kΩ

R95

4.7kΩ

J3-1 opt. ext.supply

TP1

Q2

NSS60601MZ4

R12 tbd

D3

BZV55C6V8-TP

R18 nc

R11

J4-7

100Ω

ZXMN2F34FH

R19

R22

R10

J4-6 nc

100Ω

ZXMN2F34FH

T12

T11

R9

J4-5

100Ω

ZXMN2F34FH

T10

R8

J4-4

100Ω

ZXMN2F34FH

T7

R6

J4-3

100Ω

ZXMN2F34FH

R1

J4-2

100Ω

ZXMN2F34FH

T8

T9

CELL+

R34

J3-7

100Ω

ZXMN2F34FH

T18

R33

J3-6

100Ω

ZXMN2F34FH

T17

R32

J3-5

100Ω

ZXMN2F34FH

T16

R31

J3-4

100Ω

ZXMN2F34FH

T13

R30

J3-3

100Ω

ZXMN2F34FH

R29

J3-2

100Ω

ZXMN2F34FH

T14

T15

J4-1

CELL-

R59

1kΩ

R4

10Ω/0.25W

C10

100nF

R58

1kΩ

C11

100nF

R45

1kΩ

C12

100nF

R46

1kΩ

C13

100nF

R47

1kΩ

C14

100nF

R53

1kΩ

C15

100nF

R54

1kΩ

R39

10Ω/0.25W

R25

1kΩ

C16

100nF

R24

1kΩ

C17

100nF

R3

1kΩ

C18

100nF

R5

1kΩ

C21

100nF

R7

1kΩ

C22

100nF

R15

1kΩ

C23

100nF

R16

1kΩ

R26

10/0.25WΩ

+ C1

10μF

30V

R27

C32

100nF

30V

R86

10Ω/0.25W

+ C3

10μF

30V

C19

100nF

30V

9

10

11

12

3

4

1

2

5

6

3

4

7

8

1

2

DISCH5

MBAT5

5

DISCH4

MBAT4

DISCH3

MBAT3

DISCH2

MBAT2

DISCH1

MBAT1

IRQ

CLK

DISCH5

MBAT5

DISCH4

MBAT4

DISCH3

10

11

8

9

6

7

MBAT3

DISCH2

MBAT2

DISCH1

MBAT1

IRQ

12

CLK

IC2

Atmel

ATA6870

IC1

Atmel

ATA6870

R37

150Ω

S

R38

7.5kΩ

G

Q7

SQ2301ES

D

R40

51kΩ

Q6

FMMT620

C38 GND_2

220nF

C6

+ nc (33μF/50V)

GND_2

R41

4.7kΩ

PB2

VDDHVM

PD_N_OUT

POW_ENA

PWTST

BIASRES

TEMPREF

TEMP2

36

35

TEMP1

TEMPVSS

AVSS

AVDD

ATST

28

27

26

25

34

33

32

31

30

29

R55

121kΩ

GND_2

GND_2

GND_2

1

2

3

J5

VDDHVM

PD_N_OUT

POW_ENA

PWTST

BIASRES

36

35

34

33

32

TEMPREF

TEMP2

TEMP1

TEMPVSS

AVSS

AVDD

ATST

25

31

30

29

28

27

26

C24

220nF

C7

+ nc (33μF/50V)

R21

121kΩ

1

2

3

J6

10x1F

5

6

3

4

7

8

1

2

9

10

J7

CELL-

PACK-

VFET

OD

OC

RESET

RSENSE

VDD_HVM

VCC

IRQ

CLK

MISO

MOSI

SCK

CS_N

9

10

5

6

3

4

7

8

1

2

10x1F

J8

Piggypack Board for other Microcontroller

VFET

C5

100nF

50V

R113

RSENSE

PACK-

J9

R89

R99

R91

R100

100Ω

1kΩ

100Ω

1kΩ

C2

C30

C27

R88

1kΩ

+

2.2μF

100nF

100nF

C8

2.2μF

25V

C34

100nF

R2

1kΩ

IC3

ATMEGA32HVB

100nF

C31

OC

OD

14

36

12

13

6

4

11

5

15

35

3

44

43

42

18

1

2

16

37

17

27

VCC

VCC

VREG

VREF

VFET

BATT

VCLMP10

GND

GND

GND

VREFGND

PI

PPI

NI

NNI

NV

OC

OD

PVT

NC

NC

PA0 (ADC0/SGND/PCINT1)

PA1 (ADC1/SGND/PCINT1)

PA2 (PCINT2/T0)

7

8

9

10

PA3 (PCINT3/T1)

PB0 (PCINT4/ICP00)

PB1 (PCINT5/CKOUT)

PB2 (PCINT6)

PB3 (PCINT7)

PB4 (SS/PCINT8)

PB5 (SCK/PCINT9)

PB6 (MOSI/PCINT10)

PB7 (MISO/PCINT11)

29

PC0 (INT0/EXTPROT)

PC1 (INT1)

PC2 (INT2)

PC3 (INT3/SDA)

PC4 (SCL)

PC5

41

PV1

PV2

PV3

PV4

RESET/DW

19

40

39

38

30

31

32

33

34

24

25

26

28

20

21

22

23

PB2

LED1

LED_0603

LED2

LED3

R14

4.7kΩ

D4

LL4148

C24 nc

RESET

R28

R35

R36

CLK

IRQ

CS_N

1kΩ

1kΩ

1kΩ

MISO

SCK

RESET

SCK

MOSI

MISO

1

3

5

3x2M

J2

2

4

6

VCC

MOSI

ATA6870-DK10 [APPLICATION NOTE]

9228C–AUTO–02/15

11

Figure 7-2.

PCB Top

12 ATA6870-DK10 [APPLICATION NOTE]

9228C–AUTO–02/15

Figure 7-3.

PCB Bottom

ATA6870-DK10 [APPLICATION NOTE]

9228C–AUTO–02/15

13

8.

Revision History

Please note that the following page numbers referred to in this section refer to the specific revision mentioned, not to this document.

Revision No.

9228C-AUTO-02/15

9228B-AUTO-10/12

History

 Put document in the latest template

 Section 4.4 “Temperature Measurements” on page 8 updated

14 ATA6870-DK10 [APPLICATION NOTE]

9228C–AUTO–02/15

X X X X X X

Atmel Corporation 1600 Technology Drive, San Jose, CA 95110 USA T: (+1)(408) 441.0311

F: (+1)(408) 436.4200

| www.atmel.com

© 2015 Atmel Corporation. / Rev.: 9228C–AUTO–02/15

Atmel ® , Atmel logo and combinations thereof, Enabling Unlimited Possibilities ® , AVR and other countries. Other terms and product names may be trademarks of others.

® , and others are registered trademarks or trademarks of Atmel Corporation in U.S.

DISCLAIMER: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE

ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS

INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT

SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES

FOR LOSS AND PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS

BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.

SAFETY-CRITICAL, MILITARY, AND AUTOMOTIVE APPLICATIONS DISCLAIMER: Atmel products are not designed for and will not be used in connection with any applications where the failure of such products would reasonably be expected to result in significant personal injury or death (“Safety-Critical Applications”) without an Atmel officer's specific written consent. Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the operation of nuclear facilities and weapons systems.

Atmel products are not designed nor intended for use in military or aerospace applications or environments unless specifically designated by Atmel as military-grade. Atmel products are not designed nor intended for use in automotive applications unless specifically designated by Atmel as automotive-grade.

Download