Photovoltaic sine wave inverter power supply based on single chip microcomputer

Publisher:吉州古玩斋Latest update time:2011-11-09 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

With the increasing energy crisis and the improvement of human environmental awareness, the development and utilization of new energy sources have attracted more and more attention. As an inexhaustible, efficient and pollution-free energy source, solar energy has become more popular recently. The photovoltaic sine inverter power supply system introduced in this article is a power supply system suitable for household use, especially for users in remote areas of western China with little or no electricity. With the development of western my country, its market prospects will become more and more broad.

2 Inverter System Structure and Principle

2.1 Basic system structure

The basic structure diagram of the system is shown in Figure 1. As can be seen from the figure, the solar cell array first charges the battery through the charging circuit to obtain a basically stable DC voltage, and then the DC is inverted into high-frequency AC through the inverter circuit, and finally it is boosted by the power frequency transformer and filtered by the filter circuit to become a 50Hz, 220V sinusoidal AC voltage. The control of the entire system is completed by the MR16 single-chip microcomputer. Its core part is the digital PI regulator part composed of the formation of SPWM wave and the feedback formed according to the output AC voltage sampling.

Figure 1 Basic system structure

2.2 About MR16 MCU

The 68HC908MR16 microcontroller is a low-cost, high-performance eight-bit microcontroller. It has 32k bytes of erasable on-chip flash memory FLASH and 768 bytes of RAM, which are completely sufficient for this system; it has a PWMMC module with 6 PWM outputs specifically for motor control, which is suitable for single-phase and three-phase inverters. At the same time, the module also has 4 FAULT pins specifically for fault protection. When a fault occurs, the PWM output can be quickly blocked without causing an interruption to achieve the purpose of protection; it has a clock generator module that can select an external crystal clock or an internal phase-locked loop clock. The internal phase-locked loop clock selected by this system can generate an accurate 8MHz internal bus frequency, thereby ensuring the frequency accuracy of the system; it has a programmable AD clock, and the fastest AD conversion time is only 2μs, which can minimize the execution time of the interrupt program; it has an SCI serial communication interface that can work in full-duplex or half-duplex mode. In this system, it can reliably complete serial communication with the external keyboard monitoring system.

2.3 Inverter main circuit

The main circuit of the system adopts a single-phase full-bridge inverter circuit as shown in Figure 2. The switch device adopts a power MOSFET that is suitable for small power devices and has the characteristics of fast switching speed and high operating frequency. The gate drive signal of the switch tube comes from the signal of the SPWM wave generated by the MR16 microcontroller after passing through the drive circuit. The output of the full-bridge inverter is a high-frequency SPWM wave, which is boosted and filtered by the transformer to obtain a standard sinusoidal AC voltage of 220V, 50Hz.

Figure 2 Main circuit schematic diagram

2.4 Formation of SPWM Wave

The 68HC908MR16 microcontroller has a PWMMC module specifically used for motor control, which can work in 3 pairs of complementary modes or independent modes and includes 6 PWM outputs. In this system, it is initialized to work in 3 pairs of complementary modes, that is, the two PWM signals in the same bridge arm are complementary. During initialization, a count value is written to PMOD (H: L) to determine the carrier frequency, that is, the switching frequency. The real-time pulse width calculation of the PWM wave is completed by the interrupt program. Every time the PCTN (H: L) counter in the PWMMC module counts to the value in PMOD (H: L), an interrupt is caused. The sine values ​​of 0 to 360 degrees are pre-tabled and stored in a certain area of ​​FLASH. Each time an interrupt occurs, a sine value is taken from it, and a value is obtained after a certain calculation, which is sent to the PVALX (H: L) register. The microcontroller automatically generates an SPWM signal after comparing the value in PVALX (H: L) with the value in PMOD (H: L) and sends it out from the PWM pin. In order to prevent the two tubes in the same bridge arm from being turned on at the same time, a value is written into the register DEADTM in the signalless generator DEADTIME to determine the dead time. This system is designed with a dead time of 2.5μs and a carrier frequency of 10kHz, and a sine table including 200 amplified sine values ​​is made. The PWMMC module also has 4 fault protection ports FAULT1~FAULT4. When the port is at a high level, the PWMMC can block the corresponding PWM output according to the initialization setting. The overcurrent protection in this system utilizes this function. When an overcurrent occurs, the FAULT1 port is set to block all six PWM ports. This system enables PWMMC to work in center-aligned mode. When the PWM clock frequency is 8MHz, the carrier period calculation formula is:

