Design of a sine wave output inverter power supply based on single chip microcomputer

Publisher:yuehuiLatest update time:2011-08-08 Source: chinaaetKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Low-voltage, low-power inverter power supplies have been widely used in industrial and civilian fields. In particular, the development and utilization of new energy sources, such as the widespread use of solar cells, requires an inverter system to convert the DC voltage output by solar cells into 220V, 50Hz AC voltage for easy use. This paper presents a design of a sine wave output inverter power supply controlled by a single-chip microcomputer. It takes a 12V DC power supply as input and outputs 220V, 50Hz, 0~150W sine wave AC power to meet the power supply needs of most conventional small appliances. The power supply adopts a two-stage conversion of push-pull boost and full-bridge inverter, and the front and rear stages are completely isolated. In the control circuit, the front-stage push-pull boost circuit is controlled by the SG3525 chip, and the transformer winding voltage is sampled for closed-loop feedback; the inverter part adopts a single-chip microcomputer digital SPWM control method, sampling the DC bus voltage for voltage feedforward control, and sampling the current for feedback control; in terms of protection, it has multiple protection function circuits such as input over- and under-voltage protection, output overload, short-circuit protection, and overheating protection, which enhances the reliability and safety of the power supply.

The power supply can output 220V±10V sinusoidal AC voltage with a frequency of 50Hz±0.5Hz and a DC component within the input voltage range of 10.5V to 15V. 波形畸变率<5%,并且有很强的过载能力。由于采用了单片机数字化spwm控制方式,控制灵活方便,可以在不改变电路结构的条件下,只改变程序,使逆变器输出110v、60hz正弦波交流电,以适应不同用户的需求。 p="">

1 Main circuit

The inverter power supply main circuit adopts push-pull boost and full-bridge inverter two-stage conversion, as shown in Figure 1.

One end of the input voltage is connected to the middle tap of the primary side of the transformer, and the other end is connected to the midpoint of the switch tubes S1 and S2. Control S1 and S2 to conduct in turn, forming a high-frequency AC voltage on the primary side of the transformer, and after the transformer boosts, rectifies and filters, a DC voltage of about 370V is obtained on the capacitor C1. The inverter bridge composed of S3~S6 adopts sinusoidal pulse width modulation. After the inverter output voltage is filtered by inductor L and capacitor C2, a 220V, 50Hz sinusoidal AC is finally obtained on the load. The use of high-frequency transformers to achieve isolation between the front and rear stages is conducive to improving the safety of the system.

The input voltage is 10.5~15 V, the maximum input current is 15A, considering the one-fold margin, the withstand voltage of the push-pull circuit switch tubes S1 and S2 is not less than 30V, the forward current is not less than 30A, and IRFZ48N is selected.

The design of the step-up high-frequency transformer should meet the requirements that when the input voltage is the lowest, the secondary voltage after rectification is not less than the minimum voltage of 350V required by the inverter part. At the same time, when the input voltage is the highest, the secondary voltage cannot be too high to avoid damage to the components. At the same time, the voltage drop and heating problems on the winding must also be considered. Select EE type ferrite core, the original secondary winding is 7 turns: 300 turns. For the design of high-frequency transformers, please refer to the literature.

The transformer secondary output rectifier bridge is composed of 4 HER307. The filter capacitor is a 68μF, 450V electrolytic capacitor.

According to the output power requirement, the output current effective value is 0.6~0.7A. Considering certain voltage and current margin, IRF840 is selected for S3~S6 in the inverter bridge. The inverter part adopts unipolar SPWM control mode, and the switching frequency fs=16kHz.

Assuming that the filter time constant is 16 times the switching period, that is, the resonant frequency is 1kHz, then

The filter inductor and capacitor LC≈2.5×10-3, L=5mH, C=4.7μF can be selected. The filter inductor L uses a ring-shaped iron powder core with an inner diameter of 20mm and an outer diameter of 40mm. The winding uses 2 strands of enameled wire with a diameter of 0.4mm and 180 turns.

2 Digital SPWM Control Method

The control circuit of the inverter power supply is also divided into two parts. The front-stage push-pull boost circuit is controlled by the PWM dedicated chip SG3525, sampling the transformer winding voltage to achieve voltage closed-loop feedback control. The rear-stage inverter circuit is controlled by the microcontroller PICl6C73, sampling the bus voltage to achieve voltage feedforward control. The front-stage control method is relatively simple, and here we mainly introduce the digital SPWM control method of the rear-stage microcontroller.

2.1 Sinusoidal Pulse Width Modulation SPWM

