📜 ⬆️ ⬇️

We pump smart charging Imax B6

Truly they say: laziness is the engine of progress! So I thought the mind was agitated to automate the process of measuring and training acid batteries. After all, who, in his right mind, will, in this age of smart chips, hang on a battery with multimeters and a stopwatch? Surely, many people know the "national" charger Imax B6. On Habré there is an article about him (and not even one). Below I will write what I did to her and why.



Accuracy


In the beginning, my goal was to increase the discharge capacity in order to measure my batteries for a bespereboynik and, in perspective, train them without risking premature old age (me, well, not batteries). Chased the device in disassembled form.

Inside, it is generously packed with a variety of differential amplifiers, a multiplexer, a high-efficiency buck-boost regulator, a good package, and an open source code for a very good firmware can be found in the network. With a charging current of up to 5 amps, they can even charge car batteries at 50A / h (current 0.1C). With all this, at the same time, wealth, as current sensors, ordinary 1 W resistors are used here, which, among other things, work at the limit of their power, which means that their resistance drops significantly under load. Can you trust such a measuring device? Having blown up and having touched these “sensors” with doubts, the doubts are gone - I want to redo them for manganin shunts!
')
Manganin (there is also constantan) is a special alloy for shunts, which practically do not change their resistance from heating. But its resistance is an order of magnitude smaller than replaceable resistors. Also, in the circuit of the device, operational amplifiers are used to amplify the voltage from the sensor to readable microcontroller values ​​(I suppose the upper limit of digitization is the reference voltage from TL431, about 2.495 volts).

My refinement is to solder the shunts instead of resistors, and compensate for the difference in levels by changing the gain of the operational amplifiers to LM2904: DA2: 1 and DA1: 1 (see diagram).

Scheme
image

To rework we need: the device itself is original (I describe the remake of the original), manganin shunts (I took from Chinese multimeters), ISP programmer, cheali-charger firmware (for calibration), Atmel Studio for its assembly (not necessary), eXtreme Burner AVR for its firmware and experience in building bricks for successful firmware atmega (All links are at the end of the article).
And also: the ability to solder SMD and an irresistible desire to restore justice.

I have never studied the design of circuits and amateur radio in general, so it was lazy to make such changes to a working device like this on the move. And then multisim came to the rescue! It is possible without touching the soldering iron in it: to realize the idea, debug it, correct mistakes and understand whether it will work at all. In this example, I modeled a piece of the circuit, with an operational amplifier, for a circuit providing a charge mode:

image

R77 creates negative feedback. Together with R70, they form a divider that sets the gain, which can be calculated something like this (R77 + R70) / R70 = gain. My shunt turned out to be about 6.5 mΩ, which at a current of 5 A will amount to a voltage drop of 32.5 mV, and we need to get 1.96 V to match the logic of the circuit and the expectations of its developer. I took 1 kΩ and 57 kΩ resistors as R70 and R77 respectively. The simulator turned out to be 1.88 volts at the output, which is quite acceptable. I also threw out the resistors R55 and R7, as reducing linearity, they are not used in the photo (perhaps this is a mistake), and the shunt connected it with dedicated wires to the bottom of R70, C18, and the top of the shunt directly to the "+" input of the OU.



The extra tracks are trimmed, including on the reverse side of the board. It is important to solder the wiring well, so that they do not fall off, over time, from the shunt or the board, because not only the microcontroller's ADC is powered from this sensor, but also the feedback on the current of the pulse controller, which, when a signal is lost, can go into maximum mode and to ditch

The circuit for the discharge mode is not fundamentally different, but since I am putting the VT7 on the radiator, and increasing the discharge power to the limit of the field (94W on datasheet), I would also like to set the maximum discharge current more.

As a result, I received: R50 - shunt 5.7 mΩ, R8 and R14 - 430 Ohms and 22 kΩ, respectively, which gives the required 1.5 volts at the output at a current through the shunt 5 A. However, I experimented with a high current - maximum It was 5.555 A, so I stitched a limit of 5.5 A into the firmware (in the file "cheali-charger \ src \ hardware \ atmega32 \ targets \ imaxB6-original \ HardwareConfig.h").

In the course of the problem got out - the charger refused to admit that it is calibrated (i discharge). This is due to the fact that not the macro definition MAX_DISCHARGE_I in the file “HardwareConfig.h”, but the second calibration point for checking the first one (the points are described in the file “GlobalConfig.h”) are used for testing. I did not begin to delve into these subtleties of the intricacies of the code and just cut out this check in the checkAll () function in the “Calibrate.cpp” file.