Carrier period = 1/10k = PMOD (H:L) × (1/8M) × 2

Therefore, the system must initialize PMOD (H: L) = $0190 (Note: $ is the hexadecimal symbol in MR16)

2.5 System Control Structure

This system uses a digital PI regulator to achieve voltage stabilization control. The control block diagram of the system is shown in Figure 3. The feedback signal comes from the AD sampling of the AC voltage. In order to ensure accuracy, this system uses a transformer for voltage sampling. The given voltage at the beginning is taken from the soft start output. The soft start is to avoid the generation of a large peak current at the start. The soft start uses the method of gradually adding 1 to the required voltage. After the soft start is over, the given voltage is the value corresponding to the 220V voltage. In order to enhance the rapidity, this system adopts a control method that combines feedforward control with feedback control. In order to enhance the dynamic output characteristics of the system, this system adopts a fuzzy control method that changes the proportional coefficient and integral coefficient according to the deviation. When the deviation is large, the proportional coefficient and integral coefficient are also large. When the deviation is small, the proportional coefficient and integral coefficient are also small, thereby greatly reducing the overshoot, making it easy to stabilize the system, completely eliminating the integral saturation phenomenon, and enhancing the adaptability of the system.

Figure 3 System control block diagram [page]

3 Serial Communication

In order to enhance the system's ability to adapt to different environments, it is necessary to monitor the system and modify and adjust the parameters. This system uses serial communication technology to communicate with the external keyboard monitoring system. The program uses a query method to periodically send the detected data to the outside world. The detected data includes solar cell voltage, charging current, battery voltage, DC side current, output voltage, output current, radiator temperature, etc. When a fault occurs, the fault signal is sent first. When the parameters need to be modified, the data is received and the corresponding parameters are modified, and the accuracy of data communication is verified by the verification and verification method. The hardware uses MAXIM's MAX485 as the interface chip to make it work in half-duplex mode. At the same time, this system uses optocoupler isolation to enhance the system's anti-interference ability and improve reliability.

4 System software design

The system software adopts modular design, including initialization module, protection module, regulator module, communication module, interrupt program module, etc. Except for the interrupt module, the other modules are placed in the main program. The main program block diagram is shown in Figure 4.

Figure 4 Main program flow chart

The initialization module is mainly used to initialize the system and assign initial values ​​to each variable unit and each register unit.

The protection module makes fault judgments based on the voltage and current sampling values, and blocks the PWM output when a fault occurs. Protection includes battery undervoltage, battery overvoltage, system overload, overheating protection, etc. Among them, battery undervoltage and overvoltage protection can achieve self-recovery, that is, when the battery voltage is detected to return to normal, the system will restart and resume normal operation. Overcurrent protection uses hardware protection because it requires a quick response. When overcurrent occurs, all PWM outputs are immediately blocked, and all drive circuits are also immediately blocked. Only when reset can the work be restored. The software can determine whether overcurrent protection occurs.

The regulator module completes the PI regulation of the system output voltage to stabilize the output voltage at 220V, and the soft start is also included. Its input parameter is the soft start output, and the output parameter M is sent to the interrupt module to participate in the calculation of the PWM pulse width. By adjusting the value of this parameter in real time, the pulse width value can be changed so that the output follows the given value.

The interrupt program module completes the generation of SPWM waveforms and the sampling of AC voltage and AC current parameters. The input parameter of the interrupt is the output parameter M of the PI regulator, which participates in the calculation of the pulse width, that is, the calculation of the PVALX (H: L) value, thereby changing the duty cycle and adjusting the output voltage. According to the sampling method of SPWM rule 2, combined with the setting of PWMMC in initialization, the real-time calculation formula of the pulse width is:

Positive half cycle:

PVALX(H:L)=PMOD(H:L)/2+M×SIN(PTR)

Negative half cycle:

PVALX(H:L)=PMOD(H:L)/2-M×SIN(PTR)

