Application of SPWM Wave Generated by Single Chip Microcomputer in UPS Power Supply

Publisher:温暖微风Latest update time:2012-03-05 Source: 电源在线网Keywords:SPWM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction

With the continuous development of information technology and the increasing popularity of computer applications, high-tech equipment has higher and higher requirements for power supply quality. Many devices require the power supply to continuously provide constant frequency, constant voltage, and pure sine wave AC without distortion. Uninterruptible power supply UPS is used to power these devices. UPS generally uses the control method of sinusoidal pulse width modulation (SPWM) to invert DC into sinusoidal AC. At present, there are generally three ways to generate SPWM control waveforms: 1. Use discrete component circuits, mainly composed of triangle wave generators, sine wave generators and comparators. Discrete component circuits are complex, difficult to debug, high cost, and poor reliability, so they are rarely used. 2. Use dedicated integrated chips to generate. Dedicated integrated chips are powerful, have high output waveform quality, and are widely used. 3. Use single-chip microcomputers to achieve. Now many single-chip microcomputers have the function of generating SPWM waves. Using single-chip microcomputers can make the circuit simple and reliable, and it is also convenient to monitor, display and process other data parameters of the system, making the control of the entire system very convenient. This article uses the PIC16F73 microcontroller to generate SPWM waves to control the inverter system in the UPS power supply.

2 Hardware Circuit Design

The overall hardware block diagram of the system is shown in Figure 1: After the AC power input from the power grid passes through the rectifier and filter circuit, it becomes a DC voltage and is sent to the power factor correction module (PFC) for power factor correction. At the same time, the DC voltage is adjusted and boosted to 360V. On the other hand, the 48V DC voltage output by the battery passes through the battery boost circuit to obtain a 345V DC high voltage. These two DC high voltages are connected in parallel through diodes and supplied to the bridge inverter circuit. During normal operation, the DC power obtained by the rectification of the mains is used to power the inverter, and when the mains power is abnormal, it automatically switches to the battery power supply. After the DC power is inverted by the bridge inverter circuit, it is then converted into 220V, 50HZ pure sine wave AC power through the output filter to supply the load.


The control circuit is based on Microchip's PIC16F73 microcontroller. The PIC microcontroller is a cost-effective embedded controller with a RISC structure. It adopts a Harvard dual-bus structure with separate data bus and address bus, and has a very high pipeline processing speed.

The maximum clock frequency of PIC16F73 is 20MHZ, and the execution cycle of each instruction is 200ns. Since most instructions are executed in one cycle, the speed is quite fast. It contains 192 bytes of RAM, 4K program memory, 5-way A/D conversion and 2-way PWM wave generator. The peripheral circuit is extremely simple when used, and it is an ideal single-phase inverter power digital controller.

The microcontroller generates an SPWM control signal through internal software, and then transforms it into the four-way drive signal required by the inverter full bridge through the logic gate conversion circuit. After isolation and amplification by the dedicated driver chip TLP250, it is added to the gates of the four IGBTs of the inverter full bridge for drive control. In order

to improve the stability of the output voltage, a voltage feedback closed loop is used in this system. After the output voltage is sampled by the resistor divider, the operational amplifier circuit converts the level into a 0-5V voltage signal that can be accepted by the A/D conversion port of the microcontroller and sends it to the A/D conversion port of the microcontroller. During the running process, the software will perform an A/D conversion at regular intervals to obtain the feedback voltage value, adjust the pulse width of the SPWM signal, and ensure the stability of the output voltage.

3 Software Design

The PIC16F73 microcontroller contains two CCP modules, both of which can be used to generate PWM waves. For PWM signals, period and pulse width are two essential parameters. The PIC16F73 microcontroller stores the PWM period in the PR2 register, and stores the PWM signal high level time value, that is, the pulse width value, in the CCPR1L or CCPR2L register. The internal timer continuously compares the values ​​of these two registers during the counting process. When the set time is reached, the output level changes accordingly, thereby controlling the period and duty cycle of the PWM signal.

The SPWM signal requires the pulse width to change according to the sine law, so the pulse width must change in each PWM cycle. The basic idea of ​​generating SPWM waves by the single-chip microcomputer is to set the PWM cycle value during initialization, and then use the timer to generate an interrupt in each cycle to adjust the pulse width, so as to obtain an SPWM wave with a continuously changing pulse width. But in fact, the SPWM frequency is generally very high and the cycle is very short. It is difficult to complete the adjustment of the pulse width in each cycle. In this system, the SPWM cycle is 20KHZ, and the pulse width is set to change once every six cycles. The actual output SPWM signal is filtered and the resulting sine wave is shown in Figure 6. The waveform is smooth and distortion-free, meeting the accuracy requirements.

