[go: up one dir, main page]

CN103257271B - A kind of micro-capacitance sensor harmonic wave based on STM32F107VCT6 and m-Acetyl chlorophosphonazo pick-up unit and detection method - Google Patents

A kind of micro-capacitance sensor harmonic wave based on STM32F107VCT6 and m-Acetyl chlorophosphonazo pick-up unit and detection method Download PDF

Info

Publication number
CN103257271B
CN103257271B CN201310183553.0A CN201310183553A CN103257271B CN 103257271 B CN103257271 B CN 103257271B CN 201310183553 A CN201310183553 A CN 201310183553A CN 103257271 B CN103257271 B CN 103257271B
Authority
CN
China
Prior art keywords
sampling
signal
harmonic
quasi
frequency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201310183553.0A
Other languages
Chinese (zh)
Other versions
CN103257271A (en
Inventor
张亮
安薇薇
韩林
顾阳
水恒华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Institute of Technology
Original Assignee
Nanjing Institute of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Institute of Technology filed Critical Nanjing Institute of Technology
Priority to CN201310183553.0A priority Critical patent/CN103257271B/en
Publication of CN103257271A publication Critical patent/CN103257271A/en
Application granted granted Critical
Publication of CN103257271B publication Critical patent/CN103257271B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Measurement Of Resistance Or Impedance (AREA)
  • Supply And Distribution Of Alternating Current (AREA)

Abstract

本发明公开了一种基于STM32F107VCT6的微电网谐波与间谐波检测装置及检测方法,属于电能质量检测技术领域。该装置包括信号采集模块、信号处理模块和信号的显示输出模块,所述的信号采集模块中采用霍尔电压电流传感器作为采集电网三相电压电流的采集器;所述的信号处理模块包括电压电流的转换电路、抗混叠滤波电路、电平调整电路、核心处理器STM32F107VCT6和处理器外围电路;所述的电平调整电路的输出端接核心处理器STM32F107VCT6的A/D转换器输入端。该方法包括了信号的采集和处理过程,该装置及方法在满足计算精度、计算速度的同时在结构上又满足灵活性和便捷性。

The invention discloses a microgrid harmonic and interharmonic detection device and detection method based on STM32F107VCT6, belonging to the technical field of power quality detection. The device includes a signal acquisition module, a signal processing module, and a signal display output module. In the signal acquisition module, a Hall voltage and current sensor is used as a collector for collecting three-phase voltage and current of the power grid; the signal processing module includes a voltage and current sensor. conversion circuit, anti-aliasing filter circuit, level adjustment circuit, core processor STM32F107VCT6 and processor peripheral circuit; the output terminal of the level adjustment circuit is connected to the A/D converter input terminal of the core processor STM32F107VCT6. The method includes signal collection and processing processes, and the device and method meet the requirements of calculation accuracy and calculation speed while satisfying flexibility and convenience in structure.

Description

一种基于STM32F107VCT6的微电网谐波与间谐波检测装置及检测方法A microgrid harmonic and interharmonic detection device and detection method based on STM32F107VCT6

技术领域technical field

本发明属于电能质量检测技术领域,具体地说,涉及一种能够检测微网系统谐波、间谐波的装置及检测方法,更具体地说,涉及一种基于STM32F107VCT6的微电网谐波与间谐波检测装置及检测方法。The present invention belongs to the technical field of power quality detection, in particular, relates to a device and detection method capable of detecting harmonics and inter-harmonics of a micro-grid system, and more specifically, relates to a micro-grid harmonic and inter-harmonic based on STM32F107VCT6 Harmonic detection device and detection method.

背景技术Background technique

目前,公知的谐波检测装置大多是针对大电网的,并且多是检测谐波,对于间谐波的检测装置并不多。目前IEC6100-4-7标准和绝大多数现有谐波检测装置,对间谐波的检测均采用FFT(FastFourierTransform,快速傅立叶变换)算法。然而传统的FFT算法对于检测整数次谐波时是比较准确的,但当电网存在大量的非整数次谐波时,算法就会出现较大误差,甚至无法检测,导致计算结果极为不可信。因此,急需一种更为精确的算法改进谐波和间谐波的检测。At present, most of the known harmonic detection devices are aimed at large power grids, and mostly detect harmonics, and there are not many detection devices for inter-harmonics. At present, the IEC6100-4-7 standard and most of the existing harmonic detection devices adopt the FFT (FastFourierTransform, Fast Fourier Transform) algorithm for the detection of interharmonics. However, the traditional FFT algorithm is relatively accurate for detecting integer harmonics, but when there are a large number of non-integer harmonics in the power grid, the algorithm will have large errors and even fail to detect, resulting in extremely unreliable calculation results. Therefore, a more accurate algorithm is urgently needed to improve the detection of harmonics and interharmonics.

随着智能电网建设的大力推进,微电网技术发展越来越迅速,微电网电能质量问题也越来越引起人们的关注。然而谐波是衡量电网电能质量的关键指标,为了能够治理谐波,避免谐波注入大电网,对微电网的谐波检测是十分必要的。微电网中分布式电源的频繁投退会产生谐波电流,电力电子设备的非线性特性也会产生大量的谐波电压,间歇式能源输出功率不稳定会导致电压波动和闪变,并且微电网容量小负荷多变。此外,由于微电网有两种稳定运行状态,即并网运行状态和孤岛运行状态,并网运行时,微电网的基波频率会随着外电网基波频率的变动而变动;孤岛运行时,若分布式电源出力和负载功率消耗不匹配,也将造成微网基波频率的变动。微网的这些特点使得微网中的电压电流极易波动,额定基波频率并不是一个恒定值,使得电压电流为非平稳状态量,除整数次谐波分量外还存在大量的间谐波分量,对于电网稳定运行极为不利。微电网中电能质量问题是急需解决的关键技术,但目前并没有有效的针对微电网谐波的特点而设计的检测装置。因此,急需一台针对微网的谐波检测装置,而随着微电网的不断推广,市场也迫切需要该谐波检测装置。With the vigorous promotion of smart grid construction and the rapid development of micro-grid technology, the power quality of micro-grid has attracted more and more attention. However, harmonics are a key indicator to measure the power quality of the power grid. In order to control the harmonics and avoid the injection of harmonics into the large power grid, it is very necessary to detect the harmonics of the micro-grid. The frequent switching of distributed power sources in the microgrid will generate harmonic currents, and the nonlinear characteristics of power electronic equipment will also generate a large number of harmonic voltages. The unstable output power of intermittent energy sources will cause voltage fluctuations and flicker, and the capacity of the microgrid Small loads are variable. In addition, since the microgrid has two stable operating states, namely, the grid-connected operating state and the islanded operating state, the fundamental frequency of the micro-grid will change with the change of the fundamental frequency of the external power grid during grid-connected operation; If the distributed power output does not match the load power consumption, it will also cause changes in the fundamental frequency of the microgrid. These characteristics of the microgrid make the voltage and current in the microgrid very easy to fluctuate, and the rated fundamental frequency is not a constant value, making the voltage and current a non-stationary state quantity, and there are a large number of interharmonic components in addition to the integer harmonic components , which is extremely detrimental to the stable operation of the power grid. The power quality problem in microgrid is a key technology that needs to be solved urgently, but there is no effective detection device designed for the characteristics of microgrid harmonics. Therefore, there is an urgent need for a harmonic detection device for microgrids, and with the continuous promotion of microgrids, the market also urgently needs the harmonic detection device.

中国专利号:200910043655.6,公开日2009年11月25日,公开了一份名称为一种谐波和间谐波参数的检测方法的专利文件,其为克服现有的谐波、间谐波检测方法的不足,该发明提供谐波和间谐波参数检测方法,其主要实现步骤为:1)根据正弦、余弦函数的特性,通过数学变换将电压或电流信号中的基波分量和各次谐波分量分别变换成直流分量;2)用低通滤波提取直流分量,计算基波分量和各次谐波分量的幅值和相位角等参数;3)从电压信号中减去基波和谐波分量,得到只含各间谐波的电压或电流信号;4)通过幅值谱最大值搜素获取各间谐波参数。但是该方法存在检测精度不高,实际操作存在困难等问题,而且不适合微电网间谐波的检测。China Patent No.: 200910043655.6, published on November 25, 2009, discloses a patent document titled a detection method for harmonic and inter-harmonic parameters, which aims to overcome the existing harmonic and inter-harmonic detection The deficiency of method, this invention provides harmonic and interharmonic parameter detection method, and its main realization step is: 1) according to the characteristic of sine, cosine function, the fundamental wave component in the voltage or current signal and each harmonic The wave components are converted into DC components respectively; 2) Extract the DC components by low-pass filtering, and calculate the parameters such as the amplitude and phase angle of the fundamental wave component and each harmonic component; 3) Subtract the fundamental wave and harmonics from the voltage signal Components to obtain a voltage or current signal containing only the inter-harmonics; 4) Obtain the inter-harmonic parameters by searching the maximum value of the amplitude spectrum. However, this method has problems such as low detection accuracy and difficulties in actual operation, and it is not suitable for the detection of harmonics between microgrids.

