A switching power supply is a power supply that uses modern power electronics technology to control the ratio of the time when the switch is turned on and off to maintain a stable output voltage. A switching voltage-regulated power supply has the advantages of high efficiency, good voltage regulation performance, and complete protection measures. Since the control signal is generally obtained through precision voltage regulators such as TL4331 and optocouplers, it is difficult to adjust the output voltage within a wide range. In particular, it cannot output low voltage (<3 V). Applying the ATMEGA16 microcontroller to power supply control can improve the output voltage control accuracy of the switching power supply. At the same time, by using the calculation function of the ATMEGA16 and software programming, feedback control is used to make the voltage output tend to be constant.
1 Power supply hardware circuit design and calculation
1.1 Overall system design
The block diagram of the system is shown in Figure 1. The AC power outputs DC through the rectifier and filter circuit, and the EMI common mode filter is used to suppress the interference in the AC power; the +5 V microcontroller power supply is composed of MC34063; the system output voltage is sent to the A/D port of the microcontroller ATMEGA16 through the feedback circuit. The microcontroller performs PWM control on the DC-DC according to the change of the output voltage to make the output voltage stable; at the same time, the system display and keyboard control are also realized by the microcontroller ATMEGA16.
1.2 Rectification and filtering circuit
The rectifier and filter circuit is mainly composed of a rectifier transformer (30 W, 18 V), an EMI filter, an RS207 rectifier bridge (2 A) and a filter capacitor of 2 000 μF. The main function of the EMI filter is to filter out switching noise and harmonics introduced by the input line. The windings on the magnetic core in the filter are wound in the same direction. Because the AC current flowing through the windings is in reverse phase, the AC magnetic flux generated by the two currents in opposite directions in the magnetic core cancel each other out, thereby achieving the purpose of suppressing common-mode interference.
1.3 MCU power supply
In order to improve the efficiency of the power supply, the chip MC34063A is used to connect simple external components to form a step-down circuit, which outputs 5 V voltage to provide power for the microcontroller ATMEGA16. The circuit is shown in Figure 2.
Where R1 is the current limiting resistor, C1 is the timing capacitor, C2 is the output filter capacitor, R2 and R3 are resistors for setting the output voltage, and the calculation formula is shown in formula (1). Rst is the current limiting resistor. When the voltage of the current limiting resistor reaches 330 mV, the current limiting circuit starts to work. The calculation formula is shown in formula (2), where IMax_out is the maximum output current.
From the above two formulas, it can be seen that when the output voltage is 5V, the values of Rst, R2 and R3 are 0.5 Ω, 1.2 kΩ and 3.6 kΩ respectively. [page]
1.4 Keyboard and display circuit
The input and display circuit uses 4 buttons and function switching to complete the setting of output voltage and display switching. The display part uses a common anode digital tube for dynamic display, as shown in Figure 3. The single-chip microcomputer ATMEGA16 uses an internal 8 MHz crystal oscillator.
1.5 DC-DC Circuit
The DC-DC circuit is shown in Figure 4. This module is an SR-Buck converter, and the switch tube uses the MOSFET tube IRF540. The maximum drain current ID of IRF540 is 33 A, the on-resistance RDS(on) is 44 mΩ, and the drain-source breakdown voltage VDSS is 100V. MOSFET is a voltage-controlled current source. In order to drive the MOSFET into the saturation region, it is necessary to add enough voltage between the gate and the source so that the drain can flow through the expected maximum current. Therefore, a transistor is used to drive IRF540. The main switch tube Q6 is driven by the NPN transistor Q5, and the synchronous rectifier tube Q9 is driven by the PNP transistor Q10.
The filter circuit uses an LC series circuit, which consists of a 220μH inductor and two 470μF ESR capacitors in parallel. A 0.1μF ceramic capacitor is used to absorb the high-frequency components at the output end.
[page]
1.6 Output voltage sampling circuit
Connect the two ends of the 50 kΩ potentiometer (voltage sampling resistor) to the power supply output end (V0 end and ground end), and connect the middle pin to the ADC0 pin of the microcontroller to realize A/D sampling of the output voltage. The circuit is shown in Figure 5.
2 Feedback Programming
The system collects the output voltage value and compares it with the set output voltage value. According to the size and polarity of the deviation, the duty cycle of the PWM terminal signal in Figure 4 is controlled, thereby changing the on-time of the switch tube to achieve voltage closed-loop negative feedback. In order to avoid oscillation caused by frequent actions, a PID control algorithm with dead zone is applied in the software.
The program flow chart is shown in Figure 6. The actual output voltage c(k) is obtained through A/D detection, and the set voltage r(k) is compared with the measured voltage c(k) to obtain the current deviation value e(k). When |e(k)|≤ε (ε is the dead zone deviation), no adjustment is performed; when e(k) is not within the dead zone range, PID adjustment is performed, and the calculation formula is shown in formula (3).
△P(k)=Pxe(k)-Ixe(k-1)+Dxe(k-2) (3)
Where: △P(k) is the output adjustment amount, e(k) is the current deviation, e(k-1) is the previous deviation, e(k-2) is the previous two deviations, p, I, D are the proportional coefficient, integral coefficient, and differential coefficient respectively. After experimental setting, P, I, and D are 27, 3, and 1 respectively.
3 Power supply function test results
When the output voltage is set to 3 V, 5 V and 9 V respectively, the performance parameters of the power supply are as follows:
1) The output voltage is adjustable from 0 to 9.9 V in steps of 0.1 V, and the output current can reach 1.5 A;
2) The voltage control accuracy range is 3% to 0.71%;
3) When the output voltage is 9 V and the output current is 1.5 A, the efficiency of the power supply is 78.78%.
4) When the output voltage changes from 3 V to 9 V, the load regulation rate is 2.7% to 1.1%;
5) At full load, the voltage regulation rate is less than 0.67%;
6) The ripple voltage accounts for 0.73% to 0.62% of the output voltage.
4 Conclusion
From the above test results, it can be seen that the power supply output voltage is adjustable from 0 to 9.9 V with high accuracy and efficiency. If the value of the dead zone deviation ε is reduced, the constant voltage characteristics and control accuracy of the power supply can be further improved; when the output power is low, the power supply microcontroller control and LED display module will consume a certain amount of power, resulting in a decrease in the efficiency of the power supply. If an LCD display and PCB board wiring are used, it is expected to further improve the power supply efficiency and reduce ripple interference.
Previous article:USB interface design based on ATmega128 and CH374
Next article:Design of wireless data acquisition system based on ATmega128
- Popular Resources
- Popular amplifiers
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
- New breakthrough! Ultra-fast memory accelerates Intel Xeon 6-core processors
- New breakthrough! Ultra-fast memory accelerates Intel Xeon 6-core processors
- Consolidating vRAN sites onto a single server helps operators reduce total cost of ownership
- Consolidating vRAN sites onto a single server helps operators reduce total cost of ownership
- 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!
- What is the concept of nano power supply?
- loto instrument_How to simulate the output of camshaft and crankshaft waveforms_using arbitrary waveform signal source SIG852?
- About CAN communication rate setting
- MicroPython drives Weixue 2.13-inch ink screen (electronic paper)
- IC1B logic probe circuit diagram
- PIC series microcontroller programming basics
- ESP32-S2-Saola-1 running circuitpython(1)
- [2022 Digi-Key Innovation Design Competition] Multi-platform IoT Hazardous Gas Detection System Based on STM32F7508-DK
- "Recommended Chinese chips" + domestic high-precision ADC and ultrasonic measurement circuit
- [Hua Diao Experience] 18-line empty board lights up WS2812B's 256-bit LED hard screen