In the software design, the CCP2 module is used as the PWM output port, the CCP1 module uses the comparison function, the single-chip microcomputer clock is 20MHZ, and the timing step is 0.2us. First, a sine table is established. In a complete sine cycle, 64 points are sampled. The ratio of the sine value of the sampling point to the peak value of the sine wave is the duty cycle of the SPWM signal at that point. Then, the pulse width value of each point is calculated according to the SPWM cycle, converted into timing steps, and made into a sine table for CCP1 interrupt subroutine to call. The time intervals between these 64 points are also converted into timing steps and stored in CCPR1H and CCPR1L registers. During the program running, the counter TIMER1 is constantly compared with the value of this register. When the set value is reached, CCP1 generates an interrupt and TIMER1 restarts the timing. The interrupt service subroutine is used to modify the duty cycle of the SPWM signal. Its flow chart is shown in Figure 2.

[page] The main program is an infinite loop, waiting for an interrupt to occur. This program uses three interrupts: CCP1 comparison interrupt, which is used to adjust the SPWM pulse width, and the interrupt cycle is 306us; T0 timing interrupt, which performs an A/D conversion of the output voltage feedback sampling value at a fixed time interval. When the microcontroller is initialized, the interrupt cycle of T0 is set to 153us. After an interrupt is generated, the cycle is changed to 306us; A/D conversion

Interrupt, A/D conversion is completed and an interrupt is generated to process the conversion value. The interrupt cycle is 20us. After the program starts running, CCP1 interrupt occurs first, causing the microcontroller to output SPWM wave according to the first pulse width value of the sine table. After 153us, T0 interrupt is generated to perform A/D conversion, and the T0 interrupt cycle is changed to 306us. After 20us, the conversion is completed and an A/D interrupt is generated. Then CCP1 interrupt is again, and the A/D conversion value and sine table are read to adjust the pulse width. This cycle repeats to generate continuous SPWM control signals. The interrupt loop structure is shown in Figure 4.


4 Experimental results and waveforms

The SPWM waveform output by the CCP2 port of the single-chip microcomputer is shown in Figure 5. Since the frequency is 20KHZ and the pulse width is very narrow, only a section of it is intercepted, and the process of the pulse width changing from the minimum to the maximum cannot be seen, but it can be seen that the pulse width gradually narrows in this section of the waveform, which conforms to the change law of SPWM.

After RC filtering, a sine wave as shown in Figure 6 is obtained, with a frequency of 49.6HZ, which is basically consistent with the designed 50HZ. The waveform is smooth and has no distortion, meeting the design requirements.


[page] In this UPS system, a full-bridge inverter circuit is used. The control method is that the two IGBTs on one bridge arm are complementary turned on, and the two IGBTs on the other bridge arm are one normally open and one normally closed. During the negative half-wave, the two IGBTs on the other bridge arm are complementary turned on, and the original bridge arm becomes one normally open and one normally closed. Therefore, it is necessary to convert the one-way SPWM signal generated by the single-chip microcomputer into four-way SPWM signals to drive four IGBTs respectively. The specific implementation circuit is shown in Figure 7.


The SPWM signal and positive and negative half-wave signals output by the single-chip microcomputer are added to the 12th and 13th pins of U3D respectively. This figure only shows the driving waveform generation circuit of the two IGBTs in the same bridge arm. The generation circuit of the other bridge arm is exactly the same as this circuit, except that an inverting circuit is added before the input positive and negative half-wave signals, so that regardless of the positive half-wave or negative half-wave, the 11th pin of U3D of bridge arm 1 and bridge arm 2 is always one SPWM signal and the other low level. After the subsequent circuit transformation, the bridge arm with the SPWM signal obtains two complementary output SPWM waveforms, and the bridge arm with the low level obtains a continuous high level and a continuous low level, thereby realizing the drive of the inverter full bridge.

Since the two IGBTs in the same bridge arm are complementary turned on, the setting of the dead time is essential, otherwise the bridge arm may be directly connected, resulting in damage to the device or even the entire circuit. R2 and C2 in Figure 7 are used to set the dead time, which is obtained through the charge and discharge of the RC circuit.