As a result of alterations, a device turned out that provided an acceptable linearity of measurements in the range from 100mA to 5A and which could be called measuring if not for one thing: since I left a powerful bit field inside the case (despite improved cooling), the board was heated it still distorts the result of the measurement, and the measurements “float” a little downward ... Not sure who is to blame for this: the error amplifier or the microcontroller ADC. In any case, IMHO, it is necessary to move this field to the outside of the case and provide him with sufficient cooling (up to 94W or replace it with another suitable N-channel).

Firmware


I did not want to write about it, but they made me.

  1. Download and install the necessary materials (links at the end of the article).

  2. On the programmer we unsolder and put the jumper JP3 - this will switch the interface to a slow mode. Until I put the jumper - I had problems with the firmware.

  3. We connect the programmer to the device, and the programmer to the computer (the picture below is for the original device! The clone is connected differently):



  4. In the program of eXtreme Burner, choose our chip (menu Chip-> ATmega32), after which we try to read everything (Read All). If everything worked out, the original firmware and EEPROM can be saved anywhere, just in case.

  5. Now we will try to compile our firmware (this action is not necessary, you can take the finished one from the “cheali-charger \ hex \ cheali-charger-imaxB6-original-0.33.hex” folder, in that case, go to step 6).
    In general, how and what can be done is often written in the accompanying documentation, for example, about the assembly - in the file “building.md”.

    In this case, the order is as follows:

    • install atmel studio and cmake
    • Run Atmel Studio Command Prompt and go to the folder with
      cheali-charger.
      That is, for example: cd s: \ cheali-charger
    • execute: s: \ cheali-charger> cmake. -G "Unix"
      Makefiles
    • execute: s: \ cheali-charger> make
    • A firmware file should be created here:
      "S: \ cheali-charger \ src \ hardware \ atmega32 \ targets \ imaxB6-original \ cheali-charger * .hex"

  6. Download our firmware in eXtreme Burner, then click Write-> Flash. God forbid to sew by mistake “everything”, for example: wrong fyuzy, which are on the third tab - in this case, you can lose access for further firmware through the ISP, and maybe through other interfaces. It is really possible to revive the resulting brick only on a high-voltage parallel programmer. Just in case, the correct fyuzy: low = 3F, high = C5.

  7. Calibration. It will need a li-ion battery of at least 2 cells. The calibration order can be read in “README.md”. It is possible, by rearranging it towards the balanced connector, to calibrate all 6 inputs, while the first 2 can be calibrated separately (more precisely) in the expert calibration menu, written about it in “calibration_expert.md”.

A little about my completion of cooling


The field VT7, in a new place, is glued on a hot-melt glue, and its heat sink is soldered to the copper plate:



Cooling decided to make an unnecessary radiator on the heat pipe from the motherboard. The photo shows a suitable pressure plate and a transistor pad, along the perimeter of which an insulating plastic is laid - just in case. The heels of the soldering iron tip are soldered directly to the board, to the common wire - will play the role of an additional heat sink from the converter:



The assembled design does not hurt to stand on the legs of the device:



Ready for firmware:



I experienced this alteration in passive cooling mode: a discharge of 20 minutes for a 6-volt Pb-battery with a maximum current of 5.5A. The power is highlighted 30 ... 31W. The temperature on the heat pipe, through a thermocouple, reached 91 ° C, the case also became hot and, at some point, the screen began to turn purple. I, of course, immediately interrupted the test. The screen could not bounce back for a long time, but then let it go.

Now it is obvious that the portable load unit, with a detachable connection, would be the best solution: there are no restrictions on the size of the radiator and the fan, and the charge itself would be more compact and light (no discharge is needed in the field).

I hope that this article will help newcomers to be bolder in experiments on helpless pieces of hardware.
Comments and additions are welcome.

Warning : the described modifications, when misused, can damage the charging components, turn it into an irreversible "brick", as well as reduce the reliability of the device and create a risk of fire. The author declines responsibility for possible damage, including for wasted time.

Links


Alternative cheali-charger firmware: https://github.com/stawel/cheali-charger (Her youtube review: one , two ).
To compile the firmware: Atmel Studio and CMake
Flash programmer: eXtreme Burner AVR
ISP Programmer: USBASP Programmer for ATMEL

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


All Articles