An efficient and stable single-phase online uninterruptible power supply

The system is an AC sine wave online uninterruptible power supply designed with STM32F407 as the main controller and full-bridge single-phase inverter as the core technology. The system is based on the STM32F407 single-chip microcomputer, and consists of a rectifier circuit, a BOOST circuit, a PFC power factor correction circuit, and a full-bridge single-phase inverter circuit. When the input of the system is switched between 29V~43V AC power supply and 24V DC power supply, the output voltage can maintain an AC sine wave with constant frequency and amplitude. Experimental data shows that the system has high operating efficiency and excellent stability.


Introduction
Today, uninterruptible power supplies have been widely used in important industries such as aerospace, computers, communications, banking, medical care, industrial manufacturing, and education. Compared with the traditional power supply system, the advantage of the uninterruptible power supply is that it can quickly switch the reserve power supply in the event of a power failure to maintain the stable output voltage. Uninterruptible power supply can be divided into backup type, online interactive type, online type, etc. according to its working mode [1][2]. At present, the uninterruptible power supply mainly adopts the online working mode, which is mainly composed of rectification, energy storage, inverter, and switch control parts. Its principle is that the inverter is always in working condition. At the moment of power failure, the inverter supplies power. The power supply is quickly switched from the grid to the backup power supply, and the output AC voltage is always stable. This greatly improves the stability and safety of the electrical system [3]. This article proposes a highly efficient and stable online uninterruptible power supply solution. When 29V～43V AC is input to the system and AC power is disconnected, the output is always 30V AC sine wave.
In this article, it first summarizes the operation of the entire system, and then introduces the hardware design and software design. Finally, specific data analysis is carried out on the power efficiency and stability of the system.

The overall structure of the system
The system consists of autotransformer, rectifier bridge, APFC circuit, BOOST circuit, switching circuit and single-phase full bridge inverter circuit [4][5]. The singlephase full-bridge inverter circuit is controlled by the single-chip STM32F407. The system structure block diagram is shown as in Fig. 1.
First, the grid voltage is stepped down to 29V～43V AC through an autotransformer and input to the rectifier bridge, and the pulsating DC power obtained after rectification is input to the APFC circuit. Using the APFC circuit, on the one hand, it can achieve power factor correction and improve the power utilization of the system. On the other hand, the AFPC circuit with BOOST topology can obtain a relatively stable DC voltage after boosting at the output. This DC voltage will be used as the supply voltage of the single-phase full-bridge inverter to maintain the operation of the inverter.
Secondly, when the AC input is suddenly disconnected, the switching circuit quickly switches the power supply of the inverter to the power storage device, and the power storage device continues to provide sufficient voltage and current for the inverter through the BOOST circuit to ensure the inverter Normal operation.
In this system, the boost converter is composed of switching power supply or PFC, which greatly improves the power utilization rate of the system. The inverter is controlled by the single-chip microcomputer by detecting the output voltage and current and using the PID control strategy to achieve closed-loop control, and the output voltage amplitude and frequency are stable. The front-stage rectifier circuit of PFC uses an integrated bridge rectifier chip. The PFC circuit uses UCC28019 power factor correction chip to increase the voltage to a DC voltage of 65V. The VSENSE pin of this chip is connected to the feedback network resistor network formed by and . The feedback resistor provides feedback induction for the adjustment of the internal 5V reference voltage, thereby adjusting the output voltage. The calculation formula of the output voltage is: The minimum value of the boost inductor is calculated based on the worst-case duty cycle of 0.5: (2) is 65kHz, is the current peak-to-peak value. In this design, is 0.42A, the calculated inductance value is 0.6mH, and the actual value is 1mH. Because the size of the output capacitor meets the requirement of the converter's retention rate, the minimum value of the output capacitor is calculated as follows: In the formula, is the holding time of the capacitor voltage, which is 21.28ms, is the output voltage of 65V, and _ is the minimum output voltage, and the value is 20V. The calculated output capacitance value is 2225uf, and the actual value is 2200uf.