Sinusoidal pulse width modulation (SPWM) technology has the advantages of linear voltage regulation and harmonic suppression, and is currently the most widely used pulse width modulation technology. Generally, a triangle wave μc is used as the carrier signal, and a sine wave ug=UgmSin2πfgt is used as the modulation signal. According to the intersection of μ and μg, a series of pulse signals with pulse widths that change according to the sine law are obtained. The modulation ratio m=Ugm/Ucm and the frequency ratio K=fc/fa=Tg/Tco can be defined.

Sinusoidal pulse width modulation can be divided into unipolar SPWM and bipolar SPWM. The carrier of bipolar SPWM is a symmetrical triangle wave with both positive and negative half cycles, and the output voltage is a positive and negative alternating square wave sequence without zero level, so it can be applied to half-bridge and full-bridge circuits. In practice, the frequency ratio K should be selected as an odd number, so that the output voltage μo has the properties of odd function symmetry and half-wave symmetry, and μc has no even harmonics. However, the output voltage μc contains relatively serious n=Kth central harmonics and n=jk±6th side frequency harmonics. Its control signal is two pulse signals with complementary phases.

The carrier of unipolar SPWM is a unipolar asymmetrical triangle wave, and the output voltage is also a unipolar square wave. Because the output voltage contains zero level, unipolar SPWM can only be applied to full-bridge inverter circuits. Since its carrier itself has the characteristics of odd function symmetry and half-wave symmetry, the output voltage Uo has no even harmonics regardless of whether the frequency ratio K is an odd number or an even number. The unipolar characteristic of the output voltage makes uo not contain n=k center harmonics and side frequency harmonics, but has a small amount of low-frequency harmonic components. The control signal of the unipolar SPWM is a group of high-frequency (carrier frequency fe) pulses and a group of low-frequency (modulation frequency fk) pulses. The two pulses in each group are complementary in phase. From the geometric relationship between the triangular carrier and the sine modulation wave, it can be obtained that when k>l, the duty cycle D of the high-frequency pulse is



2.2 Software Implementation of PIC MCU

PIC16C73 is a mid-range MCU from Microchip, which is powerful and inexpensive. There are two CCP (Capture, Compare, PWM) modules inside PIC16C73. When it works in PWM mode, the CCP x pin can output a square wave with a 10-bit adjustable duty cycle. Figure 2 is its working principle diagram.

TMR2 will perform two comparisons synchronously during the counting process: the consistency between TMR2 and CCPRxH will cause the CCPX pin to output a low level; the consistency between TMR2 and PR2 will cause the CCPx pin to output a high level, while TMR2 will be cleared to 0 and the next CCPRxH value will be read in, as shown in Figure 3. Therefore, setting the CCPRxH value can set the duty cycle, and setting the PR2 value can set the pulse period. The pulse duty cycle D can be expressed as



In this design, the full-bridge inverter adopts unipolar SPWM modulation. The CCP1 module is used to generate high-frequency pulses, and the CCP2 module is used to generate low-frequency pulses. Select a 16M crystal oscillator. According to the pulse period Tc=[(PR2)+l]×4×4*Tosc and the frequency ratio k=Tg/Tc, PR2=249, k=320 can be taken, then Tg=20 ms, and each cycle of the high-frequency pulse sequence contains: 320 pulses. Assume that the modulation ratio m=0.92, and substitute t=TgN/320 into formula (2). The combined formula (3) can obtain the value of CCP1H required to generate high-frequency pulses. The 0th to 79th pulses are

CCP1H=230sin(πN/160) (4)
Where: N is 0→79.
Considering the symmetry of the sine wave, the 80th to 159th pulses can be obtained as
CCP1H=230sin[π×(80-N)/160] (5)
According to the complementarity of the pulses, the 160th to 239th pulses can be obtained as
CCP1H=250-230sin(πN/160) (6)
The 240th to 319th pulses can be obtained as
CCP1H=250-230Sin[π×(80-N)/160] (7)


Therefore, by storing the table 230sin(πN/160), N∈[0,79] in the program, the CCPH value of the entire cycle of 320 high-frequency pulses can be obtained. From point 0 to 79, CCP1H is the forward table value; from point 80 to 159, CCP1H is the reverse table value; from point 160 to 239, CCP1H is the count cycle minus the forward table value; from point 240 to 319, CCP1H is the count cycle minus the reverse table value. For

low-frequency pulses, the first half of the cycle can be regarded as consisting of high-frequency pulses whose duty cycle is always 1, and the second half of the cycle can be regarded as consisting of high-frequency pulses whose duty cycle is always 0. Therefore, from pulse 0 to 159, CCP2H=250, and from pulse 160 to 319, CCP2H=0.