Where PTR is the sine table pointer, and SIN(PTR) is the sine value corresponding to the PTR pointer.

[page]

5 Conclusion

According to the above ideas, a prototype was made, and finally a relatively standard 220V, 50Hz sinusoidal voltage was obtained. The soft start was also very stable, with a frequency error of ≤0.1% and an output voltage error of ≤0.5%. Due to the use of a 10kHz carrier frequency, a 20kHz high-frequency signal was obtained on the primary side of the transformer without noise. Under the above control mode, the system can ensure that the output voltage remains stable quickly when the system is suddenly loaded or unloaded. In addition, the serial communication with the external keyboard monitoring system is good, and it has strong practicality and reliability. The output voltage waveforms when it is unloaded and loaded are shown in Figures 5 and 6.

Figure 5 Output voltage waveform when no load

Figure 6 Output voltage waveform under load

Keywords:MCU Reference address:Photovoltaic sine wave inverter power supply based on single chip microcomputer

Previous article:Design of battery management system based on single chip microcomputer
Next article:Bit synchronization extraction of digital communication system based on single chip microcomputer

Recommended ReadingLatest update time:2024-11-16 17:29

Source code design of floating point calculation for single chip microcomputer
  A floating point number of a single-chip microcomputer is generally stored in KeilC51 in the form of 4 bytes, and the format strictly follows the IEEE-754 standard. In the binary data of the single-chip microcomputer, the floating point number is represented by two parts, the base C is 2, E is the exponent, and M is
[Microcontroller]
Source code design of floating point calculation for single chip microcomputer
Application design of 51 single chip microcomputer in intelligent clock control system
With the adjustment of the electronic technology industry structure, the rapid development of production technology, the continuous improvement of people's living standards, and the gradual popularization of household appliances, the market demand for intelligent clock control systems is also increasing. The intellige
[Microcontroller]
Application design of 51 single chip microcomputer in intelligent clock control system
Design of Single-Chip Microcomputer Multi-CPU System
Single-chip microcomputers are small, flexible, and easy to expand into powerful control systems. At present, some monitoring terminals and many independent control systems (such as: microcomputer excitation devices of generators) are mostly composed of single-chip microcomputers as the core. However, due to reasons s
[Microcontroller]
Design of Single-Chip Microcomputer Multi-CPU System
Playing PID control with a single-chip microcomputer - from ideal PID control to advanced PID control_11
3.4PID parameter self-tuning In engineering control, PID parameter tuning is a time-consuming and laborious task. Even if you are experienced, it is not easy to do it. If the PID parameters can be automatically tuned, it is obviously a good thing, which can greatly reduce the labor intensity of engineering personnel
[Microcontroller]
Playing PID control with a single-chip microcomputer - from ideal PID control to advanced PID control_11
PIC8-bit microcontroller chip pin function
Introduction: After reading the introduction to the product performance and corresponding package pins of PIC 8-bit microcontrollers, the author believes that beginners need to understand the meaning of each pin symbol before they can further learn and use it. The author makes relevant explanations for this purpose so
[Microcontroller]
PIC8-bit microcontroller chip pin function
Application of 51 single chip microcomputer in micro printer
1 Introduction Since the single-chip microcomputer has the advantages of simplicity, practicality, high reliability, good performance-price ratio and small size, it has been rapidly developed in various technical fields. This article focuses on the control of the micro-printer with parallel interface by 89C52,
[Microcontroller]
Application of 51 single chip microcomputer in micro printer
Photosynthesis meter based on C8051F single chip microcomputer
  At present, my country's agricultural production is changing from "resource-dependent" to "technology-dependent", and improving crop yield and quality is a major problem facing agricultural production. Generally speaking, more than 90% of crop yield comes from photosynthesis. Therefore, it is of great significance to
[Microcontroller]
Photosynthesis meter based on C8051F single chip microcomputer
PIC microcontroller bank and PC error problem
1. BANK setting error: Let's look at a program first: include p16f877.inc PORTDB EQU 20H … START movlw b'11110000' movwf PORTDB clrf TRISD MAIN bcf STATUS,C rlf PORTDB,1 btfsc STATUS,C bsf PORTDB,0 movf PORTDB,W movwf PORTD call DELAY g
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号