基于AVR单片机的电力谐波分析系统设计全套 下载本文

内容发布更新时间 : 2024/9/20 4:17:38星期一 下面是文章的全部内容请认真阅读。

基于AVR单片机的电力谐波分析系统

设计

摘要

随着国民经济的发展,电网中各种非线性负荷及用户不断增长;各种复杂的、精密的,对电能质量敏感的用电设备越来越多。上述两方面的矛盾越来越突出,在这样的环境下,探讨电能质量的分析方法,可以为分析我国电能质量管理和控制的发展趋势提供必要的依据,具有很强的现实意义。

本设计采用ATMEL公司的ATmega32L单片机完成一个电能质量检测系统。电压信号经过变压器隔离降压,幅值较低的交流信号再通过运算放大器构成的加法器变成可供A/D转换电路转换的直流信号。单片机使用内部的定时器每1/3200秒对电压信号采样一次,用片内自带的10位精度A/D转换器对每周波的电压信号采样64个点后,进行FFT运算,FFT的运算过程采取查表法进一步提高运算速度,分析出小于21次的各次谐波的含量,并计算出电压信号的有效值(RMS),将谐波分析结果通过RS-232串行接口上传到上位机并显示存储。通过对硬件软件的调整,使输出的结果达到相应的要求,然后对实际谐波信号分析,对结果进行进一步数据处理,以提高结果的准确性。最后本文简单介绍了一下提高谐波检测精度的硬件和软件措施。

关键词: 电能质量,谐波,单片机,FFT

A Harmonic analysis system design based

AVR MCU

ABSTRACT

Along with the development of national economy, and the highly automatization of the production process, so in the electrical network, all kinds of non-linear loads and users continuously growing; there are more and more kinds of electro-equipments which are complicated, precise, and sensitive to the electrical energy quality. Contradictions of these two aspects become more and more prominent, under such environment, exploring the analyzing methods which discussed electrical energy quality, may provides the necessary basis for analyzing the tendency of China’s electrical energy quality management and control. It obviously has significance to the realism.

This design uses the ATmega32L Microcontroller of ATMEL Corporation to complete an electrical energy quality examination system. The voltage signal steps down after the transformer isolation, the lower breadth Alternating signal re-passes the summing circuit, which constituted by operational amplifier, become the direct current signal, which may supply the A/D switching circuit transforms. MCU uses interior timer sample voltage signal every 1/3,200 second, uses the internal 10 bit precisions A/D switcher sample voltage signal of each cycle for 64 spots, carries on the FFT operation, the FFT operation process adopts look-up table method to enhance the operating speed, analyzes the Harmonic content which is smaller than 21 times, and calculates the RMS(Root-mean-square value) voltage of signal, upload the Harmonic analysis result through the RS-232 serial interface on Epigyny Computer and demonstrate the storage.Through the adjustment of the hardware and software to enable the outputresult achieve the corresponding request, then analyze the actual harmonicsignal and carry on the result for a further data processing in order toenhance the accuracy of result. Finally, this article briefly introducesthe hardware and software measures for harmonic examination.

KEY WORDS:power quality, harmonics,Microcontroller,FFT

目 录

中文摘要 .................................................................................................................................. I ABSTRACT ........................................................................................................................... II 1.

绪论 ................................................................................................................................. 1 1.1 课题背景 ................................................................................................................ 1 1.2 衡量电能质量的主要指标 .................................................................................... 1 1.3 电能质量问题的产生 ............................................................................................ 1 1.4 电能质量的国家标准 ............................................................................................ 2 1.5 本设计需要完成的主要任务 ................................................................................ 2 谐波分析基础 ................................................................................................................. 4 2.1 傅立叶分析概要 .................................................................................................... 4 2.2 傅立叶级数 ............................................................................................................ 4 2.2.1 周期函数傅立叶级数的三角函数形式 .......................................................... 4 2.2.2 傅立叶级数的指数函数形式 .......................................................................... 5 2.3 采样信号的傅立叶变换 ........................................................................................ 6 2.3.1 采样定理.......................................................................................................... 6 2.3.2 采样信号的傅立叶变换 .................................................................................. 6 2.4 离散傅立叶变换(DFT)与快速傅立叶变换(FFT) ................................................. 7 2.4.1 DFT .................................................................................................................. 7 2.4.2 FFT ................................................................................................................... 8 2.5 时抽选奇偶分解FFT计算的一般规则 ............................................................. 12 2.5.1 基2时抽选奇偶分解FFT对输入序列的要求 ........................................... 12 2.5.2 输入序列的码位倒置 .................................................................................... 12 2.5.3 即位运算........................................................................................................ 12 2.6 时抽选奇偶分解FFT的C语言程序实现 ......................................................... 13 2.6.1 变量的设置与定义 ........................................................................................ 13 2.6.2 逆序部分........................................................................................................ 13 2.6.3 FFT计算 ........................................................................................................ 13 3.

谐波分析系统的硬件电路设计 ................................................................................... 15 3.1 硬件电路的系统设计任务 .................................................................................. 15 3.2 单片机选型 .......................................................................................................... 15 3.3 电源电路 .............................................................................................................. 17 3.4 最小系统设计 ...................................................................................................... 17 3.4.1 复位电路........................................................................................................ 18 3.4.2 时钟信号电路................................................................................................ 18 3.4.3 A/D转换滤波电路 ........................................................................................ 19

2.