The charging curve that is currently more recognized is shown in Figure 1. This is also known as the three-stage charging method: constant current charging is used at the beginning and end of charging, and constant voltage charging is used in the middle. When the current decays to a predetermined value, it switches from the second stage to the third stage. This method can minimize the gas output and protect the battery life to the maximum extent.
The traditional 3842 charger has reliable performance and low price, but it can only realize the first two stages of the charging curve, cannot realize the floating charge (trickle charge) stage, and cannot realize intelligent control. Some so-called intelligent chargers on the market are all expensive and have no market competitiveness. This article introduces an intelligent charger that uses a single-chip microcomputer as a power management IC, which can truly realize the three-stage charging process and has functions such as status display, charging time control, and alarm. The cost of the whole machine is less than 20 yuan, which is very competitive in the market.
1 Power supply design scheme
1.1 Introduction to the overall scheme
The bottleneck problem of using a single-chip microcomputer as a power management IC is that the operation speed of the single-chip microcomputer is slow. When the load suddenly changes, it cannot be adjusted in time. In this case, the load is a battery. The process of charging the battery does not have the problem of sudden load changes, which makes it possible to use a single-chip microcomputer as a power management IC.
Since the output power of this circuit is less than 100 W, a flyback topology is adopted. The biggest advantage of the flyback topology is that it does not require an output filter inductor, which makes the flyback topology low in cost and small in size. The power management IC is designed on the secondary side of the circuit and is simulated by the ELAN brand EM78P258N microcontroller. The operating frequency of the microcontroller is set to 8 MHz. The EM78P258N is a very cost-effective microcontroller. Its operating frequency can reach up to 20 MHz (external oscillator mode). It has 4 12-bit precision AD converters, 2Kx13-bit on-chip registers, 3 8-bit and 16-bit timers and a PWM waveform generator with a watchdog function. The primary and secondary of the circuit are isolated by a transformer. The transformer is not only simple in structure, but also easy to achieve a primary and secondary 3000VAC dielectric strength. The maximum output of the charger can be about 45 V/2 A, and can be adjusted according to actual needs. The switching frequency of this charger is set to 40 KHz, each cycle is divided into 200 parts, and the PWM can be adjusted by 1/200 cycle each time, that is, 125 ns. [page]
The initial working voltage of the microcontroller is provided by the load battery. When the load battery is not connected, the charger will not work. Since the sampling accuracy of the microcontroller EM78P258N chip is related to the power supply ripple of its power supply, the 7805 chip is used here to power it. The high level of the PWM pulse output by the EM78P258N chip is 5V, and the turn-on voltage of IRF840 is 4V. However, since the output signal of the EM78P258N chip must first pass through the amplifier circuit and then through the coupling of the signal transformer before driving the switch tube IRF840, the PWM waveform will inevitably be distorted. In order to reduce the loss, the voltage of the signal amplifier circuit is set to 20 V. After testing, this will greatly improve the efficiency of the circuit. This 20 V voltage is provided by the 7820 chip. The inputs of the 7805 chip and the 7820 chip are both connected to the output end of this charger (not shown in Figure 2). Pins 6 and 7 of the EM78P258N chip are used to control the signal lights. By observing the on and off status of the two signal lights, you can know which stage this circuit is working in. Pin 11 is set as the alarm control signal terminal. When the battery charging process is completed or the charger fails, this pin controls the alarm to emit different alarm sounds. Among the 4 AD converters, pin 13 is used to collect voltage signals, pin 14 is used to collect current signals, pin 1 is used to collect temperature signals, and pin 2 is idle and can be used for future function upgrades. Pin 3 is used to monitor 220VAC mains power. When the charger is powered off, the microcontroller enters a dormant state. The current sampling resistor can also perform the function of a dummy load.
This circuit starts working only after both the mains power and the battery are connected. If either the battery or the mains power is disconnected, the circuit stops working, and the reliability is good.
[page]
1.2 Design of MCU SoftwareSince the EM78P258N chip is not a dedicated power management IC, all possible working states must be considered as much as possible when designing the program. Due to the limitation of the operation speed of the MCU (in this case, one instruction cycle is 125 ns), it is impossible to achieve particularly accurate voltage or current output, but for lead-acid batteries, appropriate voltage or current ripple is beneficial to eliminate the plate sulfation phenomenon. The
software control flow is shown in Figure 3. When the battery is connected, the MCU starts to work. After initialization, the PWM is slowly turned on, and then the voltage on the current sampling resistor is detected, and the output current of the circuit is controlled to between 1.8 and 2 A. At the same time, the output voltage is detected and timed. If the time for the circuit output voltage to reach 42 V is less than 10 s, it is considered that the battery itself is full, and the program directly switches to the trickle state. When the output voltage of the circuit reaches 43 V, the program switches to the constant voltage charging stage. In this stage, the output voltage of the circuit is controlled to between 43 and 45 V, and the output current is detected and timed. When the output current is less than 200 mA, the program switches to the constant voltage to trickle stage. Since the battery has been float-charged to about 44.6 V in the constant voltage stage, and the voltage requirement in the trickle stage is about 41.4 V, if the constant voltage stage is directly transferred to the trickle stage after the end, the battery voltage will be higher than the charger output voltage, and the charging current will be zero, forcing the program to terminate. Therefore, after the constant voltage stage is over, the program first enters a constant voltage to trickle stage. In this stage, the charging current is controlled to between 80 and 100 mA. As the charging current decreases, the voltage at both ends of the battery will also decrease. When the voltage at both ends of the battery drops below 40 V, the program switches to the trickle stage to continue charging the battery, thus truly realizing the three-stage charging mode. After the trickle stage lasts for half an hour or the charging current is less than 50 mA, the microcontroller goes to sleep after a buzzer prompt, and the charging process ends.
During the entire working process of the single-chip microcomputer, the output voltage and output current of the charger are always monitored. If the program of the single-chip microcomputer is not completed, the battery is removed. At this time, the energy stored in the transformer when the switch tube is turned on cannot be fully released. After a long time, it will cause the magnetic saturation of the transformer and then burn the charger. Therefore, in the program, it is set that when the charging current is zero, the charging process is forced to end. If the output voltage of the charger is detected to be too high or the output current is too large, the charging program will also be forced to end to protect the battery from damage.
In the program, the execution time of each stage is recorded. If the charging time is too long or too short, it will jump to the corresponding program segment, or light up the signal light, or beep the alarm, or force the program to end, which makes the charging status clear at a glance.
1.3 Transformer Design Introduction
Since the charging current of the battery cannot be zero, this charger must work in the continuous working mode. Even if the flyback transformer works in the current continuous mode, although the total ampere-turns will not stay at zero, for each coil of the flyback transformer, the coil current is always in a discontinuous state. Of course, the current (ampere-turns) is intermittent. This is because during switching, the current (ampere-turns) switches back and forth between the primary and secondary, that is, when the primary ampere-turns decrease, the secondary ampere-turns increase by the same amount, and vice versa. Although the total ampere-turns are continuous and the ripple is small, the current of each coil
changes alternately from zero to the highest peak value. Regardless of the working mode, the coil AC loss is large.
In order to reduce costs, the switching device used in this example is IRF840 (500 V, 8 A), which makes it impossible for the transformer turns ratio to be too large, because the voltage of the AC power after rectification and filtering is about 300VDC, and the maximum output voltage of the charger is about 45VDC. The turns ratio N1/N2 is set to 2 during design, so that the IRF840 chip has a leakage inductance peak margin of about 100VDC, and the reduction is more reliable.
The volt-seconds of the primary and secondary of the transformer should be balanced, from which the maximum on-time of the switch tube can be calculated
.
In the formula,
is the minimum input voltage of the primary side of the transformer, T is the switching period, VO is the output voltage, N1 is the primary turns, N2 is the secondary turns, and the conduction voltage drop of the switch tube and the diode in the circuit is ignored here.
Assuming that the efficiency of the charger is 80% and the output power of the charger is 100 W, since the maximum on-time of the switch tube occurs when the input voltage is the lowest, the primary inductance of the transformer can be deduced
. In the formula, PO is the output power.
In order to ensure that this charger can work reliably in the continuous current mode, after debugging, the actual parameters of the transformer are as follows: the core uses TDK's PC40EER40 core, the air gap of the core column is set to 1.58 mm, and the skeleton uses a vertical skeleton with a row spacing of 25 mm, a pin spacing of 5 mm, and 6x6 pins. The primary winding is wound with 0.64mm high-strength enameled wire for 97 turns, with an inductance of 780 μH; the secondary winding is wound with 0.64mm high-strength enameled wire in three parallels for 50 turns, with an inductance of 208 μH. Three layers of polyester film are placed between the primary and secondary windings, without varnishing.
2 Summary
According to the test, the maximum output power of this charger can reach 90 W, the efficiency is about 85%, and the cost of the whole machine is about 20 yuan, which has strong market competitiveness.
Due to the limitation of the operation speed of the single-chip microcomputer, the feedback loop cannot be made very stable by using the single-chip microcomputer analog power management IC, which increases the difficulty of the thermal design of the circuit. If you want to optimize the thermal design, you can use the method of adding an external oscillator to the single-chip microcomputer and increasing its operating frequency to 20 MHz. You can also divide the constant current charging stage into several stages. As the output voltage of the charger increases, the output current is gradually reduced to reduce the output power. The heat generated by the charger is reduced at the cost of extending the charging time, which can greatly reduce the operating temperature of the charger.
This design is a successful attempt to realize the intelligent power supply by using a single-chip microcomputer to simulate the power management IC. Through this attempt, it is believed that the design ideas of intelligent power supply can be greatly expanded.
Previous article:Data transmission technology of TCP/IP protocol microcontroller in network communication
Next article:Design of digital B-ultrasound keyboard realized by single chip microcomputer
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- EEWORLD University - Demonstrating Jailhouse Hypervisor Virtualization on Sitara AM572x Reference Design
- How to filter out the AC component noise mixed in the 24V DC?
- In C language, please remember to initialize local variables
- Let’s practice together in 2021, and may love and warmth always be with us
- IAR EWARM's SWO Trace debugging function
- CircuitPython 4.1.0 Released
- What will be the next direct power source for machines after electricity?
- pyEC, an electric bike controller compatible with pyBoard
- Bear Pie Huawei IoT operating system LiteOS bare metal driver transplantation 06-E53_ST1 expansion board driver and use
- I bought 8 apples last week and ate one every day, starting with the small ones. The last one had a rotten hole in it, so...