传统的FFT算法检测微电网的间谐波势必会产生较大误差的原因在于:FFT算法的频谱泄露会产生伪间谐波,从而淹没真实的间谐波,FFT仅适用于固定周期量的检测,但实际上微电网电压电流波动并不呈现固定周期规律性。因此,急需一种改进的微电网间谐波检测方法来实现间谐波的精确检测。The reason why the traditional FFT algorithm will inevitably produce large errors in detecting the interharmonics of the microgrid is that the spectrum leakage of the FFT algorithm will generate pseudo interharmonics, thereby submerging the real interharmonics, and FFT is only suitable for the detection of fixed period quantities , but in fact the microgrid voltage and current fluctuations do not present a fixed cycle regularity. Therefore, there is an urgent need for an improved microgrid interharmonic detection method to achieve accurate detection of interharmonics.

上述算法上的缺陷使得还没出现针对微电网的间谐波检测装置,因此急需研究解决。对于微电网间谐波检测来说要解决的技术难题有:(1)如何实现谐波与间谐波的分离;(2)如何抑制间谐波频谱之间的相互干扰及其对谐波频谱的干扰:(3)如何抑制谐波成分淹没间谐波成分。另外,现有的谐波检测装置大都采用8位单片机,少数用16位单片机,还没有采用32位单片机的检测装置。8位单片机特点是成本低,使用灵活,但缺点是运算速度慢,一般还需要扩展RAM和ROM,硬件电路较复杂。The flaws in the above algorithms make it difficult to find an interharmonic detection device for microgrids, so research is urgently needed to solve them. For the detection of inter-harmonics in microgrids, the technical problems to be solved are: (1) how to realize the separation of harmonics and inter-harmonics; (2) how to suppress the mutual interference between Interference: (3) How to suppress harmonic components from submerging inter-harmonic components. In addition, most of the existing harmonic detection devices use 8-bit single-chip microcomputers, a few use 16-bit single-chip microcomputers, and there is no detection device that uses 32-bit single-chip microcomputers. The 8-bit single-chip microcomputer is characterized by low cost and flexible use, but the disadvantage is that the operation speed is slow, and generally it needs to expand RAM and ROM, and the hardware circuit is more complicated.

发明内容Contents of the invention

1、要解决的问题1. Problems to be solved

针对现有技术对微电网谐波的检测存在运算速度慢、需要扩展RAM和ROM以及硬件电路较复杂的问题,本发明提供一种基于STM32F107VCT6的微电网谐波与间谐波检测装置及检测方法,它在满足计算精度、计算速度的同时在结构上又满足灵活性和便捷性。Aiming at the problems of slow computing speed, need to expand RAM and ROM, and complex hardware circuits in the detection of micro-grid harmonics in the prior art, the present invention provides a micro-grid harmonic and inter-harmonic detection device and detection method based on STM32F107VCT6 , it not only satisfies the calculation accuracy and calculation speed, but also meets the flexibility and convenience in structure.

2、技术方案2. Technical solution

为解决上述问题,本发明采用如下的技术方案。In order to solve the above problems, the present invention adopts the following technical solutions.

一种基于STM32F107VCT6的微电网谐波与间谐波检测装置,包括信号采集模块、信号处理模块和信号的显示输出模块,所述的信号采集模块中采用霍尔电压电流传感器作为采集电网三相电压电流的采集器;所述的信号处理模块包括电压电流的转换电路、抗混叠滤波电路、电平调整电路、核心处理器STM32F107VCT6和处理器外围电路;所述的信号采集模块的霍尔电压电流传感器的采集端与电网连接,输出端接信号处理模块,在信号处理模块中依次经过电流电压转换电路、抗混叠滤波电路和电平调整电路;所述的电平调整电路的输出端接核心处理器STM32F107VCT6的A/D转换器输入端,STM32F107VCT6的外围接入LCD显示屏。A micro-grid harmonic and inter-harmonic detection device based on STM32F107VCT6, including a signal acquisition module, a signal processing module, and a signal display output module. The signal acquisition module uses a Hall voltage and current sensor as the acquisition grid three-phase voltage The collector of electric current; Described signal processing module comprises the conversion circuit of voltage and current, anti-aliasing filter circuit, level adjustment circuit, core processor STM32F107VCT6 and processor peripheral circuit; The Hall voltage current of described signal acquisition module The acquisition end of the sensor is connected to the power grid, and the output end is connected to the signal processing module. In the signal processing module, the current and voltage conversion circuit, the anti-aliasing filter circuit and the level adjustment circuit are sequentially passed through; the output end of the level adjustment circuit is connected to the core The A/D converter input terminal of the processor STM32F107VCT6, and the periphery of the STM32F107VCT6 is connected to the LCD display.

优选地,所述的处理器外围电路包括电源电路、复位电路和晶振电路;所述的电源电路通过电压变换提供整个系统工作所需的不同电压的电源;所述的复位电路中采用复位芯片手动复位方式;所述的晶振电路为单片机提供时钟信号。Preferably, the peripheral circuit of the processor includes a power supply circuit, a reset circuit and a crystal oscillator circuit; the power supply circuit provides power supplies of different voltages required by the entire system through voltage conversion; the reset chip is used in the reset circuit to manually reset mode; the crystal oscillator circuit provides a clock signal for the single-chip microcomputer.

优选地,所述的输出显示模块包括LCD显示屏、键盘、PC通信模块。Preferably, the output display module includes an LCD display screen, a keyboard, and a PC communication module.

优选地,所述的输出显示模块中还包含有键盘电路,键盘与核心处理器STM32F107VCT6的连接是通过键盘电路连接。Preferably, said output display module also includes a keyboard circuit, and the connection between the keyboard and the core processor STM32F107VCT6 is through the keyboard circuit.

为了配合使用本发明的装置,本发明的谐波检测装置设计的系统软件主要包括数据采样、数据处理、人机接口和通讯,主要采用Keil开发环境C语言开发工具。算法方面在FFT算法的基础上提出基于准同步采样重构信号的间谐波检测方法,该算法通过分离信号中的谐波与间谐波成分,达到抑制两者互扰的目的,能够同时实现谐波和间谐波参数的准确测量。由于间谐波的存在,系统电压电流信号不再是平稳的周期,而是非平稳信号。传统FFT算法对于非平稳信号的分析有很大误差,而“消去法”检测谐波和间谐波在微网中也会出现较大误差,原因是微网中的间谐波含量较电网多,计算时不能忽略间谐波对谐波的影响。本发明提出基于准同步采样重构信号的检测算法,这种方法适用于非同步采样情况,因此谐波检测装置可以采用固定采样频率对电力信号进行采样,从而保证每个采样数据的有效性。In order to cooperate with the device of the present invention, the system software designed by the harmonic detection device of the present invention mainly includes data sampling, data processing, man-machine interface and communication, and mainly adopts the Keil development environment C language development tool. In terms of algorithm, on the basis of FFT algorithm, an interharmonic detection method based on quasi-synchronous sampling reconstruction signal is proposed. Accurate measurement of harmonic and interharmonic parameters. Due to the existence of inter-harmonics, the system voltage and current signals are no longer stable cycles, but non-stationary signals. The traditional FFT algorithm has a large error in the analysis of non-stationary signals, and the "elimination method" detection of harmonics and inter-harmonics will also cause large errors in the micro-grid, because the content of inter-harmonics in the micro-grid is more than that of the power grid. , the influence of inter-harmonics on harmonics cannot be ignored in the calculation. The invention proposes a detection algorithm based on quasi-synchronous sampling reconstruction signal, which is suitable for non-synchronous sampling, so the harmonic detection device can use a fixed sampling frequency to sample the power signal, thereby ensuring the validity of each sampled data.

一种微电网谐波与间谐波检测方法,其步骤为:A method for detecting harmonics and interharmonics of a microgrid, the steps of which are:

(1)在满足奈奎斯特采样定理的情况下,以固定采样频率对电力系统信号进行等间隔采样,即有等式(1) In the case of satisfying the Nyquist sampling theorem, the power system signal is sampled at equal intervals at a fixed sampling frequency, that is, the equation

K·Ts=P·T0(1-1)K·T s =P·T 0 (1-1)

成立,其中Ts为采样周期,T0是信号周期,K为采样点个数,P为信号周期个数,对于非同步采样,显然P不为整数;Established, where T s is the sampling period, T 0 is the signal period, K is the number of sampling points, P is the number of signal periods, for asynchronous sampling, obviously P is not an integer;

(2)采用自适应跟踪数字陷波滤波器滤去采样序列x(KTs)中的基波分量,得到新的采样序列x'(KTs),因此从x(KTs)中减去x'(KTs),即可得到基波分量x0(KTs);与传统的陷波滤波器相比,自适应跟踪数字陷波滤波器由于结合了自适应的滤波方式使得基波频率在50Hz附近波动时也能准确滤除,理想数字陷波滤波器的频率响应为(2) Use the adaptive tracking digital notch filter to filter out the fundamental component in the sampling sequence x(KT s ) to obtain a new sampling sequence x'(KT s ), so subtract x from x(KT s ) '(KT s ), the fundamental component x 0 (KT s ) can be obtained; compared with the traditional notch filter, the adaptive tracking digital notch filter makes the fundamental frequency in the It can also accurately filter out fluctuations around 50Hz. The frequency response of an ideal digital notch filter is