Figure 4 is the flow chart of the MCU_TMR2 interrupt program. In the interrupt program, the value of CCPxL is modified by looking up the table. The CCPxH value of the next pulse can be changed, thereby modifying the duty cycle of the next pulse and realizing SPWM control.

3 Experimental results

In the experiment, the input voltage range is 10.5~15 V, the output filter inductor is 5.3mH, the filter capacitor is 8μF, and the output (220±10V), 50Hz sine wave AC voltage can be output from no-load to 150W load state, as shown in Table 1 and Table 2. Figure 5 and Figure 6 are the output voltage and current waveforms under no-load and 150W pure resistive load conditions respectively. It can be seen that the output voltage and current waveforms are good, and the measured THD of the voltage waveform is 3.6%.

4 Conclusion

This paper analyzes in detail the design of a sine wave output inverter power supply and the implementation method of digital SPWM control based on a single chip microcomputer. Digital SPWM control is flexible, the circuit structure is simple, and the core part of the control is in the software, which is conducive to protecting intellectual property rights.

Keywords:MCU Reference address:Design of a sine wave output inverter power supply based on single chip microcomputer

Previous article:1.2 to 33 VDC digital voltage supply design
Next article:Design of communication power supply monitoring system based on Web and CC430F6127

Recommended ReadingLatest update time:2024-11-16 21:50

What is an automotive-grade MCU? Application of domestic control chips
Introduction to control chips Control chips mainly refer to MCU (Microcontroller Unit), which is a microcontroller, also known as a single-chip microcomputer. It appropriately reduces the CPU's main frequency and specifications, and integrates multiple functional modules and interfaces such as memory, timer, A/
[Embedded]
What is an automotive-grade MCU? Application of domestic control chips
Application of ICL7135 and PIC microcontroller in temperature transmitter
introduction In the design of intelligent instruments, A/D converters are often used. Among the commonly used A/D converters, 7135 is the most widely used. It has 41/2-bit A/D conversion accuracy, strong anti-interference ability, and low price. It is mainly used for the measurement and display of detection
[Industrial Control]
Application of ICL7135 and PIC microcontroller in temperature transmitter
LPC1768 PWM Experiment
PWM is pulse width modulation. Pulse width modulation is a very effective technology that uses the digital output of a microprocessor to control analog circuits . It is widely used in many fields from measurement, communication to power control and conversion. Pulse width modulation is an analog control method that m
[Microcontroller]
51 MCU timer realizes PWM wave
The 51 single-chip microcomputer can realize PWM wave output, and the principle is actually the same. To put it simply, the PWM wave is a signal that makes a certain pin output a periodic and continuous high and low level change. So how to use the 51 single-chip microcomputer to achieve periodic high and low levels?
[Microcontroller]
How to use printf in C51 serial port
Use of serial port printf The function prototype is as follows: void USART0_Printf(char *fmt,...) //This is our printf function {  char* ap; //typedef char *va_list; va_list is a pointer of type char  charxdata string ; //Access external RAM two-byte alignment  va_start(ap,fmt); //The function of this function is to
[Microcontroller]
The P2 port of the microcontroller is connected to 8 switches, and the P0 port is connected to 8 LED lights
question Connect 8 switches to the P2 port of the microcontroller, and connect 8 LED lights to the P0 port (P0 port is required to be connected to the anode of the LED). By controlling the 8 switches of the P2 port, the LED of the P0 port can be turned on and off. That is, when a switch of the P2 port is pressed, the
[Microcontroller]
The P2 port of the microcontroller is connected to 8 switches, and the P0 port is connected to 8 LED lights
Breathing light program using 51 single chip microcomputer
//Crystal oscillator 11.0592 //The light changes gradually from bright to dark under the control of the single-chip microcomputer, and it feels like breathing. //This example uses a digital tube and an LED light on the 51hei-5 development board to achieve a breathing effect. //File download: http://www.51hei.com/f/fxd
[Microcontroller]
Renesas Launches New RA8 Entry-Level MCU Product Group, Offering Cost-Effective, High-Performance Arm Cortex-M85 Processor
RA8E1 and RA8E2 provide ideal scalar and vector computing performance and best-in-class feature set to meet value-oriented market needs Beijing, China, November 5, 2024 - Renesas Electronics, a global supplier of semiconductor solutions, today announced the launch of the RA8E1 and RA8E
[Microcontroller]
Renesas Launches New RA8 Entry-Level MCU Product Group, Offering Cost-Effective, High-Performance Arm Cortex-M85 Processor
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号