Design of digital regulated power supply based on feedback control

: This paper studies and designs a multi-functional digital regulated power supply, which can realize the switch between the two functions of numerical control current source and numerical control voltage source, and can set the relevant current parameters and voltage parameters through the keyboard. The idea of feedback control is fully adopted to establish the internal and external double negative feedback structures, so as to improve the precision of the regulated power supply. The digital regulator has the advantages of convenient control, large amount of display data, stable performance and so on. It is suitable for various applications of small capacity power supply.


Introduction
With the rapid development of electronic technology, the application of the power supply is more and more widely, although the types of power supply on the market are very complete, it is rare to find a power source with the advantages of switchable current/voltage source, adjustable output power parameter, simple peripheral circuit, high reliability, low cost and so on. Therefore, this paper designed a digital regulated power supply based on feedback control, which can control the output of current/voltage source through the keyboard, the power supply also has the function of adjustable output parameters. This kind of power supply has perfect function, simple peripheral circuit, high reliability, and can be used by students and researchers. It is believed that it will bring a lot of conveniences to all kinds of experiments that need power supply.
In order to make the design reach the above mentioned characteristics, the overall design scheme and hardware design principle are discussed in detail before the design.
2 Overall design scheme and hardware design principle

Overall design scheme
The overall structure diagram of the system is shown in Figure 1.
After inputting the output voltage/current parameters through the keyboard, the microprocessor outputs data and then the analog signal is obtained through digital to analog conversion as a given signal, which is amplified by filtering and enters the error amplifier, and then outputs voltage/current through the power amplifier circuit. In order to realize the closed-loop control, the output voltage is diverted to the error amplifier on the one hand, and to the microprocessor through analog to digital conversion on the other hand, so as to realize the double closed-loop feedback control of the output voltage/current.

Stable voltage and constant current structure of power supply
Stable voltage and constant current structure of power supply can adopt the form of DC/DC conversion, that is, through the PWM generator output PWM wave, and then through the power amplifier filter to get the power supply voltage or current, then the negative feedback of output voltage and current is introduced to control the duty cycle of PWM wave output by PWM generator, thus forming a closed-loop control, realize the function of the power supply stability. Although the efficiency of this method is high, because the transistor will introduce excessive switching noise, and the digital regulated power supply pays more attention to the stability performance, it adopts the form of linear voltage stabilization, that is, after the voltage signal is given by the digital to analog converter, the negative feedback of voltage and current is introduced after the voltage circuit is amplified by the power amplifier circuit, so as to form A closed-loop control and realize the function of voltage stabilization/constant current of the power supply.

Selection of closed-loop control method
The single closed-loop control method can be used, that is, only the error amplifier in the linear voltage regulator/constant current circuit is used for negative feedback closed-loop control. In this way, the control circuit is simple. In order to improve the control precision and anti-interference ability of the power supply system, the double closed-loop control method is selected, that is, on the basis of the single closed-loop control method, the microprocessor is used as the outer closed-loop to form the double closed-loop control, which is to be more stable and reliable. The power supply system uses microprocessor as the external closed-loop control and error amplifier as the internal closed-loop control. Effectively improve the control precision and anti-interference ability of the system.
The internal closed-loop is controlled by an error amplifier composed of operational amplifiers. Since the response speed of all links of the internal closed-loop is very high and there is no inertial load, it can be equivalent to a zero-order system. The amplification factor of the operational amplifier is its open-loop amplification factor which is set as A , set the output voltage of the voltage amplifier as U , and the output voltage of the power source as U , then: Because the op-amp's amplification A goes to infinity, so: That is, the output of the voltage amplifier is equal to the output of the power supply when working normally.
The outer closed-loop is controlled by microprocessor and uses PID algorithm for fine tuning. Under normal working conditions, the set value of the system is equal to the output value.
From the above theoretical derivation, it can be concluded that under normal working conditions, if the open-loop magnification tends to infinity, the set value of the system is equal to the output value. However, due to the accuracy of microprocessor control algorithm, the amplification of op-amp and the accuracy of digital to analog converter are limited, the output must have a certain error.

Method selection of input parameters
Referring to the MP3 keyboard mode which is widely used now, it uses simple four separate keys' input. Keys 1 and 2 are used to adjust the output parameters, key 3 is used to switch the voltage source and current source, and key 4 is the confirmation button. Compared with the traditional 4 4 matrix keyboard, this way is more humanized and easy to operate.