Hh (( ee jωtjωt )) == 11 ωω ≠≠ ωω 00 00 ωω == ωω 00 -- -- -- (( 11 -- 22 ))

其中e为自然常数,j为虚数单位,ω为频率,t为时间,ω0为陷波频率;Wherein e is a natural constant, j is an imaginary number unit, ω is a frequency, t is a time, and ω0 is a notch frequency;

对于单一陷波频率其传递函数H(z-1)具有如下对称镜像形式For a single notch frequency, its transfer function H(z -1 ) has the following symmetrical mirror form

Hh (( zz -- 11 )) == 11 ++ aa 11 zz -- 11 ++ zz -- 22 11 ++ aa 11 pzpz -- 11 ++ pp 22 zz -- 22 -- -- -- (( 11 -- 33 ))

式中,z为复数变量,p是一个接近1但略小于1的常数,a1为参数,由陷波频率决定,In the formula, z is a complex variable, p is a constant close to 1 but slightly smaller than 1, a 1 is a parameter, which is determined by the notch frequency,

陷波频率表达式为The notch frequency expression is

ff 00 == arccosarccos (( -- aa 11 // 22 )) 22 πTπT -- -- -- (( 11 -- 44 ))

其中T为采样周期,由自适应最小二乘法求出随采样点变化的a1(n),则其对应的陷波频率也是随时间变化的,为了实现自适应性p随采样点变化即为p(n);由此,x(KTs)中每一个采样点信号对应的H(z-1)都会不同,实现了自适应调整,由原信号与滤波后的信号相减即得到基波信号;Where T is the sampling period, a 1 (n) that changes with the sampling point is obtained by the adaptive least squares method, and the corresponding notch frequency also changes with time. In order to realize the adaptiveness, p changes with the sampling point as p(n); thus, the H(z -1 ) corresponding to each sampling point signal in x(KT s ) will be different, and the adaptive adjustment is realized, and the fundamental wave is obtained by subtracting the original signal from the filtered signal Signal;

(3)利用线性插值法计算信号的基波周期,设在节点a=t0<t1<t2…<tn=b处的函数值为y0,y1,y2,…,yn,在每个小区间[xj,xj+1]中以直线代替曲线,则信号第i次穿过阈值a的时间ti(3) Use the linear interpolation method to calculate the fundamental wave period of the signal, and set the function value at the node a=t 0 <t 1 <t 2 ...<t n =b to be y 0 , y 1 , y 2 ,…,y n , replace the curve with a straight line in each small interval [x j ,x j+1 ], then the time t i when the signal crosses the threshold a for the ith time is

tt ii == (( aa -- ythe y jj )) ythe y jj ++ 11 -- ythe y jj ++ tt jj -- -- -- (( 11 -- 55 ))

同理可得信号第i+20次穿过阈值a的时间ti+20,采样序列x(n)的20个周期长度的采样时间的平均值T*为:In the same way, the time t i+20 when the signal crosses the threshold a for the i+20th time, the average value T* of the sampling time of 20 cycle lengths of the sampling sequence x(n) is:

TT ** == 11 2020 [[ (( tt ii ++ 2020 -- tt ii ]] -- -- -- (( 11 -- 66 ))

则T*即为信号的基波周期,另外这里采用20个周期是为了能够更准确的计算基波周期;Then T* is the fundamental period of the signal, and 20 periods are used here to calculate the fundamental period more accurately;

(4)根据计算所得的基波周期,对原采样序列中的谐波分量进行准同步化,得到重构序列x*(kλs),非同步采样时P不是整数,会产生频谱泄露,为了实现非同步采样序列的准同步化,对采样周期Ts进行调整,利用T*计算准同步采样周期λs (4) According to the calculated fundamental wave period, the harmonic components in the original sampling sequence are quasi-synchronized to obtain the reconstructed sequence x * (kλ s ), P is not an integer when sampling asynchronously, and spectrum leakage will occur. In order Realize the quasi-synchronization of the non-synchronous sampling sequence, adjust the sampling period T s , and use T* to calculate the quasi-synchronous sampling period λ s

&lambda;&lambda; sthe s == 2020 TT ** LL ** -- -- -- (( 11 -- 77 ))

其中L*为新的准同步采样序列的20个周期内采样点个数,但是可近似取L*=L,以减小误差,L为原始采样序列20个信号周期内的采样点个数,通过三次样条插值法获得准同步采样序列中的每个采样点,以原采样序列中的采样点为插值节点,Ts为插值节点间隔,令某一信号周期的起始点同时为采样点起点,由于三次样条差值函数K(t)在每个区间[xj,xj+1]上是分段三次多项式,知三次样条函数K(t)的二阶导数K''(t)在每个小区间上都是一次多项式,设K''(tj)=Mj,K''(tj+1)=Mj+1,则K''(t)表达式为Among them, L * is the number of sampling points in 20 periods of the new quasi-synchronous sampling sequence, but it can be approximated that L * = L to reduce the error, and L is the number of sampling points in the 20 signal periods of the original sampling sequence, Each sampling point in the quasi-synchronous sampling sequence is obtained by the cubic spline interpolation method, the sampling point in the original sampling sequence is used as the interpolation node, T s is the interpolation node interval, and the starting point of a certain signal cycle is also the starting point of the sampling point , since the cubic spline difference function K(t) is a piecewise cubic polynomial on each interval [x j , x j+1 ], the second order derivative K''(t of the cubic spline function K(t) is known ) is a first-degree polynomial in each small interval, assuming K''(t j )=M j , K''(t j+1 )=M j+1 , then the expression of K''(t) is

KK &Prime;&Prime; (( tt )) == Mm jj tt jj ++ 11 -- tt hh jj ++ Mm jj ++ 11 tt -- tt jj hh jj -- -- -- (( 11 -- 88 ))

其中,hj=tj+1-tjWherein, h j =t j+1 -t j .

将K''(t)积分两次,并带入边界条件得K(t)的表达式为Integrate K''(t) twice and bring it into the boundary condition to get the expression of K(t) as

KK (( tt )) == Mm jj (( tt jj ++ 11 -- tt )) 33 66 hh jj ++ Mm jj ++ 11 (( tt -- tt jj )) 33 66 hh jj ++ (( ythe y jj -- 11 66 Mm jj hh jj 22 )) tt jj ++ 11 -- tt hh jj ++ (( ythe y jj ++ 11 -- 11 66 Mm jj ++ 11 hh jj 22 )) tt -- tt jj hh jj

(t∈[tj,tj+1];j=0,1,…,n-1)(1-9)(t∈[t j ,t j+1 ];j=0,1,…,n-1)(1-9)

设第m个准同步采样点位于第j个同步采样点和第j+1个同步采样点之间,则该准同步采样点可由下式计算Suppose the mth quasi-synchronous sampling point is located between the jth synchronous sampling point and the j+1th synchronous sampling point, then the quasi-synchronous sampling point can be calculated by the following formula

KK (( m&lambda;m&lambda; sthe s )) == Mm jj (( tt jj ++ 11 -- m&lambda;m&lambda; sthe s )) 33 66 hh jj ++ Mm jj ++ 11 (( m&lambda;m&lambda; sthe s -- tt jj )) 33 66 hh jj ++ (( ythe y jj -- 11 66 Mm jj hh jj 22 )) tt jj ++ 11 -- m&lambda;m&lambda; sthe s hh jj ++ (( ythe y jj ++ 11 -- 11 66 Mm jj ++ 11 hh jj 22 )) m&lambda;m&lambda; sthe s -- tt jj hh jj

(t∈[tj,tj+1];j=0,1,…,n-1)(1-10)(t∈[t j ,t j+1 ];j=0,1,…,n-1)(1-10)

重复K(mλs)的计算过程,可得到L*-1个计算值,这L*-1个准同步采样点和起始点共同组成了长度为T*的准同步采样序列,至此,得到了重构采样序列x*(kλs)的全部信息,即重构信号的位置和采样值;Repeating the calculation process of K(mλ s ), you can get L * -1 calculated values. These L * -1 quasi-synchronous sampling points and the starting point together form a quasi-synchronous sampling sequence with a length of T * . So far, we have obtained Reconstruct all information of the sampling sequence x * (kλ s ), that is, the position and sampling value of the reconstructed signal;

(5)利用FIR陷波滤波器分离x*(kλs)中的谐波与间谐波分量,滤波器设置多个陷波频率形成梳状;由于采样频率为该滤波器齿间间隔频率的整数倍,因此FIR陷波滤波器对于同步采样有很好的效果,不会产生能量损失,适用于准同步采样序列;由于滤波器的陷波频率是基波的整数倍,因此可以滤除基波和所有整数次谐波;(5) Use the FIR notch filter to separate the harmonic and interharmonic components in x * (kλ s ), and set multiple notch frequencies in the filter to form a comb; since the sampling frequency is the frequency of the inter-tooth interval of the filter Integer multiples, so the FIR notch filter has a good effect on synchronous sampling without energy loss, and is suitable for quasi-synchronous sampling sequences; since the notch frequency of the filter is an integer multiple of the fundamental, it can filter out the fundamental waves and all integer harmonics;

(6)对FIR陷波滤波器滤波后得到的间谐波成分x*I(kλs),使用加Hanning窗的双插值FFT算法计算间谐波的参数;(6) For the inter-harmonic component x *I (kλ s ) obtained after filtering with the FIR notch filter, use the double interpolation FFT algorithm with Hanning window to calculate the parameters of the inter-harmonic;

(7)从准同步采样序列x*(kλs)中减去间谐波成分x*I(kλs),获得谐波分量x*H(kλs);(7) Subtract the interharmonic component x *I (kλ s ) from the quasi-synchronous sampling sequence x * (kλ s ) to obtain the harmonic component x *H (kλ s );

(8)对x*H(kλs)进行DFT或FFT运算,由其结果计算出各次谐波参数。(8) Carry out DFT or FFT operation on x *H (kλ s ), and calculate the harmonic parameters of each order from the result.

进一步地,所述的自适应跟踪数字陷波滤波器为在数字陷波滤波器的基础上增加自适应控制,其接受具有陷波频率的输入信号,通过最小二乘自适应算法求出a1,利用a1构成数字陷波滤波器H(z-1)陷除具有此陷波频率的信号。Further, the adaptive tracking digital notch filter is to increase adaptive control on the basis of the digital notch filter, which accepts an input signal with a notch frequency, and obtains a 1 by a least squares adaptive algorithm , use a 1 to form a digital notch filter H(z -1 ) to notch the signal with this notch frequency.

在目前检测技术基础上,本装置更为优越的技术关键主要有两点:On the basis of the current detection technology, there are two key technical points for the superiority of this device:

1)有效的限制谐波的泄露,避免谐波能量的损失。1) Effectively limit the leakage of harmonics and avoid the loss of harmonic energy.

2)通过分离谐波与间谐波,来减少谐波与间谐波间的相互影响。2) By separating harmonics and inter-harmonics, the interaction between harmonics and inter-harmonics is reduced.

