Firmware for Imax B6 Mini in two ways. Firmware for Imax B6 Mini in two ways Imax b6 firmware in Russian

Universal Charger iMax-B6 is rightfully considered popular. Any aircraft modeller or person who owns Li-Po batteries will recognize the blue shaitan box from afar.

appearance of the shaitan box

For its time, charging turned out to be so revolutionary and simple that everyone began to copy it. There are several versions of the charger:
- The original was called BC-6 and was produced by Bantam based on ATmega32/ATmega32L.
- Then SkyRC successfully licked it, and everyone forgot about Bantam.
- An exact copy of SkyRC on ATmega32 made in the basement (I came across this one).
- A copy with differences in the circuit and board.
- Charging on the chip . It’s difficult to call it a clone since this device is based on a completely different microcontroller and only looks similar to the iMax-B6.
- In 2016/2017, the Chinese reached the bottom of optimization and released a new charger that only charges lithium normally. The chip is in a TQFP48 package and without markings. They assume that this is STC or ABOV MC96F6432. It looks like Vanga was mistaken - it turned out to be MEGAWIN MA84G564. Third party firmware no, and it looks like it won’t be.

There are at least three diagrams of the original iMax-B6 circulating online. The most successful attempt to draw a diagram and understand how it works was made by a user electronik-irk. With their developments he shared in the "Born with a Soldering Iron" community.

But in any barrel of honey there is always a fly in the ointment. It was also found in the iMax-B6. This is a problem with Δv when charging 1.2 volt Ni-Ca and Ni-Mh batteries. At one time I wrote to the community about the problem with Δv, but never received a response. My opinion is that difficulties with Δv arise due to several jambs. The first is that during switching on and with each measurement, a surge of about 3-4 volts occurs on capacitor C21 and the output terminals, which introduces quite a distortion of Δv in 1.2 volt batteries.


power circuit diagram

This problem is easily solved by adding a resistance R128 with a nominal value of 4.7 kOhm in parallel with the capacitor C21. As a bonus, this resistor corrects a bug feature of some iMaxes - dying when turned on without a load. In this case, VT26 or VT27 usually lights up.

You need to solder R128 here

The second problem is the small capacity of the ADC and noise from the power supply and digital circuits. 10bit is barely enough for the range 0V - 30V with an accuracy of 0.29mV. To somehow facilitate the operation of the ADC, you need to carry out a set of measures:
- Increase the stability of the reference voltage.
- Change the native iMax firmware to cheali-charger. This firmware uses a trick with resampling and adding artificial noise. After all these modifications, you will be able to catch Δv from Ni-Ca/Ni-Mh at charging currents > 0.5C

The iMax built on the ATmega32 uses a not very accurate reference voltage source of 2.5 volts on the base TL431. Its stability can be slightly increased by soldering an electrolytic capacitor with a capacity of 10 µF between AREF and ground.


supporter in the upper left corner

I will describe in part about flashing, calibrating and activating the artificial noise mode.

UDP: As correctly noted Loll Ol in the comments, the TL431 is very critical of the output capacitor capacity. Zones of stable operation are marked in red: 0.001mF - 0.01mF and 10mF.


TL431 stability chart

Truly they say: laziness is the engine of progress! So the thought excited me, to automate the process of measuring and training acid batteries. After all, who in their right mind would, in our age of smart microcircuits, pore over a battery with multimeters and a stopwatch? Surely, many people know the “folk” charger Imax B6. There is about him on the hub (and even more than one). Below I will write what I did with it and why.

Accuracy

In the beginning, my goal was to increase the discharge power in order to measure my UPS batteries and, in the long term, train them without running the risk of premature aging (me, not the batteries). I drove the device in disassembled form.

Inside it is generously stuffed with many differential amplifiers, a multiplexer, a buck-boost regulator with high efficiency, and has good body, and on the Internet you can find an open one source very good firmware. With a charging current of up to 5 amperes, it can even charge car batteries at 50A/h (current 0.1C). With all this wealth, ordinary 1 W resistors are used here as current sensors, which, among other things, operate at the limit of their power, which means their resistance significantly decreases under load. Can such a measuring device be trusted? Having blown and touched these “sensors” with my hands, my doubts went away - I want to convert them to manganin shunts!

Manganin (there is also constantan) is a special alloy for shunts, which practically does not change its resistance when heated. But its resistance is an order of magnitude lower than the resistors being replaced. Also, the device circuit uses operational amplifiers to amplify the voltage from the sensor to values ​​readable by the microcontroller (I believe the upper limit of digitization is the reference voltage from the TL431, about 2.495 volts).

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

Scheme



