Share this

Design of a high-performance microcontroller-based power DC switching power supply

2026-04-06 02:14:49 · · #1
Abstract: This paper designs a digitally controlled DC switching power supply based on a high-performance microcontroller. First, the principle and overall design scheme of the power supply are introduced. Then, the hardware design of some key circuits is introduced. Software methods are used to realize the digital control of the DC power supply, and the main program and some key program flowcharts are given. This power supply has the advantages of continuously adjustable output voltage , high precision, simple circuit, and flexible operation. Keywords: Switching power supply; Digital control 1 Introduction DC regulated power supplies have been widely used in many industrial fields. In industrial production (such as electric welding, electroplating or speed regulation of DC motors), a large number of voltage-adjustable DC power supplies are needed. They generally require DC power supplies with adjustable voltage output. At present, due to the advantages of high efficiency and miniaturization of switching power supplies [1], traditional linear regulated power supplies and thyristor regulated power supplies are gradually being replaced by DC switching regulated power supplies. The main control method of switching power supplies is to use pulse width modulation integrated circuits to output PWM pulses and use analog PID regulators for pulse width modulation. This control method has certain errors and the circuit is relatively complex [2]. This paper designs a power switching power supply with a wide range of continuously adjustable output voltage based on the high-performance microcontroller μpsd3354 of ST company as the control core. The microcontroller directly generates PWM waves to perform digital control on the main circuit of the switching power supply. The circuit is simple and powerful [3]. 2 Power DC power supply system principle and overall design 2.1 System principle This power DC power supply system consists of two parts: the main circuit of the switching power supply and the control circuit. The main circuit mainly processes electrical energy, and the control circuit mainly processes electrical signals. A negative feedback is used to form an automatic control system. The switching power supply adopts PWM control mode. The deviation is obtained by comparing the given quantity and the feedback quantity, and the PWM output is controlled by the digital PID regulator, thereby controlling the output of the switching power supply. Among them, the PID regulation and PWM output are both controlled by the microcontroller system using software. 2.2 System overall design The system hardware part consists of several parts, including input and output rectifier and filter circuits, power conversion part, drive circuit, microcontroller system and auxiliary circuit. Figure 1 is a block diagram of the microcontroller-controlled power DC power supply structure. [align=center] Figure 1 Block diagram of the microcontroller-controlled power supply[/align] As can be seen from Figure 1, the 50Hz, 220V AC power is filtered by the power grid filter to eliminate interference from the power grid, and then enters the input rectifier filter for rectification and filtering, and is converted into a DC voltage signal. The DC signal is converted into a high-frequency AC signal by the power conversion circuit, and the high-frequency AC signal is then converted into a DC voltage output by the output rectifier and filter circuit [1]. The control circuit adopts PWM pulse width modulation mode. The PWM control signal with adjustable pulse width generated by the microcontroller is processed by the drive circuit and drives the power conversion circuit to work. The output voltage is periodically acquired using a microcontroller's high-speed ADC conversion channel and compared with the expected value. PID control is then applied based on the error. The voltage acquisition circuit acquires the DC voltage V0 and matches it to the analog input voltage range of the A/D converter. In case of overvoltage, overcurrent, or short-circuit faults in the switching power supply, the protection circuit protects the power supply and load. The auxiliary power supply provides DC power to the control circuit, drive circuit, etc. 3. Switching Power Supply Main Circuit Design The main circuit of the switching power supply is used to complete the DC-AC-DC conversion. The system's main circuit uses a full-bridge DC-DC converter, as shown in Figure 2. The power switching devices used in this system are EUPEC's BSM 50GB120DN2 series IGBT modules. Each module is a half-bridge structure; therefore, two modules are required in a full-bridge system. Each module embeds a fast freewheeling diode. [align=center]Figure 2 Main Circuit Diagram of Power DC Power Supply[/align] 4. Control Circuit Hardware Design 4.1 Control Circuit Structure Block Diagram The control circuit of the power DC power supply uses STMicroelectronics' μpsd3354 microcontroller as its core. The control circuit mainly performs the following functions: voltage acquisition, A/D conversion, closed-loop regulation, PWM signal generation, IGBT drive and protection, keyboard input and output voltage display, etc. The control circuit mainly includes: microcontroller system, voltage acquisition circuit, IGBT drive circuit, keyboard, display circuit, etc. The structure block diagram is shown in Figure 3. The system controls the on and off time of the power conversion switch through PWM output to achieve stable control of the output voltage. It samples the output voltage of the switching power supply through A/D conversion. At the same time, it adopts voltage closed-loop control. When the switching power supply is working, the microcontroller implements PID regulation of the PWM duty cycle according to the deviation between the expected value and the voltage feedback value. [align=center] Figure 3 Control circuit structure diagram[/align] 4.2 IGBT drive circuit design In order to accurately control the voltage output of the switching circuit, this system adopts pulse width modulation to adjust the working state of the switching tube. According to the voltage control algorithm (an improved PID control algorithm can be used), the microcontroller generates square wave signals with different duty cycles, which are controlled by the optocoupler to adjust the voltage value set by the circuit output. To make the IGBT work normally, proper driving is crucial. The task of the drive circuit is to convert the signal sent by the control circuit into a signal that can be applied between the control terminal and the common terminal of the power electronic device, which can turn it on or off. At the same time, the drive circuit usually also has electrical isolation and power electronic device protection functions. This system uses the EXB841 integrated driver of the EXB series of Fuji Electric to drive the IGBT [4]. 4.3 Sensor input channel and A/D conversion system The voltage signal is collected by the voltage sensor and received by the microcontroller after A/D conversion. This system uses CHV series Hall voltage sensors to acquire voltage and employs the internal A/D converter of the μpsd3354 microcontroller for analog-to-digital conversion. The circuit connection is simple, and the maximum accuracy is 5mV, which basically meets the control requirements. 4.4 Keyboard and Display Circuit The keyboard and display circuits of the power DC power supply are mounted on the operation panel and controlled by the microcontroller. This system uses a self-made 4×4 matrix keyboard, with PB4~PB7 of the microcontroller as output lines and PB0~PB3 as input lines. The display uses a dynamic digital display driven by a dedicated digital tube display driver chip MAX7219. 4.5 Other Auxiliary Circuits To ensure reliable and safe operation of the power DC power supply, the power system includes auxiliary circuits such as overheat, overcurrent, and short-circuit protection. An auxiliary power supply section is also provided to supply the power required by the system. 5. System Software Design The system software mainly consists of a main program and interrupt service routines, primarily used to implement the following functions: keyboard scanning, digital display, A/D conversion, digital PID regulation, and PWM waveform generation. Keyboard scanning and digital display will not be discussed here. This design mainly uses software to realize the digital control of the DC power supply. 5.1 Main Program Design The flowchart of the main program of this system is shown in Figure 4. After completing the initialization of various variables and I/O, the main program can input the desired voltage value and store it in the register. When the start button is pressed, the power supply system is started. Here, it is set that the PWM output duty cycle is set to the minimum value, i.e., 0.1%, during startup. After startup, the A/D conversion subroutine is called and the key value is read. After comparing the feedback voltage value with the given voltage value, the PID regulation calculation is called to update the duty cycle of the drive waveform. Then, the PWM generation subroutine is called to output the PWM signal, and the output voltage is displayed through the display subroutine. [align=center] Figure 4 Main program flowchart Figure 5 PID adjustment subroutine flowchart[/align] 5.2 A/D conversion subroutine directly utilizes the 10-bit ADC port of the microcontroller. The A/D conversion subroutine is relatively simple. The program only needs to complete the following functions: select the analog input channel and pre-set the frequency division number; configure the control register ACON; read the value after A/D conversion and return the data in ADTA0 and ADTA1. 5.3 PID adjustment subroutine PID adjustment is implemented by the microcontroller. The microcontroller calculates the adjustment amount by subtracting the given signal from the feedback signal to control the duty cycle of the switch. In the algorithm, a correction was made. When the deviation and the integral sign are opposite, the integral is cleared to zero. Because if the signs are opposite, it means that the integral term has a counteracting effect, so the integral term is cleared to zero[5]. The PID control flowchart is shown in Figure 5. The parameters KP, KI, and KD are set during the debugging process. 6. Conclusion This system combines the switching power supply with the microcontroller system and designs a power switching power supply with continuously adjustable output voltage. The power supply has high precision, simple circuit, flexible operation, and good application prospects. The single-chip microcomputer control of DC power supply meets the requirements of the development of power electronic new technology products towards the "four modernizations", namely, the high frequency of application technology, the modularization of hardware structure, the digitalization of software control, and the greening of product performance. References: [1] Pressman A. Switching power supply design [M]. Second edition. Translated by Wang Zhiqiang. Beijing: Electronic Industry Press, 2005 [2] Zhang Zhansong, Cai Xuansan. Principles and design of switching power supply [M]. Beijing: Electronic Industry Press, 2004 [3] Wang Zengfu, Li Chi, Wei Yongming. Principles and applications of soft switching power supply [M]. Beijing: Electronic Industry Press, 200 [4] Hao Runke, Yang Yibo. Research on driving and protection circuit of insulated gate bipolar transistor (IGBT) [J]. Journal of Shanghai University of Science and Technology, 2004, 26 (3): 283-285 [5] Tao Yonghua. New PID control and its application [M]. Beijing: Machinery Industry Press, 2002.
Read next

CATDOLL 139CM Lucy Silicone Doll

Height: 139 Silicone Weight: 25kg Shoulder Width: 33cm Bust/Waist/Hip: 61/56/69cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22