在分析大电网中上述技术关键点1)要比技术关键点2)更为重要,但是鉴于微电网中间谐波含量有所增加,技术关键点2)和技术关键点1)同样是主要需解决的技术难题。In the analysis of the large power grid, the above technical key point 1) is more important than the technical key point 2), but in view of the increase in the intermediate harmonic content of the micro-grid, the technical key point 2) and the technical key point 1) are also the main points to be solved technical problems.

对于前述技术关键点1),由于分离后的谐波与间谐波都是同步采样,因此消除了由于FFT非同步采样引起的栅栏效应和频谱泄露效应,从而达到有效的限制谐波的泄露,尽量减小谐波能量损失的技术要求。For the aforementioned technical key point 1), since the separated harmonics and inter-harmonics are all synchronous sampling, the fence effect and spectrum leakage effect caused by FFT asynchronous sampling are eliminated, thereby effectively limiting the leakage of harmonics. Minimize the technical requirements of harmonic energy loss.

对于前述技术关键点2),提出基于准同步采样重构信号的检测算法,将非同步采样信号准同步化,达到抑制频谱泄漏和栅栏效应的目的,算法首先采用自适应跟踪数字陷波滤波器对非同步采样下得到的信号进行预处理,滤除基波频率以外的其它频率分量,然后对滤波信号使用与阀值比较的方法并利用线性插值法获取信号的基波周期,根据该基波周期,采用三次样条插值算法重构原始采样序列,使重构信号近似于同步采样信号,随后重构信号通过FIR陷波滤波器实现谐波与间谐波的分离。由于频谱泄漏和栅栏效应得到了显著抑制,根据重构信号的FFT结果就能获得各次谐波的准确参数。该方法通过分离信号中的谐波与间谐波成分,达到抑制两者相互干扰的目的,能够同时实现谐波和间谐波参数的准确测量。For the aforementioned technical key point 2), a detection algorithm based on quasi-synchronous sampling reconstructed signals is proposed to quasi-synchronize non-synchronous sampling signals to achieve the purpose of suppressing spectrum leakage and fence effects. The algorithm first adopts adaptive tracking digital notch filter Preprocess the signal obtained under asynchronous sampling, filter out other frequency components other than the fundamental frequency, then use the method of comparing the filtered signal with the threshold value and use the linear interpolation method to obtain the fundamental period of the signal, according to the fundamental frequency period, the cubic spline interpolation algorithm is used to reconstruct the original sampling sequence, so that the reconstructed signal is similar to the synchronous sampling signal, and then the reconstructed signal is separated from the harmonics and inter-harmonics through the FIR notch filter. Since the spectrum leakage and the fence effect are significantly suppressed, the accurate parameters of each harmonic can be obtained according to the FFT result of the reconstructed signal. By separating the harmonic and interharmonic components in the signal, the method achieves the purpose of suppressing the mutual interference between the two, and can realize the accurate measurement of harmonic and interharmonic parameters at the same time.

3、有益效果3. Beneficial effects

相比于现有技术,本发明具有如下有益效果:Compared with the prior art, the present invention has the following beneficial effects:

(1)本发明是一种基于STM32F107VCT6的微电网谐波与间谐波检测装置,充分考虑了微网自身分布式电源结构和主网对微网的影响,特别是微网与主网解列或者微网维持主网的不平衡电压运行微网谐波含量很大的情况,很好地解决上述难题,它能够检测系统51次以内的谐波、间谐波,并可计算显示单次谐波畸变率、总谐波畸变率、波峰因子、有功功率、无功功率等数值,此外该检测装置尺寸非常适于手持,便于携带;(1) The present invention is a micro-grid harmonic and inter-harmonic detection device based on STM32F107VCT6, fully considering the distributed power structure of the micro-grid itself and the influence of the main network on the micro-grid, especially the separation of the micro-grid and the main grid Or when the microgrid maintains the unbalanced voltage of the main grid and operates with a large amount of harmonics in the microgrid, it can solve the above problems well. It can detect harmonics and interharmonics within the 51st order of the system, and can calculate and display single harmonics Wave distortion rate, total harmonic distortion rate, crest factor, active power, reactive power and other values, in addition, the size of the detection device is very suitable for hand-held, easy to carry;

(2)本发明是一种基于STM32F107VCT6的微电网谐波与间谐波检测装置,在硬件上的使用基于Cortex-M3核的32位单片机STM32F107VCT6,其处理速度快成本低,在谐波检测方面有良好性能;(2) The present invention is a micro-grid harmonic and inter-harmonic detection device based on STM32F107VCT6. The use of the hardware is based on the Cortex-M3 core 32-bit single-chip STM32F107VCT6, which has fast processing speed and low cost. In terms of harmonic detection have good performance;

(3)本发明是一种微电网谐波与间谐波检测方法,提出了准同步采样重构信号的新检测算法,其设计自适应跟踪数字陷波滤波器来计算基波周期,该设计对于微电网信号周期波动的特点十分有针对性,其运用三次样条插值函数重构信号的方法实现非同步信号的准同步化,在省去硬件锁相电路降低成本的同时避免了频谱泄露和栅栏效应,其设计FIR陷波滤波器很好的实现了谐波与间谐波的分离,避免了谐波与间谐波间的相互干扰,提高了计算精度。(3) The present invention is a method for detecting harmonics and interharmonics in a microgrid. It proposes a new detection algorithm for quasi-synchronous sampling and reconstruction signals. It designs an adaptive tracking digital notch filter to calculate the fundamental wave period. The design It is very targeted for the characteristics of the periodic fluctuation of the microgrid signal. It uses the method of reconstructing the signal with the cubic spline interpolation function to realize the quasi-synchronization of the non-synchronous signal. It avoids the spectrum leakage and Fence effect, the design of the FIR notch filter can realize the separation of harmonics and inter-harmonics, avoid the mutual interference between harmonics and inter-harmonics, and improve the calculation accuracy.

附图说明Description of drawings

图1为本发明间谐波检测装置总体结构示意图;1 is a schematic diagram of the overall structure of the interharmonic detection device of the present invention;

图2为本发明谐波与间谐波算法流程示意图。Fig. 2 is a schematic flow chart of the harmonic and inter-harmonic algorithm of the present invention.

具体实施方式detailed description

下面结合附图对本发明进行详细描述。The present invention will be described in detail below in conjunction with the accompanying drawings.

如附图1装置工作流程是:本发明采用如下的技术方案。The device workflow as shown in Figure 1 is: the present invention adopts the following technical solutions.