For the conversion we will need: the original device itself (I am describing the conversion of the original), manganin shunts (I took them from Chinese multimeters), ISP programmer, cheali-charger firmware (for calibration), Atmel Studio for its assembly (optional), eXtreme Burner AVR for its firmware and experience in creating bricks for successful Atmega firmware (All links are at the end of the article).
And also: the ability to solder SMD and an irresistible desire to restore justice.

I never studied circuit design or amateur radio in general, so making such changes to a working device like this on the fly was lazy and scary. And then multisim came to the rescue! It is possible, without touching a soldering iron, to implement an idea, debug it, correct errors and understand whether it will work at all. In this example, I simulated a piece of circuitry, with an operational amplifier, for a circuit that provides the charging mode:

Resistor 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 mOhm, 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 meet the logic of the circuit and the expectations of its designer. I took 1 kOhm and 57 kOhm resistors as R70 and R77 respectively. According to the simulator, the output turned out to be 1.88 volts, which is quite acceptable. I also threw out resistors R55 and R7, as they reduce linearity; they are not used in the photo (perhaps this is an error), and I connected the shunt itself with dedicated wires to the bottom of R70, C18, and the top of the shunt directly to the “+” input of the op-amp.

Excess tracks have been trimmed, including those on the back side of the board. It is important to solder the wires well so that they do not fall off over time from the shunt or board, because this sensor powers not only the ADC of the microcontroller, but also Feedback according to the current of the pulse regulator, which, if the signal disappears, can go to maximum mode and die.

The circuit for the discharge mode is not fundamentally different, but since I place the VT7 field device on a radiator and increase the discharge power to the field device limit (94W according to the datasheet), I would like to set the maximum discharge current higher.

As a result, I got: R50 - a shunt of 5.7 mOhm, R8 and R14 - 430 Ohm and 22 kOhm, respectively, which gives the required 1.5 volts at the output with a current through the shunt of 5 A. However, I experimented with a higher current - maximum the result was 5.555 A, so I added a limit to 5.5 A into the firmware (in the file “cheali-charger\src\hardware\atmega32\targets\imaxB6-original\HardwareConfig.h”).

Along the way, a problem emerged - the charger refused to recognize that it was calibrated (i discharged). This is due to the fact that for verification it is not the macro definition MAX_DISCHARGE_I in the file “HardwareConfig.h” that is used, but the second calibration point to check the first (the points are described in the file “GlobalConfig.h”). I did not delve into these intricacies of the code and simply cut out this check in the checkAll() function in the “Calibrate.cpp” file.

As a result of the alterations, a device was obtained that provided acceptable linearity of measurements in the range from 100mA to 5A and which could be called a measuring one, if not for one thing: since I left a powerful discharge field device inside the case (despite the improved cooling), the board heated up it still introduces distortion into the measurement result, and the measurements “float” a little towards underestimation... I’m not sure who exactly is to blame for this: the error amplifier or the ADC of the microcontroller. In any case, IMHO, it is worth taking this field switch outside the case and providing it with sufficient cooling there (up to 94W or replacing it with another suitable N-channel one).

Firmware

I didn’t want to write about this, but I was forced to.

A little about my cooling improvements

The VT7 field switch, in its new location, is glued with hot glue, and its heat sink is soldered to a copper plate:

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

The assembled structure will not interfere with the device standing on its legs:

Ready for firmware:

I tested this modification in passive cooling mode: discharging a 6-volt Pb battery for 20 minutes with a maximum current of 5.5A. The power was displayed at 30...31W. The temperature on the heat pipe, as measured by the thermocouple, reached 91°C, the body also became hot and, at some point, the screen began to turn purple. Of course, I immediately aborted the test. The screen could not return to normal for a long time, but then it was released.

It is now obvious that a remote load block, with a detachable connection, would be the best solution: there are no restrictions on the size of the radiator and fan, and the charging itself would be more compact and lighter (no discharge needed in the field).

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

Warning: the described modifications, if used improperly, can damage the charging components, turn it into an irreversible “brick”, and also lead to a decrease in the reliability of the device and create a risk of fire. The author declines responsibility for possible damage, including wasted time.

Links

Alternative firmware cheali-charger: https://github.com/stawel/cheali-charger (Its review on YouTube: once , two).
To compile the firmware: Atmel Studio and CMake
Flashing program: eXtreme Burner AVR
ISP programmer:

In this article I will tell you how to flash Imax B6 Mini with two different ways. The first is the most common, it is used by the majority, the second is more interesting in my opinion, simpler, allowing you to update to the latest on this moment versions.

Let's start in order. First, we need to go to skyrc.com and go to the Download section. Then in the category select Chargers and find your device, in in this case Imax B6 Mini. Go to the Software tab and download the Charger Master program, version 2.

