111EquationChapter1Section1基于载波通信的三相智能电表的设计摘要智能电表作为电能数据采集的基础设备,在智能电网的建设中起着非常关键的作用。智能电表要求具备原始电能数据采集、测量和数据传输的功能。随着智能电网的发展,对智能电表提出了新的要求。由于越来越多的非线性负荷接入电网,导致电网中产生谐波污染,不仅浪费电能还给电力部门带来一定的经济损失。因此,具有谐波检侧功能的智能电表应运而生:随着国家节能减排的号召,为了提高居民节约用电意识,分时复费电价被提出已在部分地区实施应用,这要求电表具有分时计费功能。同时为提高用户用电的便捷,电力公司和用户间的双向通信也受到更多的关注。课题基于徽处理器STM32强大的数据处理能力,配合电能采集电路及主控制器STM32外围电路,实现智能电表的电能计量功能、分时电价功能、双向通信功能与谐波检测功能。课题研究了FFT对谐波分析中的作用,将插值加窗的FFT算法用于谐波分析,减小了频谱泄漏和栅栏效应带来的误差影响。课题主要完成了智能电表硬件与软件程序的设计,硬件电路主要设计了电压、电流采集电路、ADC采样电路、RS-485通信电路等。通过利用MATLAB仿真软件,用加窗插值的FFT算法对谐波信号进行了仿真分析,并验证该算法对谐波分析的准确性。最后搭建实验平台对智能电表进行了调试。关键词:智能电表;载波通信;STM32;谐波分析;abstractAsthebasicequipmentofelectricenergydatacollection,smartmeterplaysaverykeyroleintheconstructionofsmartgrid.Smartmetersarerequiredtohavethefunctionsofcollecting,measuringandtransmittingrawpowerdata.Withthedevelopmentofsmartgrid,newrequirementsareputforwardforsmartmeters.Asmoreandmorenonlinearloadsareconnectedtothepowergrid,harmonicpollutionisgeneratedinthepowergrid,whichnotonlywasteselectricenergybutalsobringscertaineconomiclossestothepowersector.Therefore,smartmeterswithharmonicdetectionfunctionhaveemergedatthehistoricmoment:withthecallofnationalenergyconservationandemissionreduction,inordertoimproveresidents'awarenessofsavingelectricity,time-of-useelectricitypricehasbeenproposedtobeappliedinsomeareas,whichrequiresthemeterstohavetime-of-usechargingfunction.Atthesametime,inordertoimprovetheconvenienceofusers,two-waycommunicationbetweenpowercompaniesandusershasalsoreceivedmoreattention.ThesubjectisbasedonthepowerfuldataprocessingcapabilityofthesmartmeterSTM32,whichiscombinedwiththepoweracquisitioncircuitandtheperipheralcircuitofthemaincontrollerSTM32torealizethepowermeteringfunction,time-of-useelectricitypricefunction,two-waycommunicationfunctionandharmonicdetectionfunctionofthesmartmeter.Inthispaper,theeffectofFFTonharmonicanalysisisstudied,andtheinterpolationandwindowingFFTalgorithmisappliedtoharmonicanalysistoreducetheinfluenceofspectrumleakageanderrorcausedbyfenceeffect.Thesubjectmainlycompletedthedesignofhardwareandsoftwareprogramofsmartmeter.Thehardwarecircuitmainlydesignedvoltageandcurrentacquisitioncircuit,ADCsamplingcircuit,RS-485communicationcircuit,etc.ByusingMATLABsimulationsoftware,theharmonicsignalissimulatedandanalyzedbyFFTalgorithmwithwindowedinterpolation,andtheaccuracyofharmonicanalysisbythisalgorithmisverified.Finally,anexperimentalplatformwasbuilttodebugthesmartmeter.Keywords:Smartmeters;Carriercommunication;STM32;harmonicanalysis;FFT第一章、绪论1.1引言最近几年我国经济态势呈现出相对快速发展的趋势,工业信息化的兴起,正在为21世纪注入新的生机与活力。在此过程中引起了各个领域的相关人员足够的重视,电能的切实有效利用成为当今发展的重中之重,传统形式的能源已经不能满足各行各业进一步发展的需要,尤其是在环境污染方面需要相对节能环保的能源出现。电能在...