3.2.BOOST circuit
In the BOOST circuit, the input V is 24V DC voltage from the storage device, and the output v is 50V. The ripple coefficient of the output current is r=0.4, and the maximum output current is 2A. Calculated according to the following formula, the duty cycle D=0.52 and the inductance L=334.6uH. Taking into account the corresponding margin, the actual inductance is L=350uH.
The higher the Q value of the inductor in the BOOST circuit, the higher the efficiency of the circuit. In the design of inductors, improving the Q value and reducing losses are always the key considerations. In this experiment, a pot-shaped magnetic core is used to wind the inductor, which can reduce the number of turns of the coil, reduce the resistance value of the coil, and improve the Q value.

3.3.Single phase full bridge inverter circuit
It is known that the system needs to output a current of 0.1A to 1A, and the load varies from 30Ω to 300Ω. According to the following formula, calculate the inductance and capacitance of the filter.
The calculated inductance value L=1.68mH, the actual value is 1.3mH. The capacitance value C=3.75uf, the actual value is 4.7uf.

Controller
This system uses STM32F407 as the controller, with 17 timers inside, which can realize timing interrupt, output high frequency PWM signal, input capture and other functions. The device can provide high-frequency SPWM signals for the inverter, and has three 12-bit ADCs with a speed of 2.4MSPS or 7.2MSPS. The output voltage and current values can be read through an external voltage and current sampling circuit.

4.2.PFC circuit design
At the lowest input AC voltage of 29V, the DC voltage obtained after rectification and filtering is 41V, which cannot reach the bus voltage required to output a 30V AC sine wave, so the input AC voltage needs to be rectified and boosted.
In order to ensure the stability of the AC sine wave voltage output by the system, the bus voltage of the inverter must remain stable when the input AC voltage changes. At the same time, in order to improve the overall power utilization of the system, the efficiency of the prestage voltage regulator circuit of the inverter should be improved as much as possible.
Based on the above design factors, this system uses the UCC28019-based PFC power factor correction circuit to adjust the inverter bus voltage. The peripheral circuit of UCC28019 is simple, and the output voltage can be adjusted by adjusting the voltage divider ratio of the feedback resistor.
The schematic diagram of PFC circuit is shown as in Fig. 2.

BOOST circuit design
The input of the system is a DC voltage of 24V, and the PWM with the corresponding duty cycle is generated by the microcontroller to control the output voltage.
This system uses LM5109 as the driver chip of the MOS tube, and cooperates with the half bridge composed of CSD19536 to form the BOOST topology. The MOS tube has a drain-source voltage of up to 100V, a continuous drain current of 150A and an on-resistance of 2.3mΩ, which can not only ensure the safety of circuit operation, but also reduce the power consumption on the MOS tube and improve the efficiency of the circuit.

Switching circuit
When the power fails, the output voltage of the BOOST circuit will replace the output voltage of the PFC to become the bus voltage of the inverter. In this system, the unidirectional conduction characteristic of the diode can be used to complete the fast switching of the power supply.
Under normal circumstances, the inverter is powered by the 65V output by the PFC, and the BOOST circuit is always in the working state of outputting 50V, and the diode is reversely cut off at this time. At the moment of power failure, the output voltage of the PFC drops. When it drops below 50V and the forward bias voltage on the diode can make it conductive, the 50V voltage output by the BOOST circuit replaces the 65V voltage output by the original PFC as an inverter. powered by. The schematic diagram of the switching circuit is shown in Figure 3.

Single-phase full-bridge inverter circuit design
This system uses IR2104 as a half-bridge driver, combined with CSD19536 to form a full bridge. IR2104 comes with a dead time of 520ns, which can effectively prevent the upper and lower tubes of the same bridge arm from being turned on at the same time to cause short circuit and burn out the components.
The schematic diagram of the single-phase full-bridge inverter circuit is shown in Figure 4.