In my case, the file was saved without an extension, so I copied all the names along with the extension and renamed the downloaded file. Run setup.exe or ChargeMaster2.msi - no difference. Install the program and, if necessary, change the installation path. I left everything as is.

After launch, Charge Master tells us what is required for its operation NET Framework 4th version and we are invited to download it. We agree and click the “Yes” button. Oddly enough, nothing happened, so I downloaded it myself. I advise you to download offline installer, although this is not particularly important and you can download the Web installer. After installation, try to run the program again. The program has started, now you can connect the device to the computer’s USB.

A bug has been discovered in the program due to which part of the interface disappears when a device is connected. To fix it, we need to go to the control panel and switch the language format to English or replace the comma separator with a dot.

In my case, I'll just set the format to English (US). We launch the program again and try to connect. Everything works, go to the System section and see a message that version 1.12 is available, but we have version 1.10. We update the firmware by clicking on the Update Firmware button. Upon completion of the firmware, the device produces a characteristic sound.

Now about the second method. This device You can also flash it using a special service utility. This method is simpler and does not require installing additional software or changing system settings. Besides this method will allow us to update to version 1.13. We go to the page with the firmware and download a small archive with a flasher for our device (link just below), or download it directly from here, unpack it and run it.

By holding down the Enter button we connect USB cable to the device, then connect the power. Now you can click the Upgrade button. The firmware process has begun. In principle, you don’t have to put the device into a special boot mode and don’t even connect the power, but simply start flashing the firmware immediately after connecting it to USB, but my tests showed that in this case the firmware is installed crookedly and the device starts to reboot itself from time to time. Therefore, I advise you to do everything strictly according to these instructions.

Truly they say: laziness is the engine of progress! So the thought excited me, to automate the process of measuring and training acid batteries. After all, who in their right mind would, in our age of smart microcircuits, pore over a battery with multimeters and a stopwatch? Surely, many people know the “folk” charger Imax B6. There is about him on the hub (and even more than one). Below I will write what I did with it and why.

Accuracy

In the beginning, my goal was to increase the discharge power in order to measure my UPS batteries and, in the long term, train them without running the risk of premature aging (me, not the batteries). I drove the device in disassembled form.

Inside it is generously stuffed with many differential amplifiers, a multiplexer, a buck-boost regulator with high efficiency, has a good case, and you can find open source code on the Internet very good firmware. With a charging current of up to 5 amperes, it can even charge 50A/h car batteries (current 0.1C). With all this wealth, ordinary 1 W resistors are used here as current sensors, which, among other things, operate at the limit of their power, which means their resistance significantly decreases under load. Can such a measuring device be trusted? Having blown and touched these “sensors” with my hands, my doubts went away - I want to convert them to manganin shunts!

Manganin (there is also constantan) is a special alloy for shunts, which practically does not change its resistance when heated. But its resistance is an order of magnitude lower than the resistors being replaced. Also, the device circuit uses operational amplifiers to amplify the voltage from the sensor to values ​​readable by the microcontroller (I believe the upper limit of digitization is the reference voltage from the TL431, about 2.495 volts).

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

Scheme



For the conversion we will need: the original device itself (I am describing the conversion of the original), manganin shunts (I took them from Chinese multimeters), ISP programmer, cheali-charger firmware (for calibration), Atmel Studio for its assembly (optional), eXtreme Burner AVR for its firmware and experience in creating bricks for successful Atmega firmware (All links are at the end of the article).
And also: the ability to solder SMD and an irresistible desire to restore justice.

I never studied circuit design or amateur radio in general, so making such changes to a working device like this on the fly was lazy and scary. And then multisim came to the rescue! It is possible, without touching a soldering iron, to implement an idea, debug it, correct errors and understand whether it will work at all. In this example, I simulated a piece of circuitry, with an operational amplifier, for a circuit that provides the charging mode:

Resistor 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 mOhm, 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 meet the logic of the circuit and the expectations of its designer. I took 1 kOhm and 57 kOhm resistors as R70 and R77 respectively. According to the simulator, the output turned out to be 1.88 volts, which is quite acceptable. I also threw out resistors R55 and R7, as they reduce linearity; they are not used in the photo (perhaps this is an error), and I connected the shunt itself with dedicated wires to the bottom of R70, C18, and the top of the shunt directly to the “+” input of the op-amp.

Excess tracks have been trimmed, including those on the back side of the board. It is important to solder the wires well so that they do not fall off over time from the shunt or board, because this sensor powers not only the ADC of the microcontroller, but also the current feedback of the pulse regulator, which, if the signal is lost, can go to maximum mode and ditch.

The circuit for the discharge mode is not fundamentally different, but since I place the VT7 field device on a radiator and increase the discharge power to the field device limit (94W according to the datasheet), I would like to set the maximum discharge current higher.