D/A conversion circuit
The system uses digital to analog converter as the given part of the system, so the choice of digital to analog converter is very important. The main parameters of selecting digital to analog converter are mainly resolution, establishment time and output noise. The output range of the power supply in this paper is set as 0-12V, and the step value is 0.01V.
Because 12/0.01=1200>1024, therefore, it is necessary to select a 12 bit D/A converter. As A given link of the forward channel, the establishment time of digital to analog converter has a direct impact on the response speed of the system. The faster the response speed of a system is, the easier it is to get accurate control performance. Therefore, the digital to analog converter with less establishment time is chosen.
In addition, just like the op amplifier, the output signal of the digital to analog converter will be accompanied by noise. The output noise will directly lead to the output noise of CNC power supply. Therefore, a low noise digital to analog converter should be selected [1] .
In summary, the high speed, high precision and low noise digital to analog converter TLV5616 of TI company is used in the system. TLV5616 is a 12 bit voltage output digital to analog converter (DAC), with a flexible 4-wire serial interface, which can seamlessly connects TMS320, SPI, QSPI and Microwire serial ports. Digital power supply and analog power supply are supplied separately, and the voltage range is from 2.7V to 5.5V. The output buffer is a double gain rail to rail output amplifier, and the output amplifier is class AB to improve stability and reduce setup time. The rail to rail output and power off mode are very suitable for single power supply and battery powered applications. The setup time and power consumption ratio can be optimized by the control word. The unit circuit is shown in Figure 2.

Voltage amplification and low pass filtering circuit
Even if the low noise digital to analog converter is selected, there will still be high frequency voltage noise in its output. Therefore, the RC low-pass filter is usually installed in a series between the digital to analog converter and the voltage amplifier as well as between the voltage amplifier and the error amplifier. Experiments show that the simple RC low-pass filter can greatly reduce the noise of the circuit. In addition, since the output voltage of the digital to analog converter is up to 2.5V, the amplification factor of the voltage amplifier needs to be set to 5, so that the output reaches 12V. The unit circuit is shown in Figure 3. OP07 high-precision operational amplifier has the very low input offset voltage, very low offset voltage temperature drift, very low input noise voltage amplitude and long-term stability [2] . It can be widely used in stable integral, precise absolute value circuit, comparator and precise amplification of weak signal, especially in aerospace, military industry and precision instruments requiring miniaturization and high reliability.

Error and power amplifier circuit
In order to realize voltage stabilization/constant current, the system introduces a double closed-loop negative feedback control. The inner loop is composed of an error amplifier, and the negative feedback of the output voltage/current is introduced to form a closed loop. As a comparison link, the response speed and precision of the error amplifier directly affect the control precision, so a precision high-speed amplifier is needed. In this paper, a low noise and precision high-speed OP27 is selected.
The output of the error amplifier has no load capacity, so it needs to be connected to the power amplifier circuit. an integrated Darlington tube TIP122 was selected with an output current of 5A and a typical β value of 2500 [4] .
The error and power amplifier circuit is shown in Figure 4.

Detection circuit
In this paper, a measuring resistor is placed at the power supply end, and then a current detection amplifier is used to amplify the voltage at both ends of the resistor to get the current of the load. Using the current detection amplifier INA196, it can realize 36V common mode input under 5V power supply [3] . The unit circuit is shown in Figure 5.

Switching circuit of constant voltage source and constant current source
Since the voltage feedback signal and current feedback signal before entering the error amplifier have been adjusted into voltage signals, the analog switch can be directly used to complete the switch from voltage source to current source. MPC508 was used in this paper.

The software design
The design of the software system selects the MSP430F148 produced by Texas Instruments as the control chip, using the 64-pin square flat package, with 48KB+256B flash memory, 2KB RAM. MSP430 series chips can work in -40℃-85℃ temperature environment, with ultra-low power consumption: standby mode of 1.6μA, off mode of 0.1μA, active mode of 280μA, and has 5 power saving modes; 16-bit RISC architecture, 16-bit integrated register and constant generator, 2 built-in 16-bit timers, A fast 12-bit analog to digital converter and 48 I/O pins, etc [5] . C language is used to write the program, and the system program flow chart of the software program is shown in Figure 6. The initial value is set by the input keyboard, MSP430 monitors whether the output reaches the setting through feedback. If it reaches the initial set value, the program ends. If it is not reached, the PID operation is carried out for adjustment, and the stable value is output to the D/A converter, and then the program ends.

Testing and Analysis
Under no-load and several different load conditions, the power supply equipment can output a series of voltage or current by setting the relevant output parameters through the keyboard type selected above, and measure the actual voltage or current data with a high-precision multimeter, and then sort the data results into a table. Among them, the data table tested by the voltage source is shown in Table 1, and the data table tested by the current source is shown in Table 2. By analyzing Table 1 and Table 2 above, it can be concluded that the error of output voltage source and output current source is within 0.005. Due to the influence of production, the accuracy of the voltage regulator can be controlled at least within 0.01.

Conclusions
In this paper, the design is based on MSP430 series MCU as the control core of the multifunctional numerical control power supply. The CNC power supply mainly has three innovation points: 1. The power supply realizes the simple keyboard control, and the output is more accurate.
2. Switching voltage source and current source can be realized by keyboard.
3. Flexible setting of voltage and current protection through the keyboard.
The actual test results show that the accuracy of voltage and current is better than 0.5%, and the design is completely feasible, which has the value of popularization and application.