一种基于STM32F107VCT6的微电网谐波与间谐波检测装置,包括信号采集模块、信号处理模块和信号的显示输出模块,信号采集模块中采用霍尔电压电流传感器作为采集电网三相电压电流的采集器;信号处理模块包括电压电流的转换电路、抗混叠滤波电路、电平调整电路、核心处理器STM32F107VCT6和处理器外围电路;信号采集模块的霍尔电压电流传感器的采集端与电网连接,输出端接信号处理模块,在信号处理模块中依次经过电流电压转换电路、抗混叠滤波电路和电平调整电路;电平调整电路的输出端接核心处理器STM32F107VCT6的A/D转换器输入端,STM32F107VCT6的外围接入LCD显示屏。核心处理器STM32F107VCT6由意法半导体(ST)集团生产。A micro-grid harmonic and inter-harmonic detection device based on STM32F107VCT6, including a signal acquisition module, a signal processing module, and a signal display output module. The signal acquisition module uses a Hall voltage and current sensor as the acquisition of the three-phase voltage and current of the power grid The signal processing module includes a voltage and current conversion circuit, an anti-aliasing filter circuit, a level adjustment circuit, a core processor STM32F107VCT6 and a peripheral circuit of the processor; the acquisition end of the Hall voltage and current sensor of the signal acquisition module is connected to the power grid, and the output The terminal is connected to the signal processing module, and in the signal processing module, it passes through the current-voltage conversion circuit, anti-aliasing filter circuit and level adjustment circuit in sequence; the output terminal of the level adjustment circuit is connected to the A/D converter input terminal of the core processor STM32F107VCT6, The peripheral of STM32F107VCT6 is connected to the LCD display. The core processor STM32F107VCT6 is produced by STMicroelectronics (ST) Group.

处理器外围电路包括电源电路、复位电路和晶振电路;电源电路通过电压变换提供整个系统工作所需的不同电压的电源;复位电路中采用复位芯片手动复位方式;晶振电路为单片机提供时钟信号。输出显示模块包括LCD显示屏、键盘、PC通信模块。输出显示模块中还包含有键盘电路,键盘与核心处理器STM32F107VCT6的连接是通过键盘电路连接。The peripheral circuit of the processor includes a power supply circuit, a reset circuit and a crystal oscillator circuit; the power supply circuit provides power supplies of different voltages required by the entire system through voltage conversion; the reset circuit adopts a reset chip manual reset method; the crystal oscillator circuit provides a clock signal for the single-chip microcomputer. The output display module includes LCD display screen, keyboard and PC communication module. The output display module also includes a keyboard circuit, and the connection between the keyboard and the core processor STM32F107VCT6 is through the keyboard circuit.

信号采集模块的霍尔电压电流传感器的采集端与电网连接,输出端接信号处理模块,首先经过电流电压转换电路把电流信号变换成电压信号,该电路运用可调电阻和稳压二极管实现电流与电压的转换与电压钳位。信号由电流电压转换电路出来后进入抗混叠滤波电路,综合考虑滤波效果和延时时间该电路采用二阶巴特沃斯滤波器进行模拟滤波,滤波器截止频率为2500Hz可以滤去高于51次的谐波,该处滤波的目的是为了在后面数据采集时满足采样定理,避免采样时出现频率混叠现象。信号经过抗混叠滤波电路后进入电平调整电路,该电路由两个运放和电阻构成,电路由外部供给1.6V参考电压,信号经过该电路后,由于运放构成的比例电路和参考电压的调节,使得信号幅值变为原来的一半并且波形整体抬高。此外,由于两路运放的作用形成了差分信号,随后信号送入STM32F107VCT6的ADC引脚,利用STM32F107VCT6内部的A/D转换器进行模数转换。STM32F107VCT6有两个12位A/D转换器,共18个通道,可以两个通道同时工作。除为了符合IEC标准的要求,即分析窗的宽度为200ms,DFT的频率分辨率为5Hz,为了提高基波周期的计算准确度和谐波频率分辨率,设置装置的采样频率为10240Hz,每次处理的采样序列长度为4096个点。信号经采样转换成数字信号后在STM32F107VCT6中进行分析计算。The acquisition terminal of the Hall voltage and current sensor of the signal acquisition module is connected to the power grid, and the output terminal is connected to the signal processing module. First, the current signal is converted into a voltage signal through the current-voltage conversion circuit. Voltage conversion and voltage clamping. After the signal comes out of the current-voltage conversion circuit, it enters the anti-aliasing filter circuit. Considering the filtering effect and delay time, the circuit uses a second-order Butterworth filter for analog filtering. The filter cut-off frequency is 2500Hz and can filter out more than 51 times. The purpose of filtering here is to satisfy the sampling theorem during subsequent data acquisition and avoid frequency aliasing during sampling. After the signal passes through the anti-aliasing filter circuit, it enters the level adjustment circuit. This circuit is composed of two operational amplifiers and resistors. The circuit is supplied with a 1.6V reference voltage from the outside. After the signal passes through the circuit, due to the proportional circuit formed by the operational amplifier and the reference voltage The adjustment makes the signal amplitude become half of the original and the waveform is raised as a whole. In addition, due to the action of the two operational amplifiers, a differential signal is formed, and then the signal is sent to the ADC pin of the STM32F107VCT6, and the A/D converter inside the STM32F107VCT6 is used for analog-to-digital conversion. STM32F107VCT6 has two 12-bit A/D converters with a total of 18 channels, and two channels can work at the same time. In addition to meeting the requirements of the IEC standard, that is, the width of the analysis window is 200ms, and the frequency resolution of DFT is 5Hz. In order to improve the calculation accuracy of the fundamental period and the harmonic frequency resolution, the sampling frequency of the device is set to 10240Hz. The length of the processed sample sequence is 4096 points. After the signal is sampled and converted into a digital signal, it is analyzed and calculated in STM32F107VCT6.

具体的实现步骤如附图2:The specific implementation steps are shown in Figure 2:

一种微电网谐波与间谐波检测方法,其步骤为:A method for detecting harmonics and interharmonics of a microgrid, the steps of which are:

(1)在满足奈奎斯特采样定理的情况下,以固定采样频率对电力系统信号进行等间隔采样,即有等式(1) In the case of satisfying the Nyquist sampling theorem, the power system signal is sampled at equal intervals at a fixed sampling frequency, that is, the equation

K·Ts=P·T0(1-1)K·T s =P·T 0 (1-1)

成立,其中Ts为采样周期,T0是信号周期,K为采样点个数,P为信号周期个数,对于非同步采样,显然P不为整数;Established, where T s is the sampling period, T 0 is the signal period, K is the number of sampling points, P is the number of signal periods, for asynchronous sampling, obviously P is not an integer;

(2)采用自适应跟踪数字陷波滤波器滤去采样序列x(KTs)中的基波分量,得到新的采样序列x'(KTs),因此从x(KTs)中减去x'(KTs),即可得到基波分量x0(KTs);与传统的陷波滤波器相比,自适应跟踪数字陷波滤波器由于结合了自适应的滤波方式使得基波频率在50Hz附近波动时也能准确滤除。本处的自适应跟踪数字陷波滤波器为在数字陷波滤波器的基础上增加自适应控制,其接受具有陷波频率的输入信号,通过最小二乘自适应算法求出a1,利用a1构成数字陷波滤波器H(z-1)陷除具有此陷波频率的信号。理想数字陷波滤波器的频率响应为(2) Use the adaptive tracking digital notch filter to filter out the fundamental component in the sampling sequence x(KT s ) to obtain a new sampling sequence x'(KT s ), so subtract x from x(KT s ) '(KT s ), the fundamental component x 0 (KT s ) can be obtained; compared with the traditional notch filter, the adaptive tracking digital notch filter makes the fundamental frequency in the It can also accurately filter out fluctuations near 50Hz. The adaptive tracking digital notch filter here is to add adaptive control on the basis of the digital notch filter, it accepts the input signal with the notch frequency, obtains a 1 through the least squares adaptive algorithm, and uses a 1 constitutes a digital notch filter H(z -1 ) to trap signals with this notch frequency. The frequency response of an ideal digital notch filter is

Hh (( ee j&omega;tj&omega;t )) == 11 &omega;&omega; &NotEqual;&NotEqual; &omega;&omega; 00 00 &omega;&omega; == &omega;&omega; 00 -- -- -- (( 11 -- 22 ))

其中e为自然常数,j为虚数单位,ω为频率,t为时间,ω0为陷波频率;Wherein e is a natural constant, j is an imaginary number unit, ω is a frequency, t is a time, and ω0 is a notch frequency;

对于单一陷波频率其传递函数H(z-1)具有如下对称镜像形式For a single notch frequency, its transfer function H(z -1 ) has the following symmetrical mirror form

Hh (( zz -- 11 )) == 11 ++ aa 11 zz -- 11 ++ zz -- 22 11 ++ aa 11 pzpz -- 11 ++ pp 22 zz -- 22 -- -- -- (( 11 -- 33 ))

式中,z为复数变量,p是一个接近1但略小于1的常数,a1为参数,由陷波频率决定,陷波频率表达式为In the formula, z is a complex variable, p is a constant close to 1 but slightly smaller than 1, a 1 is a parameter, which is determined by the notch frequency, and the notch frequency expression is

