Abstract: Based on the PWM (Pulse Width Modulation) controller and the MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor) integrated chip TOPSwitch-FX TOP234Y, the design of a voltage-adjustable digital control switching power supply circuit is analyzed and discussed. The step increase and decrease of the voltage in the range of 5 to 40V are required, with a step accuracy of 0.2V, and the voltage stability is improved by a bidirectional feedback circuit. Keywords: Digital control switching power supply TOPSwitch-FX counting control digital-to-analog converter circuit design 1 Introduction With the rapid development of power electronics technology, ordinary switching power supplies have gradually shown many shortcomings in the design of modern high-tech products, especially the intelligent requirements of switching power supplies. However, digital control switching power supplies have shown advantages in this regard. Digital control is easy to adopt advanced control methods and intelligent control strategies, which can fundamentally improve the performance indicators of the system, reduce the number of components in the control circuit, reduce the size of the control board, improve the anti-interference ability of the system, and improve the reliability of the control system [1]. This paper designs a voltage-adjustable digital control switching power supply based on the PWM controller and the MOSFET integrated chip TOPSwitch-FX TOP234Y. The power supply is mainly used for product testing and development, and can also be used as a power supply for intelligent control. 2 Overall Design Scheme Digital control switching power supply is a circuit system that uses digital signal control to regulate its output voltage and initially realizes the digital and intelligent control of switching power supply. The voltage adjustable digital control switching power supply requires that the voltage output value be controlled by the button to adjust the step increase and step decrease within the range of 5 to 40V, with a step accuracy of 0.2V, and can be adjusted back to the lowest value or preset to the highest value at any time. The accuracy of the output voltage is not less than 0.1V[2], and the maximum output power is not less than 20W. 2.1 System Design A voltage adjustable digital control switching power supply based on TOP234Y is designed. The duty cycle is controlled by the PWM principle. A reversible counter is used to count and the signal is amplified by digital-to-analog conversion to make a control signal. The output voltage is adjusted within a relatively large range. The voltage stability is ensured by the feedback circuit. The digital chip power supply is provided by the internal power supply. According to the function, the system can be basically divided into two parts, namely the analog part of the switching power supply and the digital control part. The analog part realizes the functions of rectification, filtering, power conversion, current limiting protection, etc. of the switching power supply voltage; the digital control part mainly adjusts the PWM duty cycle through counting voltage regulation control signal to change the voltage output value and control the feedback signal to maintain the stability of the voltage output value. 2.2 Basic design idea The system structure mainly includes four modules: analog switching power supply, feedback circuit, PWM and comparator control and digital voltage regulation control. Its system principle block diagram is shown in Figure 1. The analog switching power supply part performs filtering, anti-electromagnetic interference processing, rectification, power conversion and voltage regulation on the input AC mains power. The digital device requires the power supply to remain basically unchanged, but the output voltage will change continuously with digital control adjustment. Therefore, the secondary output of the switching power conversion can only be used as the internal power supply after voltage regulation. Here, a three-terminal voltage regulator is used when the voltage does not exceed the maximum value. The switching power supply feedback adopts bidirectional control of the output voltage. The voltage regulation control signal and the feedback signal are compared and amplified by a comparator and then sent to the PWM controller so that the two will not conflict and neither control signal will be missed. The two control the duty cycle of the switching pulse to regulate and stabilize the voltage [3]. The relationship between the voltage of the control signal and the output voltage is achieved by the PWM controller, so the PWM controller must use a linear PWM controller device. Figure 1 Block diagram of the voltage adjustable digital control switching power supply system. In the feedback circuit, if the output voltage is too high, the error amplification feedback signal enters the comparator and the output voltage after comparison is also too high. The voltage after the converted feedback signal voltage is compared with the counting voltage regulation control voltage of the comparator before the pulse modulator is too low, which leads to a narrowing of the duty cycle and causes the output voltage to drop [4]; the opposite is also true. The principle of voltage regulation control is similar to that of feedback control, but it is integrated into the TOP chip here. In the digital voltage regulation control module, the button controls the counter to increment, decrement, clear, and preset to the maximum value, and the counter outputs a corresponding voltage signal. The signal output by the counter is a digital quantity, so it must be converted from digital to analog to form the corresponding control voltage, that is, the digital voltage regulation control signal. 3 Circuit Design 3.1 Introduction to the PWM Controller and MOSFET Integrated Chip TOPSwitch-FX The TOPSwitch-FX series has three package forms. The TO-220-7B package has five leads: control (C), multi-function (M), source (S), switching frequency selection (F), and drain (D). The multi-function lead mainly provides functions such as line overvoltage and undervoltage protection, reducing the duty cycle Dmax by using line voltage feedforward, and setting the chip's limit current ILIMIT externally. The TOPSwitch-FX mainly consists of a gate driver stage and an output stage, a control voltage source, a bandgap reference voltage source, a frequency jitter oscillator, a parallel regulator/error amplifier, and a pulse width regulator. Its working principle is to use the feedback current IC to adjust the duty cycle Dmax to achieve voltage stabilization. For example, when the output voltage UO increases, the optocoupler feedback circuit causes IC to increase → Dmax to decrease → UO to decrease, ultimately keeping UO constant. TOPSwitch-FX has a major feature: when the control terminal current IC is within the specified range and the multi-function terminal input current IM is a constant value, the output duty cycle Dmax of the pulse width modulator is inversely proportional to IC. The gain of PWM is: K=ΔD/ΔIC= -22%/mA, that is, ΔD=K×ΔIC= -22%·················⑴ As can be seen from equation ⑴, the duty cycle decreases as IC increases. In fact, the duty cycle is not only related to IC, but also depends on the value of IM[5]. 3.2 Optical Coupled Bidirectional Feedback Circuit with TL431 Currently, output feedback can be performed in various ways in ordinary switching power supplies. In the output voltage sampling circuit, there is generally a clamping circuit. The basic principle is to compare whether the output voltage is higher or lower than the clamping voltage[6]. However, in voltage-adjustable switching power supplies, since the output voltage itself is required to change, a similar feedback circuit cannot be used. In order to overcome this problem, the circuit feedback principle no longer adopts a single longitudinal comparison, but combines longitudinal and transverse comparisons. The horizontal comparison is to compare whether the voltages of the two output circuits are the same, while the vertical comparison is to add a delay operation to the other output, and at the same time, the feedback is prohibited during voltage regulation. The specific circuit is to add a delay circuit after the second output is rectified and filtered, and then compare it with the first output to achieve the vertical comparison. In order to prohibit the feedback during voltage regulation, a pulse control is added after the feedback output to control the on and off of the feedback circuit. When there is a voltage regulation pulse signal, the feedback path is interrupted, which is achieved by a voltage-controlled relay. In addition, due to the high accuracy requirement of the voltage, the error voltage must be amplified in the circuit feedback, and a comparator amplifier is added in the middle for feedback. At the same time, the output is isolated by the optocoupler TL431 in the circuit to improve the voltage regulation rate [7]. Its basic circuit schematic diagram is shown in Figure 2. Figure 2 Optocoupler bidirectional feedback circuit with TL431 3.3 Digital voltage regulation control circuit This module includes a counting control circuit and a digital-to-analog conversion circuit. The overall output voltage of the power supply is 5 to 40V, the step value is designed to be 0.2V, and the total number of counts is 175, so an eight-bit binary counter must be used. Starting from 0, the count reaches 175, which is the binary number 10101111. The output signal is sent to the digital-to-analog converter and amplified. Because ΔD is inversely proportional to ΔIC, the change in duty cycle is inversely proportional to the change in IC. When IC increases, the duty cycle decreases and the output voltage decreases. Conversely, when IC decreases, the output voltage increases. Therefore, the step-down control button is connected to the UP pin of the counter, and the step-up button is connected to the DOWN pin. The output voltage is at its maximum when the counter is cleared and at its minimum when it is preset to the maximum. 3.3.1 Counting control circuit The control button is a four-key button, which is used for step-up, step-down, clearing and preset to the maximum value. The reversible counter uses two 74LS193s cascaded to form an eight-bit binary counter. The 74LS193 is a dual-clock 4-bit binary synchronous reversible counter with preset, clear, up and down counting functions [8]. The two 74LS193s are cascaded. The CLR of the first chip is connected to the digital power supply through a voltage high switch. LD is grounded, meaning the preset function is effective when the output is at its lowest level, and all preset data are connected to a high level. UP and DOWN are pulled up to a high level and connected to the oscillation pulse signal source through the voltage step-down and step-up switches, respectively. When CO of the first chip is 0, the count is incremented and carried over; when BO is 0, the count is decremented and borrowed. The counting control of the second chip is performed by the LD, meaning that CO and BO are inverted and connected to the LD together. Other connections are the same as the first chip, forming an eight-bit binary reversible counter. When the count reaches 175, incrementing is invalid; when the count is 0, decrementing is invalid. That is, when the output is 10110000, the counter is cleared. When the output is 00000000, the count is decremented and the counter is preset to its maximum value [9]. The digital voltage regulation control circuit diagram is shown in Figure 3. Figure 3 Digital voltage regulation control circuit diagram 3.3.2 Digital-to-analog conversion circuit The output of the digital voltage regulation control circuit is sent to the digital-to-analog converter. Since no other additional functions are required, an ADC6080 is used as the digital-to-analog converter [10]. Its conversion signal is provided to the power amplifier circuit [11]. The digital-to-analog conversion circuit is shown in Figure 4. Figure 4 Digital-to-analog conversion circuit diagram 3.4 Comparator and PWM control circuit The TOPSwitch-FX series chip integrates protection circuit, PWM controller and MOSFET. Here, the TO-220-7B packaged TOP234Y FX chip can be used directly. The digital control signal and the feedback signal are compared and amplified and then connected to the control terminal C. The M terminal is connected to the positive terminal of the power input through a large resistor [12]. The peripheral circuit of TOP234Y is shown in Figure 5. Figure 5 Peripheral circuit diagram of TOP234Y 3.5 Output voltage regulation circuit The output is divided into two paths. The first path is rectified and filtered to serve as a switching power supply output; the second path provides power to the digital IC. In the entire control circuit, all digital chips require constant voltage power supply. However, during the output voltage regulation process, the second output will also change with the change of duty cycle, so a constant voltage circuit should be added to this output. For the sake of design simplicity, an integrated three-terminal regulator is used here. As long as the positive input voltage is applied to the input terminal of UA7805 and the common terminal of UA7805 is grounded, its output terminal can output the chip's nominal positive voltage. A large filter capacitor should be connected between the input terminal and the output terminal and ground, and a small capacitance capacitor (0.1~10uF) should be connected to ground at the root of the chip pin [13]. 4 Conclusion A digital control switching power supply based on PWM controller and MOSFET integrated chip TOPSwitch-FX TOP234Y was designed, and some key technologies were introduced and analyzed in detail. If a higher precision adjustable power supply is required, the number of bits of the counter and digital-to-analog converter can be increased, but the chip's load capacity should be considered at the same time. If a higher output power is required, the TOPSwitch-FX chip can be replaced. Furthermore, the paper does not cover some important parameters of switching power supplies, such as no-load power consumption, which require further investigation. The authors' innovation lies in designing a voltage-adjustable digital control switching power supply based on a PWM controller and the MOSFET integrated chip TOPSwitch-FX TOP234Y. This allows for step-by-step adjustment of the voltage within the range of 5–40V, with a step accuracy of 0.2V. Furthermore, a bidirectional feedback circuit is used to improve voltage stability. References: [1] Zhou Xinzheng, Zeng Chunnian. Design and application of TOPSwitch-II series single-chip microcomputer switching power supply[J]. Microcomputer Information. 2004, 9: 1-3. [2] Wang Lixin, Yang Chunling. Electronic technology experiment and course design[M]. Harbin: Harbin Institute of Technology Press, 2003, 165. [3] Ren Yuanyuan, Zhang Zhiguo, Sun Qingjun, et al. Application of numerical control switching power supply in telemetry system[J]. Telemetry and Remote Control, 20(4): 30. [4] Liu Qiyuan, Zhu Shisha, Wang Qixin, et al. Design of numerical control high voltage source based on PWM technology[J]. Journal of Natural Science of Xiangtan University, 26(1): 12. [5] Zhou Zhimin, Zhou Jihai, Ji Aihua, et al. Single-chip switching power supply[M]. Beijing: Electronic Industry Press, 2004, 17, 32-39. [6] Li Jinban, Li Jiehui, Li Jieming. Switching Power Supply Technology [M]. Beijing: Chemical Industry Press, 2006, 1-2. [7] Dai Jia, Dai Weiheng. 51 Microcontroller C Language Application Programming Examples [M]. Beijing: Electronic Industry Press, 2006, 450. [8] Kang Huaguang. Basic Electronic Technology Digital Part (Fourth Edition) [M]. Beijing: Higher Education Press, 2000, 252-253, 389. [9] Ma Jixun, Zhang Xigeng. Essentials and Typical Questions for the Postgraduate Entrance Examination in Basic Electronic Technology [M]. Xi'an: Xi'an Jiaotong University Press, 2002, 254. [10] Zhou Mingde. Microcomputer Principles and Applications (Fourth Edition) [M]. Beijing: Tsinghua University Press, 2002, 341. [11] Kang Huaguang. Basic Electronic Technology Analog Part (Fourth Edition) [M]. Beijing: Higher Education Press, 1999, 210-211. [12] Feng Wenli. Design and fabrication of TOP switching power supply. Journal of Liaoning Institute of Technology [J], 2002, (22) 11-12. [13] Huang Zhiwei et al. Training course for the National Undergraduate Electronic Design Contest [M]. Beijing: Electronic Industry Press, 2005, 75. PDF data can be downloaded by clicking: Design of Digital Control Switching Power Supply