Current and voltage sampling circuit
As the inverter bus voltage fluctuation and load change will affect the stability of the output voltage. Therefore, the output voltage and current sampling circuits are added to the system, and the single-chip microcomputer adjusts the modulation ratio of the SPWM through the feedback sampling value to achieve the purpose of stabilizing the inverter output voltage. In this system, a constantan resistor and INA282 are used to build a current detection circuit. The voltage drop generated by the current flowing through the constantan resistor is output to the ADC port of the single-chip microcomputer through the INA282 fixed amplification 50 times.
The voltage sampling circuit is composed of an INA149 differential amplifier and a resistor divider network. INA149 has a very high common-mode input voltage range, even when the common-mode signal voltage is as high as ±275V, it can accurately measure smaller differential voltages. Therefore, it is used to sample the AC sine wave voltage output by the inverter.
It is worth noting that, because the current and voltage sampling circuits are powered by a single power supply and the ADC of the microcontroller cannot sample negative voltages, attention should be paid to the reference voltage given to the REF pins of INA282 and INA149 to increase the output voltage of the sampling circuit. The average value makes the waveform of the voltage signal sampled by the ADC of the microcontroller not distorted.
The schematic diagram of the voltage and current sampling circuit is shown in Figure 5.

software design
The system is controlled by only one main controller. The main controller has the function of outputting high frequency PWM signal, detecting output voltage, current and human-computer interaction.
After the system is initialized, the main controller generates a PWM signal to make the boost circuit work normally, and two complementary SPWM signals make the single-phase full-bridge inverter work. The main controller measures the peak-to-peak value of the output voltage and current through its own AD converter, and first judges whether the output is over-current, if overcurrent, the over-current protection is activated to make the output current constant, otherwise the output voltage is adjusted through PID to make The output stabilizes at the desired voltage value.
A simple human-computer interaction device is designed in this system. The voltage and current values read by the main controller will be displayed on the OLED screen, and a 4*4 matrix keyboard is provided externally, which can adjust the current limit threshold, output voltage and output current.
The software workflow of the system is shown in Figure 6. In this experiment, a DC stabilized source was used to replace the power storage device, and the entire system was powered by a 24V DC stabilized source. At first, the AC input was 0V, which was boosted to 50V by the BOOST circuit from 24V to supply power to the inverter. Then input the AC voltage of 29V～43V through isolation and autotransformer. The experimental environment is shown in Figure 7.

Data analysis
Use the physical model of manufacturing to verify the effectiveness of the system under given conditions. Analyze the system's operating efficiency, load regulation rate, voltage regulation rate and other circuit performance indicators through actual data. ⑴ When AC input =36V, load RL=30Ω and =300Ω, the measured output AC voltage Uo, frequency f, and distortion THD are shown in Table 1. , and load regulation SI are shown in Table 2. ⑶AC input, Io=1A, adjust the input voltage to change from 29V to 43V, and measure the output AC voltage , and the voltage adjustment rate as shown in Table 3. ⑷Disconnect the AC power supply and supply power by a 24V DC regulator. When the output current Io=1A, the measured output AC voltage, input current and the efficiency η of the online uninterruptible power supply are shown in Table 4.  According to the test data, it can be seen that this system can stabilize the output frequency of 50Hz and the effective value of 30V AC sine wave voltage with AC input, the output voltage error is ±0.1V, the load regulation rate is ≤0.1, the voltage regulation rate is ≤0.133, The distortion degree of the output AC sine wave THD≤0.3.
When the AC input voltage is zero and the system is switched to the DC stabilized power supply, the system can still output a stable AC sine wave voltage of 30V effective value, and the efficiency can reach 94.74%.

Conclusion
The system has good uninterruptible power supply characteristics, excellent load regulation rate and voltage regulation rate, stable output voltage and can be controlled by buttons, with over-current protection function, which can meet the application requirements of most products.