ff 00 == arccosarccos (( -- aa 11 // 22 )) 22 &pi;T&pi;T -- -- -- (( 11 -- 44 ))

其中T为采样周期,由自适应最小二乘法求出随采样点变化的a1(n),则其对应的陷波频率也是随时间变化的,为了实现自适应性,p随采样点变化即为p(n),由此,x(KTs)中每一个采样点信号对应的H(z-1)都会不同,实现了自适应调整,由原信号与滤波后的信号相减即得到基波信号;Where T is the sampling period, a 1 (n) that changes with the sampling point is obtained by the adaptive least squares method, and the corresponding notch frequency also changes with time. In order to achieve self-adaptability, p changes with the sampling point as is p(n), thus, the H(z -1 ) corresponding to each sampling point signal in x(KT s ) will be different, and the adaptive adjustment is realized, and the base signal can be obtained by subtracting the original signal from the filtered signal wave signal;

(3)利用线性插值法计算信号的基波周期,设在节点a=t0<t1<t2…<tn=b处的函数值为y0,y1,y2,…,yn,在每个小区间[xj,xj+1]中以直线代替曲线,则信号第i次穿过阈值a的时间ti(3) Use the linear interpolation method to calculate the fundamental wave period of the signal, and set the function value at the node a=t 0 <t 1 <t 2 ...<t n =b to be y 0 , y 1 , y 2 ,…,y n , replace the curve with a straight line in each small interval [x j ,x j+1 ], then the time t i when the signal crosses the threshold a for the ith time is

tt ii == (( aa -- ythe y jj )) ythe y jj ++ 11 -- ythe y jj ++ tt jj -- -- -- (( 11 -- 55 ))

同理可得信号第i+20次穿过阈值a的时间ti+20,采样序列x(n)的20个周期长度的采样时间的平均值T*为:In the same way, the time t i+20 when the signal crosses the threshold a for the i+20th time, the average value T* of the sampling time of 20 cycle lengths of the sampling sequence x(n) is:

TT ** == 11 2020 [[ (( tt ii ++ 2020 -- tt ii ]] -- -- -- (( 11 -- 66 ))

则T*即为信号的基波周期,另外这里采用20个周期是为了能够更准确的计算基波周期;Then T* is the fundamental period of the signal, and 20 periods are used here to calculate the fundamental period more accurately;

(4)根据计算所得的基波周期,对原采样序列中的谐波分量进行准同步化,得到重构序列x*(kλs),非同步采样时P不是整数,会产生频谱泄露,为了实现非同步采样序列的准同步化,对采样周期Ts进行调整,利用T*计算准同步采样周期λs (4) According to the calculated fundamental wave period, the harmonic components in the original sampling sequence are quasi-synchronized to obtain the reconstructed sequence x * (kλ s ), P is not an integer when sampling asynchronously, and spectrum leakage will occur. In order Realize the quasi-synchronization of the non-synchronous sampling sequence, adjust the sampling period T s , and use T* to calculate the quasi-synchronous sampling period λ s

&lambda;&lambda; sthe s == 2020 TT ** LL ** -- -- -- (( 11 -- 77 ))

其中L*为新的准同步采样序列的20个周期内采样点个数,但是可近似取L*=L,以减小误差,L为原始采样序列20个信号周期内的采样点个数,通过三次样条插值法获得准同步采样序列中的每个采样点,以原采样序列中的采样点为插值节点,Ts为插值节点间隔,令某一信号周期的起始点同时为采样点起点,由于三次样条差值函数K(t)在每个区间[xj,xj+1]上是分段三次多项式,知三次样条函数K(t)的二阶导数K''(t)在每个小区间上都是一次多项式,设K''(tj)=Mj,K''(tj+1)=Mj+1,则K''(t)表达式为Among them, L * is the number of sampling points in 20 periods of the new quasi-synchronous sampling sequence, but it can be approximated that L * = L to reduce the error, and L is the number of sampling points in the 20 signal periods of the original sampling sequence, Each sampling point in the quasi-synchronous sampling sequence is obtained by the cubic spline interpolation method, the sampling point in the original sampling sequence is used as the interpolation node, T s is the interpolation node interval, and the starting point of a certain signal cycle is also the starting point of the sampling point , since the cubic spline difference function K(t) is a piecewise cubic polynomial on each interval [x j , x j+1 ], the second order derivative K''(t of the cubic spline function K(t) is known ) is a first-degree polynomial in each small interval, assuming K''(t j )=M j , K''(t j+1 )=M j+1 , then the expression of K''(t) is

KK &Prime;&Prime; (( tt )) == Mm jj tt jj ++ 11 -- tt hh jj ++ Mm jj ++ 11 tt -- tt jj hh jj -- -- -- (( 11 -- 88 ))

其中,hj=tj+1-tjWherein, h j =t j+1 -t j .

将K''(t)积分两次,并带入边界条件得K(t)的表达式为Integrate K''(t) twice and bring it into the boundary condition to get the expression of K(t) as

KK (( tt )) == Mm jj (( tt jj ++ 11 -- tt )) 33 66 hh jj ++ Mm jj ++ 11 (( tt -- tt jj )) 33 66 hh jj ++ (( ythe y jj -- 11 66 Mm jj hh jj 22 )) tt jj ++ 11 -- tt hh jj ++ (( ythe y jj ++ 11 -- 11 66 Mm jj ++ 11 hh jj 22 )) tt -- tt jj hh jj

(t∈[tj,tj+1];j=0,1,…,n-1)(1-9)(t∈[t j ,t j+1 ];j=0,1,…,n-1)(1-9)

设第m个准同步采样点位于第j个同步采样点和第j+1个同步采样点之间,则该准同步采样点可由下式计算Assuming that the mth quasi-synchronous sampling point is located between the jth synchronous sampling point and the j+1th synchronous sampling point, then the quasi-synchronous sampling point can be calculated by the following formula

KK (( m&lambda;m&lambda; sthe s )) == Mm jj (( tt jj ++ 11 -- m&lambda;m&lambda; sthe s )) 33 66 hh jj ++ Mm jj ++ 11 (( m&lambda;m&lambda; sthe s -- tt jj )) 33 66 hh jj ++ (( ythe y jj -- 11 66 Mm jj hh jj 22 )) tt jj ++ 11 -- m&lambda;m&lambda; sthe s hh jj ++ (( ythe y jj ++ 11 -- 11 66 Mm jj ++ 11 hh jj 22 )) m&lambda;m&lambda; sthe s -- tt jj hh jj

(t∈[tj,tj+1];j=0,1,…,n-1)(1-10)(t∈[t j ,t j+1 ];j=0,1,…,n-1)(1-10)

重复K(mλs)的计算过程,可得到L*-1个计算值,这L*-1个准同步采样点和起始点共同组成了长度为T*的准同步采样序列,至此,得到了重构采样序列x*(kλs)的全部信息,即重构信号的位置和采样值;Repeating the calculation process of K(mλ s ), you can get L * -1 calculated values. These L * -1 quasi-synchronous sampling points and the starting point together form a quasi-synchronous sampling sequence with a length of T * . So far, we have obtained Reconstruct all information of the sampling sequence x * (kλ s ), that is, the position and sampling value of the reconstructed signal;

(5)利用FIR陷波滤波器分离x*(kλs)中的谐波与间谐波分量,滤波器设置多个陷波频率形成梳状;由于采样频率为该滤波器齿间间隔频率的整数倍,因此FIR陷波滤波器对于同步采样有很好的效果,不会产生能量损失,适用于准同步采样序列;由于滤波器的陷波频率是基波的整数倍,因此可以滤除基波和所有整数次谐波;(5) Use the FIR notch filter to separate the harmonic and interharmonic components in x * (kλ s ), and set multiple notch frequencies in the filter to form a comb; since the sampling frequency is the frequency of the inter-tooth interval of the filter Integer multiples, so the FIR notch filter has a good effect on synchronous sampling without energy loss, and is suitable for quasi-synchronous sampling sequences; since the notch frequency of the filter is an integer multiple of the fundamental, it can filter out the fundamental waves and all integer harmonics;

(6)对FIR陷波滤波器滤波后得到的间谐波成分x*I(kλs),使用加Hanning窗的双插值FFT算法计算间谐波的参数;(6) For the inter-harmonic component x *I (kλ s ) obtained after filtering with the FIR notch filter, use the double interpolation FFT algorithm with Hanning window to calculate the parameters of the inter-harmonic;

(7)从准同步采样序列x*(kλs)中减去间谐波成分x*I(kλs),获得谐波分量x*H(kλs);(7) Subtract the interharmonic component x *I (kλ s ) from the quasi-synchronous sampling sequence x * (kλ s ) to obtain the harmonic component x *H (kλ s );

(8)对x*H(kλs)进行DFT或FFT运算,由其结果计算出各次谐波参数。(8) Carry out DFT or FFT operation on x *H (kλ s ), and calculate the harmonic parameters of each order from the result.

通过实施例可以看出本发明具有如下优点:Can find out that the present invention has the following advantages by embodiment:

1)间谐波检测装置的设计充分考虑了微电网谐波的特点。1) The design of the interharmonic detection device fully considers the characteristics of the harmonics of the microgrid.

2)结构简单,总体成本较低,易于实现,由于算法上采用信号重构技术,节省了硬件上的锁相电路,不仅使间谐波的检测结果更加精确,同时还节约了成本。2) The structure is simple, the overall cost is low, and it is easy to implement. Since the signal reconstruction technology is used in the algorithm, the phase-locked circuit on the hardware is saved, which not only makes the detection results of inter-harmonics more accurate, but also saves costs.

