Design and Implementation of Three-phase Sine Wave AC Power Supply Based on the Embedded System STM32

Because of inverter power supply with high power consumption, low transfer efficiency rate, a three-phase sine wave AC power supply is designed based on the embedded system STM32 which has the advantage of low power consumption and high speed. It has the capacity of output frequency of 50 Hz, the RMS of line voltage and current of star load connection up to 24V and 2A. The system consists of a three-phase inverter drive circuit, filter circuit, STM32 minimum system, the isolation circuit, SPWM (sinusoidal pulse width modulation) signal generator, measurement circuit of voltage and current and LCD display circuit. The experiments show that when the input voltage is set at 36V at room temperature and the line current of load is 0∼2A, the load regulation rate is less than 0.3% and transfer efficiency can reach 88%.


Introduction
With China's continuous attention to environmental protection, green, low-carbon, recycling and energy saving emerging industries are gaining popularity. Power supply technology applied in emerging industries requires higher efficiency, reliability and lower cost, while inverter technology has prominent advantages in high efficiency, low power consumption, high precision and so on, and can be widely applied in emerging industries. Therefore, the research on inverter technology has become an important research topic.
This paper designs a three-phase pure sinusoidal ac power supply with low power consumption and high speed STM32 processor as the core. The main circuit of inverter driver adopts intelligent power module (IPM) PM30CSJ060.When the input dc voltage is 36V, the output sinusoidal signal frequency is 50Hz, and the line voltage effective value can reach 24V when load y-type connection; At the same time, when the effective value Io of load line current varies between 0 and 2A, the load adjustment rate of each phase is not more than 0.3%, and the energy conversion efficiency can reach 88%.

2.
The system structure of three-phase pure sine wave power supply Three-phase pure sine wave power supply consists of DC power module, three-phase inverter driving main circuit, filtering circuit, STM32 minimum system, signal isolation circuit, SPWM (sinusoidal pulse width modulation) signal generator, voltage and current measurement circuit, LCD display and other functional circuits, as shown in figure 1.STM32 generates sinusoidal pulse width modulation signal (SPWM), controls the three-phase inverter drive circuit (intelligent power module) after the optocoupler isolation circuit, and filters through a low-pass filter. Finally, the dc voltage inverter is converted into a three-phase pure sinusoidal voltage signal, and the load is a three-phase symmetric y-type connection of pure resistance.The voltage and current measurement circuit measures the voltage and current of each phase of three-phase pure sine wave and displays it on the liquid crystal display after passing STM32.

Functional module design
3.1. Three-phase inverter drives the main circuit Three-phase inverter drive main circuit using mitsubishi's intelligent power module (IPM) PM30CSJ060, it is not only the power switch device and the drive circuit integration in together, but also including the overvoltage, overcurrent and overheating fault detection circuit, even if the load accident or improper use, also can protect themselves from being damaged, to the detection signal processor at the same time, according to the specific fault type.

Signal isolation circuit
The photocoupler is used to isolate the processor STM32F103 from PM30CSJ060 to improve the security and anti-interference of the system. Four low light coupling PC817 2 pin respectively with PM30CSJ060 fault signal at the output of the UFO, VFO, WFO connection, 1 pin with PM30CSJ060 four groups respectively isolated 15 v power supply connection, 4 pin connected to the processor STM32F103 I/O port, 3 pins are connected to the signal source to GND5 public, but GND5 isolation with four groups of 15 v power supply not altogether, as shown in figure 3.

SPWM (sinusoidal pulse width modulation) signal generator
Sinusoidal pulse width modulation signal (SPWM) adopts the natural sampling method, but instead of finding the intersection point of carrier and modulation wave, a sinusoidal table is formed in STM32F 103. By comparing the size of carrier and modulation wave through the software table lookup method, the pulse width is controlled to generate six complementary SPWM signals. This method has the advantage of producing waveform close to sine wave and small computation.

Filter circuit
The output waveform of PM30CSJ060 needs to be filtered by a filter circuit to get the sinusoidal signal. The main filters to be removed in this system are carrier frequency ωc=20KHz, ωc and the adjacent harmonics, LC-π filter circuit as shown in figure 5. Inductance adopts high frequency magnetic winding to make hollow core coil, capacitance adopts non-polar polyester capacitor.  Since the RMS measurement chip AD637 has the advantages of high measurement accuracy, short relative stability time and wide frequency band, and its output voltage is equal to the RMS value of the voltage to be measured, this chip is used to measure the RMS value of three-phase ac voltage. However, the measurement range of RMS of input voltage of AD637 is 0~7V, so RMS of output voltage of 14V of three-phase inverter circuit cannot be directly measured. The 5mA/5mA miniature current type voltage transformer MH8009PT can convert ac high voltage into ac low voltage output with good linearity and high accuracy. The measurement circuit is shown in figure 6. Resistance R1 and R2 are current limiting and sampling resistance, ensuring that the primary and secondary side current of the voltage transformer is 5mA.CAV pins of AD736 are connected to the average capacitance of 33uF to reduce the ac error caused by ripple voltage. Vout pins are connected to the eighth conversion channel of ADC1 of STM32 F103(pin PB0).

Power supply module
The output voltage signal of 36V from one DC stabilized power supply passes through four dc-dc isolated power modules sysy10-24s15, and four 15V isolated power sources are generated to supply the main circuit of three-phase inverter drive. At the same time, the DC stabilized power supply is connected to one dc-dc isolated power module SYSY5-24S05, which generates ±5V voltage and ± 5V power supply voltage respectively for AD637 and STM32 processors.  3.7. STM32 minimum system STM32F103 is a 32-bit ARM microcontroller, its peripheral resources are very rich, including ADC, general timer, I2C bus interface, SPI interface, etc., which is specially designed for motor control and advanced timer, with 6 dead zone time programmable PWM generator, so programmable to produce 6 complementary SPWM signal drive IPM;12-bit adc, realizing high speed and high precision adc without considering AD converter on the outside of the controller. The minimum system of STM32F103 includes reset, crystal oscillator, JTAG, 1602 LCD and other unit circuits, as shown in figure 8.

The software designs
The system software flow is shown in figure 9. After system initialization, if no key is pressed after the delay of 50ms, the ac signal waveform converted by the main circuit of three-phase inverter drive will be displayed on the oscilloscope. If the key is pressed, the measured phase voltage and phase current will be displayed on the LCD 1602 after data processing.

Test results and discussion
According to the test, when the input dc voltage is 36V and the RMS of load line current of U, V and W phases is 2A, the frequency of sinusoidal signal, the RMS of each line voltage and the load adjustment rate of each phase of three-phase power supply are output, as shown in table 1.When the effective value Io of load line current varies between 0 and 2A, the phase load adjustment rate SI1 is less than or equal to 0.3%.The calculation method of load adjustment rate is: , Uo1 is the output terminal line voltage when Io=0A, and Uo2 is the output terminal line voltage when Io=2A.When the input dc voltage is 36V and the input dc current is 1A, the efficiency of the inverter is 88%.
DC voltage stabilizer power supply, current and voltage measurement circuit stability and accuracy, manual welding of inverter circuit, filter circuit performance will produce measurement errors, affect the test results.

Conclusion
Aiming at the disadvantages of inverter power supply, a three-phase pure sine wave ac power supply is designed. When the input dc voltage is 36V, the output sinusoidal signal frequency is 50Hz.At the same time, when the effective value Io of load line current varies between 0 and 2A, the load adjustment rate of each phase is not more than 0.3%, and the energy conversion efficiency can reach 88%.