Medium frequency power supply test system based on AVR microcontroller

Publisher:EnchantedMagicLatest update time:2011-09-08 Source: 互联网 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

The measurement and monitoring of electrical parameters is an important part of the power system. Starting from the engineering practice of the test system, this paper completes the measurement and real-time monitoring of the voltage , current , frequency, power factor, active power and other parameters of the medium frequency power supply system , and better realizes the functions and engineering requirements of the medium frequency power supply test system.

AVR MCU Compared with the traditional 51 series MCU, it has higher integration and stronger functions, and has good compatibility with C language. The RISC instruction architecture enables its running speed to reach 1MIPS/MHZ. With its more and more extensive application, it will definitely replace the 51 series and become the mainstream of MCU. Its main functions include watchdog, FLASH program memory, E2PROM, A/D converter, timer, counter, USART interface and other functions, which makes the hardware implementation of this test system simple and reliable.

2 Hardware Structure Design and Implementation

The medium frequency power supply test system mentioned in this article tests a three-phase four-wire medium frequency power supply with a rated output voltage of 115V, a frequency of 400Hz, and a maximum power of 14KW. The power parameters that need to be accurately measured and monitored are mainly voltage (V), current (A), frequency (Hz), active power (KW) and power factor. The system is required to have a good real-time response capability to the changes in power parameters caused by load changes, and be able to display the current power parameters in real time and give sound and light alarms for faults such as overvoltage, undervoltage, overcurrent, and wrong phase sequence.

According to the functional requirements, the system hardware structure is shown in the figure below, which consists of AVR microcontroller (ATMEGA8535), signal conversion, AC sampling, digital tube display, LCD display, key selection and alarm function modules. 2.1 Signal conversion and data acquisition The output voltage of the intermediate frequency power supply under test is filtered out of high-frequency harmonics after passing through the transformer and sent to CD4052 for collection. The output current is filtered out of interference signals after passing through the mutual inductor, and then converted into voltage signals through precision sampling resistors and sent to CD4052 for collection. The three-phase voltage signal and current signal are sent to two sample-and-hold devices LF398 after passing through CD4052. The dual-channel selection structure of the CD4052 integrated chip can ensure the output of the same-phase voltage signal and current signal, and its channel address is given by PORTA.0 and PORTA.1. The logic control signals of the two sample-and-hold devices LF398 are given by PORTD.2 at the same time to ensure that the voltage signal and current signal can be collected at the same time. The output signal of LF398 is input into the microcontroller through PORTA.6 and PORTD.7, and data collection is completed by the acquisition program.

The frequency measurement is achieved by converting the single-phase voltage signal output by CD4052 into a square wave signal through the voltage comparator LM339, tracking the frequency through the phase-locked circuit 74HC4046, dividing the signal with the divider 74HC4020 and inputting it into PORTD.6 of the microcontroller, and measuring the frequency using the input capture function of the microcontroller.

2.2 Display interface, key interface and alarm function

The data display part consists of two parts: digital tube and LCD display. The buttons are mainly used for display switching and system reset. Its interface and drive circuit are shown in the figure below:

In the LCD interface, PB0, PB1, PB2, PB3, PB6, and PB7 correspond to the LCD's /WR, /RD, RS, BUSY, /CS, and /RES pins respectively, and PD0 to PD7 are used as 8-bit data ports. The digital tube driver uses two CD4514s to generate bit selection signals, and PD0 to PD7 outputs font codes to 74LS245 to drive 4×5-bit digital tubes. Three ULN2803s are used for current absorption. The display mode is set by the key program.

When the data processing result is overvoltage, undervoltage or low frequency, PORTD.5 ​​is high level, the fault light is on, PORTD.6 is low level, the transistor is turned on, the buzzer sounds, and an audible and visual alarm is given to prompt the staff to handle the fault. 3 Software module design and implementation In the software design of the system, a modular design method is adopted to make the program structure clear and facilitate the further expansion of the system functions in the future. The system software consists of the following modules: main program, keyboard scanning processing subroutine, data acquisition subroutine, digital filtering subroutine, data processing subroutine, display subroutine, etc.

During the operation of the power supply system, high-frequency harmonic interference will be generated when the load is turned on and off. If hardware filtering is used, there will be many disadvantages such as complex hardware circuits, reduced reliability, and increased comprehensive costs. Therefore, this test system uses digital filtering to eliminate interference when obtaining power parameters, and replaces the hardware circuit with software processing to achieve a good filtering effect. In addition, the system also uses anti-interference measures such as command redundancy and software traps to make the system have good reliability.

3.1 AC Sampling Algorithm

(1) In one cycle, the voltage and current of a certain phase are continuously sampled at equal time intervals, and the effective values ​​of voltage U and current I are calculated for the N sampled data:

3.2 Software Process

The main process and key detection subroutine flow are shown in the figure above. Key detection is mainly used for display switching. PORTC.0~PORTC.4 correspond to the display setting of U phase, V phase, W phase or average value. The data acquisition and filtering subroutine flow is shown in the figure above. The method is to collect 16 times at equal time intervals each time, and store them in the acquisition result unit in sequence after digital filtering.

The data processing and display control subroutine flow is shown in the figure above. The data processing subroutine mainly converts the collected data into BCD data for display and stores it in the display unit, and makes judgments on over-voltage, under-voltage, over-current, low frequency, etc. The display subroutine includes two modules: digital tube dynamic display and LCD display, and its display mode is controlled by the key processing subroutine.

Due to the length of this article, we will not introduce them one by one in detail. The program written by the above process works well in actual operation and runs stably and reliably. Please use it as a reference for readers.

4 Conclusion

The medium frequency power supply test system described in this article has been proven in practice to be able to quickly and accurately collect various power parameters. It has the characteristics of simple hardware structure, reliable software operation, flexible display mode, etc., and has certain practical reference value in engineering practice.



Reference address:Medium frequency power supply test system based on AVR microcontroller

Previous article:Medium frequency power supply test system based on AVR microcontroller
Next article:Medium frequency power supply test system based on AVR microcontroller

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号