3)在核心处理器上选用了基于Cortex-M3核的32位互联型单片机STM32F107,该处理器的高计算速度能够充分发挥信号重构算法的优越性,实现算法与硬件的有效配合。3) A 32-bit interconnected single-chip microcomputer STM32F107 based on the Cortex-M3 core is selected as the core processor. The high computing speed of this processor can give full play to the superiority of the signal reconstruction algorithm and realize the effective cooperation between the algorithm and the hardware.

4)在检测方法上采用了信号重构的方法,克服了谐波和间谐波的相互干扰和传统FFT算法的频谱泄露。4) In the detection method, the method of signal reconstruction is adopted, which overcomes the mutual interference of harmonics and interharmonics and the spectrum leakage of traditional FFT algorithms.

5)通过设计FIR滤波器进行谐波与间谐波的分离,使谐波和间谐波能够单独计算,避免相互干扰提高了计算精度。5) By designing the FIR filter to separate the harmonics and inter-harmonics, the harmonics and inter-harmonics can be calculated separately, avoiding mutual interference and improving the calculation accuracy.

Claims (2)

1.一种微电网谐波与间谐波检测方法,其步骤为: 1. A microgrid harmonic and interharmonic detection method, the steps of which are: (1)在满足奈奎斯特采样定理的情况下,以固定采样频率对电力系统信号进行等间隔采样,即有等式 (1) In the case of satisfying the Nyquist sampling theorem, the power system signal is sampled at equal intervals at a fixed sampling frequency, that is, the equation K·Ts=P·T0(1-1) K·T s =P·T 0 (1-1) 成立,其中Ts为采样周期,T0是信号周期,K为采样点个数,P为信号周期个数,对于非同步采样,显然P不为整数; Established, where T s is the sampling period, T 0 is the signal period, K is the number of sampling points, P is the number of signal periods, for asynchronous sampling, obviously P is not an integer; (2)采用自适应跟踪数字陷波滤波器滤去采样序列x(KTs)中的基波分量,得到新的采样序列x'(KTs),因此从x(KTs)中减去x'(KTs),即可得到基波分量x0(KTs);与传统的陷波滤波器相比,自适应跟踪数字陷波滤波器由于结合了自适应的滤波方式使得基波频率在50Hz附近波动时也能准确滤除,理想数字陷波滤波器的频率响应为 (2) Use an adaptive tracking digital notch filter to filter out the fundamental component in the sampling sequence x(KT s ), and obtain a new sampling sequence x'(KT s ), so subtract x from x(KT s ) '(KT s ), the fundamental component x 0 (KT s ) can be obtained; compared with the traditional notch filter, the adaptive tracking digital notch filter makes the fundamental frequency in the It can also accurately filter out fluctuations around 50Hz. The frequency response of an ideal digital notch filter is 其中e为自然常数,j为虚数单位,ω为频率,t为时间,ω0为陷波频率; Wherein e is a natural constant, j is an imaginary number unit, ω is a frequency, t is a time, and ω0 is a notch frequency; 对于单一陷波频率其传递函数H(z-1)具有如下对称镜像形式 For a single notch frequency, its transfer function H(z -1 ) has the following symmetrical mirror form 式中,z为复数变量,p是一个接近1但略小于1的常数,a1为参数,由陷波频率决定,陷波频率表达式为 In the formula, z is a complex variable, p is a constant close to 1 but slightly smaller than 1, a 1 is a parameter, which is determined by the notch frequency, and the notch frequency expression is 其中T为采样周期,由自适应最小二乘法求出随采样点变化的a1(n),则其对应的陷波频率也是随时间变化的,为了实现自适应性,p随采样点变化即为p(n); Where T is the sampling period, a 1 (n) that changes with the sampling point is obtained by the adaptive least squares method, and the corresponding notch frequency also changes with time. In order to achieve self-adaptability, p changes with the sampling point as is p(n); (3)利用线性插值法计算信号的基波周期,设在节点a=t0<t1<t2…<tn=b处的函数值为y0,y1,y2,…,yn,在每个小区间[xj,xj+1]中以直线代替曲线,则信号第i次穿过阈值a的时间ti(3) Use the linear interpolation method to calculate the fundamental wave period of the signal, and set the function value at the node a=t 0 <t 1 <t 2 ...<t n =b to be y 0 , y 1 , y 2 ,...,y n , replace the curve with a straight line in each small interval [x j ,x j+1 ], then the time t i when the signal crosses the threshold a for the ith time is 同理可得信号第i+20次穿过阈值a的时间ti+20,采样序列x(n)的20个周期长度的采样时间的平均值T*为: In the same way, the time t i+20 when the signal crosses the threshold a for the i+20th time, the average value T * of the sampling time of the 20 cycle length of the sampling sequence x(n) is: 则T*即为信号的基波周期; Then T * is the fundamental period of the signal; (4)根据计算所得的基波周期,对原采样序列中的谐波分量进行准同步化,得到重构序列x*(kλs),非同步采样时P不是整数,会产生频谱泄露,为了实现非同步采样序列的准同步化,对采样周期Ts进行调整,利用T*计算准同步采样周期λs (4) According to the calculated fundamental period, the harmonic components in the original sampling sequence are quasi-synchronized to obtain the reconstructed sequence x * (kλ s ), P is not an integer when sampling asynchronously, and spectrum leakage will occur. In order Realize the quasi-synchronization of the non-synchronous sampling sequence, adjust the sampling period T s , and use T * to calculate the quasi-synchronous sampling period λ s 其中L*为新的准同步采样序列的20个周期内采样点个数,但是可近似取L*=L,以减小误差,L为原始采样序列20个信号周期内的采样点个数,通过三次样条插值法获得准同步采样序列中的每个采样点,以原采样序列中的采样点为插值节点,Ts为插值节点间隔,令某一信号周期的起始点同时为采样点起点,由于三次样条差值函数K(t)在每个区间[xj,xj+1]上是分段三次多项式,知三次样条函数K(t)的二阶导数K”(t)在每个小区间上都是一次多项式,设K”(tj)=Mj,K”(tj+1)=Mj+1,则K”(t)表达式为 Wherein L * is the number of sampling points in 20 periods of the new quasi-synchronous sampling sequence, but it can be approximated to take L * = L to reduce the error, and L is the number of sampling points in the original sampling sequence of 20 signal periods, Each sampling point in the quasi-synchronous sampling sequence is obtained by the cubic spline interpolation method, the sampling point in the original sampling sequence is used as the interpolation node, T s is the interpolation node interval, and the starting point of a certain signal cycle is also the starting point of the sampling point , since the cubic spline difference function K(t) is a piecewise cubic polynomial on each interval [x j , x j+1 ], the second order derivative K”(t) of the cubic spline function K(t) is known It is a first-degree polynomial in each small interval, assuming K”(t j )=M j , K”(t j+1 )=M j+1 , then the expression of K”(t) is 其中,hj=tj+1-tjAmong them, h j =t j+1 -t j ; 将K”(t)积分两次,并带入边界条件得K(t)的表达式为 Integrate K"(t) twice and bring it into the boundary condition to get the expression of K(t) as 设第m个准同步采样点位于第j个同步采样点和第j+1个同步采样点之间,则该准同步采样点可由下式计算 Assuming that the mth quasi-synchronous sampling point is located between the jth synchronous sampling point and the j+1th synchronous sampling point, then the quasi-synchronous sampling point can be calculated by the following formula 重复K(mλs)的计算过程,可得到L*-1个计算值,这L*-1个准同步采样点和起始点共同组成了长度为T*的准同步采样序列,至此,得到了重构采样序列x*(kλs)的全部信息,即重构信号的位置和采样值; Repeating the calculation process of K(mλ s ), you can get L * -1 calculated values. These L * -1 quasi-synchronous sampling points and the starting point together form a quasi-synchronous sampling sequence with a length of T * . So far, we have obtained Reconstruct all information of the sampling sequence x * (kλ s ), that is, the position and sampling value of the reconstructed signal; (5)利用FIR陷波滤波器分离x*(kλs)中的谐波与间谐波分量,滤波器设置多个陷波频率形成梳状; (5) Utilize the FIR notch filter to separate the harmonic and interharmonic components in x * (kλ s ), and the filter sets multiple notch frequencies to form a comb; (6)对FIR陷波滤波器滤波后得到的间谐波成分x*I(kλs),使用加Hanning窗的双插值FFT算法计算间谐波的参数; (6) Interharmonic component x * I (kλ s ) obtained after FIR notch filter filtering, use the double interpolation FFT algorithm that adds Hanning window to calculate the parameter of interharmonic; (7)从准同步采样序列x*(kλs)中减去间谐波成分x*I(kλs),获得谐波分量x*H(kλs); (7) Subtract the inter-harmonic component x *I (kλ s ) from the quasi-synchronous sampling sequence x * (kλ s ) to obtain the harmonic component x *H (kλ s ); (8)对x*H(kλs)进行DFT或FFT运算,由其结果计算出各次谐波参数。 (8) Carry out DFT or FFT operation on x *H (kλ s ), and calculate the harmonic parameters of each order from the result. 2.根据权利要求1所述的一种微电网谐波与间谐波检测方法,其特征在于:所述的自适应跟踪数字陷波滤波器为在数字陷波滤波器的基础上增加自适应控制,其接受具有陷波频率的输入信号,通过最小二乘自适应算法求出a1,利用a1构成数字陷波滤波器H(z-1)陷除具有此陷波频率的信号。 2. A kind of microgrid harmonic and interharmonic detection method according to claim 1, is characterized in that: described self-adaptive tracking digital notch filter is to increase self-adaptive on the basis of digital notch filter Control, which accepts the input signal with the notch frequency, calculates a 1 through the least squares adaptive algorithm, and uses a 1 to form a digital notch filter H(z -1 ) to trap and remove the signal with the notch frequency.
CN201310183553.0A 2013-05-16 2013-05-16 A kind of micro-capacitance sensor harmonic wave based on STM32F107VCT6 and m-Acetyl chlorophosphonazo pick-up unit and detection method Expired - Fee Related CN103257271B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310183553.0A CN103257271B (en) 2013-05-16 2013-05-16 A kind of micro-capacitance sensor harmonic wave based on STM32F107VCT6 and m-Acetyl chlorophosphonazo pick-up unit and detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310183553.0A CN103257271B (en) 2013-05-16 2013-05-16 A kind of micro-capacitance sensor harmonic wave based on STM32F107VCT6 and m-Acetyl chlorophosphonazo pick-up unit and detection method

