📜 ⬆️ ⬇️

Development of an external battery on four LiFePO4 batteries


Simplified diagram BQ40Z50-R1

External batteries (power banks) are actively used to charge smartphones and other mobile gadgets. This device is simple in structure: lithium-ion or lithium-polymer batteries, control circuit board, housing. But by itself, the development of charging circuits for external batteries and electric vehicles is not so simple, here you can experiment and propose new solutions.

Within one project, we developed an external battery with support for normal and fast charging, including solar batteries. Another requirement is to minimize the dimensions of the device. At the first stage, we implemented the usual charging of four identical LiFePO4 batteries at the expense of the microcontroller and the BQ40Z50-R1 charge manager, without using a specialized charge chip and PWM. In addition to the charge, the microcontroller beautifully controls the indicator LEDs and interacts with the user via BLE. We share the details of this development stage.

Problem statement and solution


For chargers, one of the important parameters is the use of batteries with a certain type of chemistry. Taking into account the fact that the LiFePO4 lithium-iron-phosphate battery has several advantages compared to other varieties (for example, the ability to charge a large current), it was chosen for the new charger.
')
Typically, the specified parameters of the battery is achieved through the use of several batteries of lower capacity and voltage. The purpose of using batteries with a serial connection is to reduce losses, increase efficiency. Usually in any system consisting of several series-connected batteries, there is the problem of unbalancing the charge of individual batteries. This problem is solved by battery charge leveling - a design method that allows you to increase battery safety, battery life, and overall service life.

To reduce the cost and size of the new charger, it was decided to use the BQ40Z50-R1 chip from Texas Instruments as a “charger” and “balancer” for four LiFePO4 batteries, despite the fact that this is a microcircuit - manager, not “charger” (t. E. It can control the parameters of voltage, current, etc., but not control the process of charge). For details on the BQ40Z50-R1, see the technical specifications and reference .

Battery parameters:


To program the BQ40Z50-R1 chip, we used the specialized software package Battery Management Studio ( bqStudio ) and the EV2300 interface board — all of these are tools for developers from Texas Instruments. The task of bqStudio is to generate the correct settings for the BQ40Z50-R1 manager so that it “befriends” with the battery used.

Circuitry


As already noted, the BQ40Z50-R1 chip is a charging manager that is used to monitor battery charge / discharge parameters, as well as set up various battery charge / discharge algorithms depending on current parameters (for example, temperature, charge / discharge current, etc.) .

Chip developers have provided the possibility of active charge mode and mode with current limit (Pre-charge), which is used when the battery is completely discharged. The circuit design of the device does not change (see the specification ). It is only necessary to recalculate the current-limiting resistor in the Pre-charge circuit. In our case, to charge the selected batteries, LiFePO4 needed a charging current of about 400 mA.

Setting up the chip BQ40Z50-R1


The BQ40Z50-R1 is configured using the bqStudio software package. We use the SMB to USB converter to record the set parameters and communicate with the microcircuit:


EV2300 Programmer

We will not describe the connection itself, since about him in detail in the technical specifications and reference. As a result, the program should start as shown in the screenshot:


Interface of the Battery Management Studio program (bqStudio)

Let us tell you about the steps for setting up the BQ40Z50-R1:

1. Selecting a similar battery chemistry profile (Chemistry Programming)

When installing the program, the Chem.ini file is present in the package, which describes more than 1,000 types of batteries, different in chemical composition, capacity, number of cells, and other criteria. Texas Instruments constantly updates the list of chemical parameters of batteries from various manufacturers. But if the desired battery is not in the list - it doesn't matter, the chemistry parameters can be set manually. In order for the charger to work correctly, you need to select the battery profile that is most suitable for development and click the Update Chemistry from Database button:


BqStudio window interface to select chemistry profile

2. Calibration

First of all, we report to bqStudio the current state of affairs, which requires measuring the real values:


Measured parameters are entered into the program and press the "Calibrate" button.

3. Settings

Then we connect the necessary functions:


4. Advanced Charge Algorithm

This mode of operation is embedded in the BQ chip. An external microcontroller can enable and use this mode to control charge current, voltage, and other charge parameters. The BQ40Z50-R1 chip will carry out all measurements, analysis and calculation of the charge parameters required for the battery and send recommendations to the microcontroller on the SMBus bus. BQ can also control external keys for switching modes and charging currents and protection. To use this mode correctly, it is necessary to make a number of settings: currents, voltages for different temperature ranges, a sign of the end of charge, balancing.

For the correct operation of this mode, we configure the following fields in the control program window:


In our case, it was necessary to change the Precharge Start Voltage [2,14.4.8.1] parameters in the Data Memory settings to 2300 mV; Charging Voltage Low [2,14.4.8.2] at 3500 mV; Charging Voltage Med [2,14.4.8.1] at 3555 mV; Charging Voltage High [2,14.4.8.1] at 3600 mV. By default, the BQ40Z50-R1 already has automatic charge / discharge control, so it was necessary to only write the parameters of the chip by pressing Write_All. At the end of the record in the status bar appears Successful.


Data Memory menu in bqStudio software package

5. Protection

Without setting the protection can not be:


6. Charge Measurement (Gas Gauging)

Gas Gauging is a special feature of the BQ40Z50-R1 chip for calculating the current battery capacity and the remaining time until full charge or discharge.

For the operation of this mode, we configure the most important of many installations:


Many parameters for this mode are taken from the battery database. If the required battery is not in the database, you can pick up a similar one and carry out a full training cycle for the BQ40Z50-R1.

The learning process for calculating battery capacity:

  1. Fully discharge the battery and wait about 5 hours.
  2. Send the command Enable and Reset . ( Data Memory / Gas Gauging / State / Update Status ). In the LStatus registers , the status should be updated to 0x04 .
  3. Charge the battery until the time in the ChargeStatus register of the FC (Full charge) status bit changes to “1”. Then you should wait about 2 hours. LStatus should change to 0x05 . Of course, you need to charge the battery by the method recommended by the battery manufacturer.
  4. Discharge to the C / 10 level and wait for about 5 hours ( LStatus should change to 0x06 ).
  5. Everything. The learning cycle is completed.

After the learning cycle, BQ40Z50-R1 should correct the values ​​in Qmax and some other cells and allow the work of the balancing function during charging.

findings


The result is a "charger" with Pre-charge mode for charging the battery. When the battery is completely discharged - the charging current is indeed about 400 mA, but over time the current drops as expected and by the end of the charge (reaching the nominal voltage) is about 50 mA.

The total charge time in this case is 5-6 hours. The capacity of the battery at the end of the charge is 80-90% of nominal. If you do not need fast charging of several batteries, you need to minimize the cost of the charge chip and reduce the space on the board, then this is your option.

Source: https://habr.com/ru/post/350142/


All Articles