As a result, I got: R50 - a shunt of 5.7 mOhm, R8 and R14 - 430 Ohm and 22 kOhm, respectively, which gives the required 1.5 volts at the output with a current through the shunt of 5 A. However, I experimented with a higher current - maximum the result was 5.555 A, so I added a limit to 5.5 A into the firmware (in the file “cheali-charger\src\hardware\atmega32\targets\imaxB6-original\HardwareConfig.h”).

Along the way, a problem emerged - the charger refused to recognize that it was calibrated (i discharged). This is due to the fact that for verification it is not the macro definition MAX_DISCHARGE_I in the file “HardwareConfig.h” that is used, but the second calibration point to check the first (the points are described in the file “GlobalConfig.h”). I did not delve into these intricacies of the code and simply cut out this check in the checkAll() function in the “Calibrate.cpp” file.

As a result of the alterations, a device was obtained that provided acceptable linearity of measurements in the range from 100mA to 5A and which could be called a measuring one, if not for one thing: since I left a powerful discharge field device inside the case (despite the improved cooling), the board heated up it still introduces distortion into the measurement result, and the measurements “float” a little towards underestimation... I’m not sure who exactly is to blame for this: the error amplifier or the ADC of the microcontroller. In any case, IMHO, it is worth taking this field switch outside the case and providing it with sufficient cooling there (up to 94W or replacing it with another suitable N-channel one).

Firmware

I didn’t want to write about this, but I was forced to.

A little about my cooling improvements

The VT7 field switch, in its new location, is glued with hot glue, and its heat sink is soldered to a copper plate:

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

The assembled structure will not interfere with the device standing on its legs:

Ready for firmware:

I tested this modification in passive cooling mode: discharging a 6-volt Pb battery for 20 minutes with a maximum current of 5.5A. The power was displayed at 30...31W. The temperature on the heat pipe, as measured by the thermocouple, reached 91°C, the body also became hot and, at some point, the screen began to turn purple. Of course, I immediately aborted the test. The screen could not return to normal for a long time, but then it was released.

It is now obvious that a remote load block with a detachable connection would be the best solution: there are no restrictions on the size of the radiator and fan, and the charging itself would be more compact and lighter (no discharge needed in the field).

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

Warning: the described modifications, if used improperly, can damage the charging components, turn it into an irreversible “brick”, and also lead to a decrease in the reliability of the device and create a risk of fire. The author declines responsibility for possible damage, including wasted time.

Links

Alternative firmware cheali-charger: https://github.com/stawel/cheali-charger (Its review on YouTube: once , two).
To compile the firmware: Atmel Studio and CMake
Flashing program: eXtreme Burner AVR
ISP programmer:

In this article I will tell you how to flash Imax B6 Mini in two different ways. The first is the most common, it is used by the majority, the second is more interesting in my opinion, simpler, allowing you to update to the latest version at the moment.

Let's start in order. First, we need to go to skyrc.com and go to the Download section. Then select Chargers in the category and find your device, in this case Imax B6 Mini. Go to the Software tab and download the Charger Master program, version 2.

In my case, the file was saved without an extension, so I copied all the names along with the extension and renamed the downloaded file. Run setup.exe or ChargeMaster2.msi - no difference. Install the program and, if necessary, change the installation path. I left everything as is.

After launching, Charge Master informs us that it requires NET Framework version 4 to work and invites us to download it. We agree and click the “Yes” button. Oddly enough, nothing happened, so I downloaded it myself. I advise you to download the offline installer, although this is not particularly important and you can download the Web installer. After installation, try to run the program again. The program has started, now you can connect the device to the computer’s USB.

A bug has been discovered in the program due to which part of the interface disappears when a device is connected. To fix it, we need to go to the control panel and switch the language format to English or replace the comma separator with a dot.

In my case, I'll just set the format to English (US). We launch the program again and try to connect. Everything works, go to the System section and see a message that version 1.12 is available, but we have version 1.10. We update the firmware by clicking on the Update Firmware button. Upon completion of the firmware, the device produces a characteristic sound.

Now about the second method. This device can also be flashed using a special service utility. This method is simpler and does not require installing additional software or changing system settings. In addition, this method will allow us to update to version 1.13. We go to the page with the firmware and download a small archive with a flasher for our device (link just below), or download it directly from here, unpack it and run it.

While holding down the Enter button, connect the USB cable to the device, then connect the power. Now you can click the Upgrade button. The firmware process has begun. In principle, you don’t have to put the device into a special boot mode and don’t even connect the power, but simply start flashing the firmware immediately after connecting it to USB, but my tests showed that in this case the firmware is installed crookedly and the device starts to reboot itself from time to time. Therefore, I advise you to do everything strictly according to these instructions.