Publications (2)

Publication Number Publication Date
CN103257271A CN103257271A (en) 2013-08-21
CN103257271B true CN103257271B (en) 2016-04-06

Family

ID=48961302

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310183553.0A Expired - Fee Related CN103257271B (en) 2013-05-16 2013-05-16 A kind of micro-capacitance sensor harmonic wave based on STM32F107VCT6 and m-Acetyl chlorophosphonazo pick-up unit and detection method

Country Status (1)

Country Link
CN (1) CN103257271B (en)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103576120B (en) * 2013-11-07 2016-09-28 国家电网公司 Third-harmonic component plesiochronous information transfer check and Self-healing Algorithm
CN103604990A (en) * 2013-11-27 2014-02-26 国家电网公司 Power harmonic wave detection and analysis equipment
CN104678170B (en) * 2013-12-03 2017-10-17 国家电网公司 A kind of Electric Power Harmonic Analysis method harmonic analyzer based on harmonic analysis instrument
CN103675718B (en) * 2013-12-17 2017-01-04 复旦大学 Cosine function curve matching is used to determine the method for magnetic induction maximum and realize system
CN105703739B (en) * 2014-11-27 2020-06-09 中兴通讯股份有限公司 Digital-analog combined anti-aliasing filtering method and device
CN104502700B (en) * 2014-12-29 2017-05-10 广东电网有限责任公司电力科学研究院 Sinusoidal parameter measurement method and system of power signal
CN104777352B (en) * 2015-03-25 2018-03-30 北京交通大学 A kind of measuring method and device of the harmonic current of rolling stock
ES2818048T3 (en) 2015-08-31 2021-04-09 Otis Elevator Co Automatic commissioning of controller for active three-phase power electronic converters
CN105759116A (en) * 2016-04-14 2016-07-13 南京工程学院 Low-voltage power line power grid frequency collection device and frequency measurement algorithm
CN107525987B (en) * 2017-08-01 2020-06-19 合肥工业大学 Synchronous grid connection parameter measurement method based on adaptive sequence full-phase DFT
CN110858717A (en) * 2018-08-23 2020-03-03 中铁第五勘察设计院集团有限公司 Mixed type dynamic reactive power compensation device for low-voltage power distribution system
CN109633268B (en) * 2018-12-20 2020-03-10 北京航空航天大学 Square wave fundamental frequency identification method based on B-spline and histogram
CN109490628A (en) * 2018-12-28 2019-03-19 钟祥博谦信息科技有限公司 A kind of Measurement of Harmonics in Power System system
CN110187176A (en) * 2019-05-31 2019-08-30 中国电力科学研究院有限公司 A kind of mains by harmonics measuring device and method
CN110971110A (en) * 2019-11-08 2020-04-07 国网黑龙江省电力有限公司伊春供电公司 A Harmonic Suppression Control Method for BT-AC Converters
CN111190042B (en) * 2019-12-30 2022-06-21 中国电力科学研究院有限公司 Intelligent sensing terminal and method for measuring full frequency band of power grid signal
CN111308198B (en) * 2020-03-10 2021-09-24 国网江苏省电力有限公司扬州供电分公司 A Harmonic Measurement Method Based on Hanning Window and Windowed Interpolation DFT
CN111596254B (en) * 2020-06-12 2021-11-09 杭州万高科技股份有限公司 Anomaly detection method, device, equipment and medium for energy metering chip
CN112345826B (en) * 2020-10-23 2022-04-29 安徽大学 Frequency and transient harmonic measurement method under isolated network instability state
CN114061632B (en) * 2021-10-21 2024-03-19 上大电气科技(嘉兴)有限公司 Decoding method of high-precision magnetic encoder for compensating appointed subharmonic

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2932397Y (en) * 2006-06-02 2007-08-08 粟时平 Power Harmonics and Interharmonics Monitoring Device
CN201141893Y (en) * 2007-11-22 2008-10-29 河南索凌电气有限公司 Grid harmonic tester
CN203287435U (en) * 2013-05-16 2013-11-13 南京工程学院 A micro electrical network harmonic wave and inter-harmonic wave test apparatus based on an STM32F107VCT6

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09182294A (en) * 1995-12-27 1997-07-11 Fuji Electric Co Ltd Power factor adjustment device
JP2009264753A (en) * 2008-04-22 2009-11-12 Yokogawa Electric Corp Harmonics measuring apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2932397Y (en) * 2006-06-02 2007-08-08 粟时平 Power Harmonics and Interharmonics Monitoring Device
CN201141893Y (en) * 2007-11-22 2008-10-29 河南索凌电气有限公司 Grid harmonic tester
CN203287435U (en) * 2013-05-16 2013-11-13 南京工程学院 A micro electrical network harmonic wave and inter-harmonic wave test apparatus based on an STM32F107VCT6

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
"基于STM32的电网谐波检测仪的研究";陈媛等;《现代电子技术》;20120930;第35卷(第18期);第171-172页 *
"基于三次样条插值信号重构的微网谐波及间谐波分析算法";王继东等;《电网技术》;20121130;第36卷(第11期);第7-11页 *
"基于准同步采样的电力系统谐波与间谐波在线检测方法研究";周峰;《中国博士学位论文全文数据库 工程科技Ⅱ辑》;20121031(第10期);第C042-067正文第32-33、43-45、55-57页 *
"基于变步长LMS自适应陷波算法的电气信号频率测量";欧立权等;《电力自动化设备》;20070731;第27卷(第7期);第54-56页 *

Also Published As

Publication number Publication date
CN103257271A (en) 2013-08-21

Similar Documents

Publication Publication Date Title
CN103257271B (en) A kind of micro-capacitance sensor harmonic wave based on STM32F107VCT6 and m-Acetyl chlorophosphonazo pick-up unit and detection method
CN203287435U (en) A micro electrical network harmonic wave and inter-harmonic wave test apparatus based on an STM32F107VCT6
CN102955060B (en) Method for removing decaying direct-current component in power system fault signal
CN203149027U (en) Voltage fluctuation and flicker detection apparatus based on energy operator and frequency spectrum correction
CN102890190B (en) Nonlinear Stochastic load active energy metering method based on m ultiwavelet
CN105319447B (en) A kind of dielectric loss angle tangent method of testing and tester
CN108896820B (en) Phase modulator startup protection phasor calculation method suitable for starting static frequency converter
CN103344825A (en) Electric energy measuring system based on alternating-current sampling
CN107478896A (en) A kind of frequency adaptive harmonic current detection method based on cascade Generalized Integrator
CN203133168U (en) Power harmonic detector
CN105044456A (en) Power grid instantaneous frequency measuring and tracking method based on orthogonal sub-band
CN103630748A (en) Device and method for harmonic impedance measurement of micro-grid
CN106610450A (en) Single-phase electric energy metering chip
CN101701985B (en) Constant-frequency variable dot power grid harmonic wave detection method and admeasuring apparatus thereof
CN112255457A (en) Phase angle difference measuring method suitable for automatic quasi-synchronization device
CN102495250A (en) Quasi-synchronous wideband reactive energy meter based on Hilbert algorithm and sampling method thereof
CN103575987A (en) Inter-harmonic wave detection instrument based on DSP and detection method thereof
CN206096370U (en) Circuit parameter measuring instrument
CN204945273U (en) A kind of power quality data harvester of self-adaptation mains frequency
CN105954577A (en) Electric energy metering method
CN106483375B (en) A kind of multi-frequency fractional harmonic wave detection method
CN117169590B (en) Power harmonic analysis method and device based on software variable sampling rate
Kusljevic et al. Active power measurement algorithm for power system signals under non-sinusoidal conditions and wide-range frequency deviations
CN116718832A (en) High-precision electric energy metering method and system for fully domestic devices
CN103592513B (en) Electric power signal harmonic analysis method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160406

Termination date: 20210516

CF01 Termination of patent right due to non-payment of annual fee