A time delay is added to the SPWM signal waveform after being processed by the gate circuit. The length of the dead time can be adjusted by changing the size of R and C. In this circuit, the resistor is 1000 ohms and the capacitor is 6.8nF, resulting in a dead time of 5us.

The four-way drive waveform of the inverter bridge finally obtained by circuit transformation is shown in Figure 8. The IGBT drive adopts low level effective. It can be seen from the figure that in the two IGBT drive waveforms of the same bridge arm, when the low level of one drive waveform changes to the low level of another drive waveform, there is a period of time when both signals are high level, that is, the dead time when both IGBTs are not connected, which prevents the inverter bridge from being connected directly.

5 Conclusion

The method of using PIC microcontroller to generate SPWM signal to control the inverter bridge introduced in this article has achieved good experimental results in the application of UPS power supply. At the same time, this method of generating SPWM wave can also be used in other sinusoidal wave inverter power supplies.


References

[1] Uninterruptible Power Supply Reference Design, 1997 Microchip Technology Inc.

[2] He Yinglong and Li Xueyin, PIC16C7X Introduction and Application Examples, Tsinghua University Press, 2002

[3] Tan Zhenghua et al., Intelligent Inverter Power Supply Development and SPWM Wave Software Generation, Journal of Shanghai Jiaotong University, Vol. 34, No. 2, February 2000

Keywords:SPWM Reference address:Application of SPWM Wave Generated by Single Chip Microcomputer in UPS Power Supply

Previous article:Design of serial communication between DSP and single chip microcomputer in high power UPS
Next article:Design and engineering application of hybrid active power filter

Recommended ReadingLatest update time:2024-11-16 16:33

Three-phase sine wave pulse width modulation (SPWM) signal generator SM2001
Abstract: This paper introduces the structure, principle and usage of a special chip that can automatically generate three-phase sinusoidal pulse width modulation waveforms. It can be widely used in the fields of frequency conversion control of three-phase motors, driving of three-phase UPS, etc. Keywords: sinusoida
[Power Management]
Three-phase sine wave pulse width modulation (SPWM) signal generator SM2001
What is UPS? Introduction to UPS
UPS (Uninterruptible Power System), also known as uninterruptible power supply, is a constant voltage and constant frequency uninterruptible power supply with energy storage device and inverter as the main component. It is mainly used to provide uninterrupted power supply to a single computer, computer network system o
[Power Management]
Technical Principle and Application of Flywheel UPS
When it comes to flywheel dynamic UPS, many engineers and technicians may be unfamiliar with it. In order to have a better understanding of dynamic UPS, the following briefly introduces the development history of UPS. UPS has gone through more than 40 years from the initial flywheel generator to today, and has
[Power Management]
Technical Principle and Application of Flywheel UPS
Working principle and process of UPS power supply
  Many industries need to ensure normal power supply under any circumstances, and here we need UPS power supply system. UPS power supply is an important equipment to ensure stable and continuous power supply. Because its main machine is highly intelligent and the energy storage equipment uses maintenance-free batter
[Power Management]
Inspection and normal maintenance of UPS uninterruptible power supply
UPS uninterruptible power supply plays an important role in modern communication power supply. It can extend the life of equipment and ensure the security of data. The power source of UPS is the chemical power supply it is equipped with, so the quality of UPS uninterruptible power supply mainly depends on the perfor
[Power Management]
Design of Fully Digital UPS Inverter Based on DSP Control
With the continuous development of information processing technology, especially the widespread application of computers and the rapid development of the Internet, the reliability requirements of power supply systems are getting higher and higher, so the requirements for the technical indicators of uninterruptible
[Power Management]
Tips for maximizing the life of battery packs in UPS
  introduction   Through statistics of various failures in UPS maintenance work, we can draw the following conclusion: For backup UPS power supply , failures caused by batteries account for more than 50% of the total failures. For online UPS power supply, because of its reasonable circuit design and large margin o
[Power Management]
Research on multi-loop control strategy of single-phase UPS inverter
1 Introduction UPS is mainly composed of batteries, charging and discharging circuits, inverter circuits and control systems, among which the inverter circuit and its control system are the core parts of the UPS power supply. The controlled quantity of the single-phase UPS inverter is a 50 Hz AC quantity, and
[Power Management]
Research on multi-loop control strategy of single-phase UPS inverter
Latest Power Management Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号