CN103018555B - High-precision electric power parameter software synchronous sampling method - Google Patents
- ️Wed Nov 05 2014
CN103018555B - High-precision electric power parameter software synchronous sampling method - Google Patents
High-precision electric power parameter software synchronous sampling method Download PDFInfo
-
Publication number
- CN103018555B CN103018555B CN201210567750.8A CN201210567750A CN103018555B CN 103018555 B CN103018555 B CN 103018555B CN 201210567750 A CN201210567750 A CN 201210567750A CN 103018555 B CN103018555 B CN 103018555B Authority
- CN
- China Prior art keywords
- mrow
- msub
- sampling
- value
- coefficient Prior art date
- 2012-12-24 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
Links
Landscapes
- Measurement Of Current Or Voltage (AREA)
Abstract
本发明公开了一种高精度的电力参数软件同步采样方法,利用采样前的电力信号周期序列{Ti},i=1,2,…,M+K-1,利用滑动平均算法、指数平滑算法计算采样周期TsK用于采样,实现了软件的同步采样。本发明高精度的电力参数软件同步采样方法中以固定每个信号周期的采样点数为前提,根据多次测量所得周期值调整采样周期,使得采样周期实时地跟随被测电力信号周期变化而调整,由此测量得到的电力参数能最大限度地逼近真实值,提高同步采样精度;与硬件同步采样相比结构简单,成本相对较低;与传统软件同步采样方法相比具有计算量较少的优点,提高了实时性,对于频率变化缓慢的电力参数测量效果更明显。
The invention discloses a high-precision power parameter software synchronous sampling method, which uses the power signal period sequence {T i }, i=1, 2,...,M+K-1 before sampling, and uses the sliding average algorithm and exponential smoothing The algorithm calculates the sampling period Ts K for sampling, which realizes the synchronous sampling of the software. In the high-precision power parameter software synchronous sampling method of the present invention, the number of sampling points of each signal cycle is fixed as the premise, and the sampling cycle is adjusted according to the cycle value obtained by multiple measurements, so that the sampling cycle is adjusted in real time following the cycle change of the measured power signal, The power parameters obtained by this measurement can approach the real value to the greatest extent and improve the accuracy of synchronous sampling; compared with hardware synchronous sampling, the structure is simple and the cost is relatively low; compared with the traditional software synchronous sampling method, it has the advantage of less calculation, The real-time performance is improved, and the effect of measuring power parameters with slow frequency changes is more obvious.
Description
技术领域technical field
本发明属于电力参数测量技术领域,更为具体地讲,涉及一种高精度的电力参数软件同步采样方法。The invention belongs to the technical field of power parameter measurement, and more specifically relates to a high-precision power parameter software synchronous sampling method.
背景技术Background technique
现今社会,电力资源作为使用最为广泛的能源已广泛应用于生产及生活的各个领域。电力技术水平的发展程度是一个国家发展水平的重要衡量指标之一,随着科技的发展和工业化进程的加快,人们对电能质量的要求也越来也高。In today's society, power resources, as the most widely used energy source, have been widely used in various fields of production and life. The development level of electric power technology is one of the important indicators of a country's development level. With the development of science and technology and the acceleration of industrialization, people's requirements for power quality are also getting higher and higher.
电力参数的测量水平直接影响对电能质量的评估,在电力参数测量中一般用同步采样的方法,来实现谐波等一系列参数的计算。The measurement level of power parameters directly affects the evaluation of power quality. In the measurement of power parameters, the method of synchronous sampling is generally used to realize the calculation of a series of parameters such as harmonics.
电力参数同步采样的基本模型如图1所示,同步过程主要测频,然后通过倍频来确定采样率。然而工程实践中很难实现理想的同步采样,工程实践中常用的同步采样一般分为硬件同步采样和软件同步采样。The basic model of synchronous sampling of power parameters is shown in Figure 1. The synchronization process mainly measures the frequency, and then determines the sampling rate by multiplying the frequency. However, it is difficult to realize ideal synchronous sampling in engineering practice. The commonly used synchronous sampling in engineering practice is generally divided into hardware synchronous sampling and software synchronous sampling.
现如今,随着电子器件技术地发展,硬件同步技术得到一定的发展。硬件同步采样一般主要通过锁相环电路来跟踪电力信号频率,在通过硬件同步电路确定采样频率,直接通过硬件中断的方式来实现采样。但是如果电力信号受到干扰畸变比较严重,则锁相环电路则无法跟踪电力信号频率。并且硬件同步采样方法的硬件电路过于复杂且成本较高。Nowadays, with the development of electronic device technology, hardware synchronization technology has been developed to a certain extent. Hardware synchronous sampling generally tracks the power signal frequency mainly through a phase-locked loop circuit, and then determines the sampling frequency through a hardware synchronous circuit, and directly implements sampling through hardware interrupts. However, if the power signal is severely disturbed and distorted, the phase-locked loop circuit cannot track the frequency of the power signal. Moreover, the hardware circuit of the hardware synchronous sampling method is too complicated and the cost is high.
软件同步采样相对硬件同步方法相对灵活,但是用数字方法的同步误差很难消除。国内外对于这个问题的研究很多,提出如特殊窗函数法、补偿算法、修正算法等一系列的方法,但是这些方法处理起来十分复杂,一般会很大程度加大计算量,使得实时性大大降低,因而,并不能很好的应用在工程实践中。The software synchronous sampling is relatively flexible compared to the hardware synchronous method, but it is difficult to eliminate the synchronous error of the digital method. There are many studies on this problem at home and abroad, and a series of methods such as special window function method, compensation algorithm, and correction algorithm have been proposed. However, these methods are very complicated to deal with, and generally increase the amount of calculation to a large extent, which greatly reduces real-time performance. , therefore, it cannot be well applied in engineering practice.
发明内容Contents of the invention
本发明的目的在于克服现有技术的不足,提供一种高精度的电力参数软件同步采样方法,以提高软件同步采样精度、降低计算量以提高实时性。The purpose of the present invention is to overcome the deficiencies of the prior art, and provide a high-precision software synchronous sampling method for electric parameters, so as to improve the accuracy of software synchronous sampling, reduce the amount of calculation and improve real-time performance.
为实现以上目的,本发明高精度的电力参数软件同步采样方法,其特征在于,包括以下步骤:In order to achieve the above object, the high-precision power parameter software synchronous sampling method of the present invention is characterized in that, comprising the following steps:
(1)、对被测电力信号f)的周期进行测量,得到M+K次采样前的电力信号周期序列{Ti},i=1,2,…,M+K-1,由所得周期序列{Ti}利用滑动平均算法计算出K个算术平均值:(1) Measure the cycle of the measured power signal f), and obtain the cycle sequence {T i } of the power signal before M+K samples, i=1,2,...,M+K-1, from the obtained cycle The sequence {T i } uses the moving average algorithm to calculate K arithmetic mean values:
TT →&Right Arrow; 11 == TT 11 ++ TT 22 ++ ·&Center Dot; ·&Center Dot; ·&Center Dot; ++ TT Mm Mm
TT →&Right Arrow; 22 == TT 22 ++ TT 33 ++ ·&Center Dot; ·· ·&Center Dot; ++ TT Mm ++ 11 Mm
TT →&Right Arrow; KK == TT KK ++ TT KK ++ 11 ++ ·&Center Dot; ·&Center Dot; ·&Center Dot; ++ TT Mm ++ KK -- 11 Mm
其中,M为进行滑动平均的电力信号周期个数,这样得一个新周期序列k=1,2,…,K;Among them, M is the number of power signal cycles for sliding average, so a new cycle sequence k=1,2,...,K;
(2)、将所得新周期序列结合指数平滑算法确定M+K次采样的采样周期:(2), the obtained new periodic sequence Combining with the exponential smoothing algorithm to determine the sampling period of M+K samples:
TsTs KK == ΣΣ kk == 22 KK aa (( 11 -- aa )) KK -- kk TT →&Right Arrow; kk ++ (( 11 -- aa )) KK -- 11 TsTs 11
其中,a为系数;in, a is the coefficient;
系数a值选取依据输入已知标准正弦信号fs(t)的采样,按照步骤(1)、(2)的方法计算得到的前L采样周期分别与已知标准正弦信号fs(t)周期的平均绝对值误差即:The value of coefficient a is selected based on the sampling of the input known standard sinusoidal signal f s (t), and the first L sampling period calculated according to the method of steps (1) and (2) is respectively compared with the period of the known standard sinusoidal signal f s (t) The mean absolute value error of is:
确定,其中,Ts′K-j为根据标准正弦信号fs(t)的采样得到的采样周期,Ts为已知标准正弦信号fs(t)的周期; Determine, wherein, Ts' Kj is the sampling period obtained according to the sampling of standard sinusoidal signal f s (t), and T s is the period of known standard sinusoidal signal f s (t);
设定误差阈值、系数a范围及步进量,系数a以固定步进量递增通过将MAE值与误差阈值进行对比,找出满足MAE值小于误差阈值条件下的最小MAE值,此时相对应的a值即选取系数,选取过程如下:Set the error threshold, coefficient a range and step amount, and the coefficient a increases with a fixed step amount. By comparing the MAE value with the error threshold, find the minimum MAE value that satisfies the condition that the MAE value is less than the error threshold. At this time, the corresponding The value of a is the selection coefficient, and the selection process is as follows:
根据系统精度要求,选定误差阈值大小;在选定系数a取值范围内,系数a值从最小取值开始以固定步进量递增,每次以递增后的a值利用指数滑动平均同步对系统中输入已知标准正弦信号fs(t)进行连续采样L个周期后,利用MAE计算公式,进而可计算出与此时a值相对应的MAE值;按照固定步进量递增,不断计算a值相对应的MAE值直到系数a值递增超出系数a取值上限为止,在所得与a值相对应的MAE值中,找出满足MAE值小于误差阈值条件下的最小MAE值,与最小MAE值相对应的a值作为系数a值;According to the system accuracy requirements, select the size of the error threshold; within the value range of the selected coefficient a, the value of the coefficient a starts from the minimum value with a fixed step increment, and each time the incremented value of a is synchronized with the exponential moving average After inputting a known standard sinusoidal signal f s (t) into the system for continuous sampling for L cycles, the MAE calculation formula can be used to calculate the MAE value corresponding to the value of a at this time; it is calculated continuously according to the fixed step increment The MAE value corresponding to the value of a until the value of the coefficient a increases beyond the upper limit of the value of the coefficient a, in the obtained MAE value corresponding to the value of a, find the minimum MAE value that satisfies the condition that the MAE value is less than the error threshold, and the minimum MAE value The a value corresponding to the value is used as the coefficient a value;
(3)、对于M+K+1,M+K+2,…次采样的采样周期,采用其前被测电力信号f(t)的M+K-1电力信号周期,即序列{Ti},i=1,2,…,M+K-1进行步骤(1)、(2)处理得到TsK+1,TsK+2,…,构成采样周期序列{Tsk},然后,以时间间隔为tsk=Tsk/N对被测电力信号f(t)进行采样,其中,N为一个采样周期的采样点个数。(3) For the sampling period of M+K+1, M+K+2, ... times of sampling, the M+K-1 power signal period of the previously measured power signal f(t) is used, that is, the sequence {T i },i=1,2,...,M+K-1 to perform steps (1) and (2) to obtain Ts K+1 , Ts K+2 ,..., to form a sampling period sequence {Ts k }, and then, to The measured power signal f(t) is sampled at a time interval of ts k =Ts k /N, where N is the number of sampling points in one sampling period.
本发明的目的是这样实现的:The purpose of the present invention is achieved like this:
本发明高精度的电力参数软件同步采样方法,利用采样前的电力信号周期序列{Ti},i=1,2,…,M+K-1,利用滑动平均算法、指数平滑算法计算采样周期TsK用于采样,实现了软件的同步采样。本发明高精度的电力参数软件同步采样方法中以固定每个信号周期的采样点数为前提,根据多次测量所得周期值调整采样周期,使得采样周期实时地跟随被测电力信号周期变化而调整,由此测量得到的电力参数能最大限度地逼近真实值,提高同步采样精度;与硬件同步采样相比结构简单,成本相对较低;与传统软件同步采样方法相比具有计算量较少的优点,提高了实时性,对于频率变化缓慢的电力参数测量效果更明显。The high-precision power parameter software synchronous sampling method of the present invention uses the power signal cycle sequence {T i }, i=1,2,...,M+K-1 before sampling, and uses the sliding average algorithm and exponential smoothing algorithm to calculate the sampling period Ts K is used for sampling, realizing the synchronous sampling of the software. In the high-precision power parameter software synchronous sampling method of the present invention, the number of sampling points of each signal cycle is fixed as the premise, and the sampling cycle is adjusted according to the cycle value obtained by multiple measurements, so that the sampling cycle is adjusted in real time following the cycle change of the measured power signal, The power parameters obtained from this measurement can approach the real value to the greatest extent and improve the accuracy of synchronous sampling; compared with hardware synchronous sampling, the structure is simple and the cost is relatively low; compared with traditional software synchronous sampling methods, it has the advantage of less calculation. The real-time performance is improved, and the effect of measuring power parameters with slow frequency changes is more obvious.
附图说明Description of drawings
图1是同步采样基本原理图;Figure 1 is a schematic diagram of the basic principle of synchronous sampling;
图2是本发明高精度的电力参数软件同步采样方法的原理图;Fig. 2 is the schematic diagram of the high-precision power parameter software synchronous sampling method of the present invention;
图3是电力信号周期序列示意图;Fig. 3 is a schematic diagram of a power signal cycle sequence;
图4是电力参数软件同步采样误差产生的示意图;Fig. 4 is a schematic diagram of power parameter software synchronous sampling error generation;
图5是传统的软件同步采样过程示意图;Fig. 5 is a schematic diagram of a traditional software synchronous sampling process;
图6是本发明采用指数滑动平均的软件同步采样过程示意图;Fig. 6 is the schematic diagram of the software synchronous sampling process that the present invention adopts exponential moving average;
图7是采用MAE模型选取系数a值过程示意图;Fig. 7 is a schematic diagram of the process of selecting the value of coefficient a by using the MAE model;
图8是与现有软件同步采集方法的实验结果对比图。Fig. 8 is a comparison chart of the experimental results with the existing software synchronous acquisition method.
具体实施方式Detailed ways
下面结合附图对本发明的具体实施方式进行描述,以便本领域的技术人员更好地理解本发明。需要特别提醒注意的是,在以下的描述中,当已知功能和设计的详细描述也许会淡化本发明的主要内容时,这些描述在这里将被忽略。Specific embodiments of the present invention will be described below in conjunction with the accompanying drawings, so that those skilled in the art can better understand the present invention. It should be noted that in the following description, when detailed descriptions of known functions and designs may dilute the main content of the present invention, these descriptions will be omitted here.
图2是本发明高精度的电力参数软件同步采样方法的原理图。Fig. 2 is a principle diagram of the high-precision power parameter software synchronous sampling method of the present invention.
在本实施例中,如图2所示,本发明高精度的电力参数软件同步采样方法根据对被测电力信号f(t)进行采样得到的采样数据f(n),然后进行过零点检测,得到电力信号周期序列{Ti},如图3所示。In this embodiment, as shown in FIG. 2, the high-precision power parameter software synchronous sampling method of the present invention is based on the sampling data f(n) obtained by sampling the measured power signal f(t), and then performs zero-crossing detection, The power signal period sequence {T i } is obtained, as shown in Fig. 3 .
将周期序列{Ti}结合系数a进行本发明步骤(1)、(2)中的指数滑动平均,得到确定M+K次采样的采样周期TsK,M+K次采样以时间间隔为tsk=Tsk/N对被测电力信号f(t)进行采样,实现软件同步采样。Combining the periodic sequence {T i } with the coefficient a to carry out the exponential moving average in the steps (1) and (2) of the present invention, to obtain the sampling period Ts K for determining the M+K samples, and the time interval of the M+K samples is ts k =Ts k /N samples the measured power signal f(t) to realize software synchronous sampling.
采样之前,系数a结合MAE模型M+K次采样的前L采样周期与被测电力信号f)对应的L周期平均绝对值误差和,依据步骤(3)中的方法确定。Before sampling, the coefficient a is determined according to the method in step (3) in combination with the L cycle average absolute value error sum corresponding to the L cycle corresponding to the measured power signal f) between the first L sample cycles of the MAE model M+K samples.
图4是电力参数软件同步采样误差产生的示意图;Fig. 4 is a schematic diagram of power parameter software synchronous sampling error generation;
在本实施例中,如图4所示以被测电力信号以被测交流电压信号为例说明,令被测交流电压信号模型为:f(t)=Am sin(ωt),在其周期T内以时间间隔为ts=T/N采样N个点,设第1个采样点在时刻t1处,第N个采样点在时刻t2处。如图4,由于采样的不同步即t1+T≠t2,存在同步误差Δt=t2-(t1+T),此时采样时间间隔为:按此间隔对交流电压f(t)连续采样N个点,得到各个采样点对应电压幅值为:In this embodiment, as shown in Figure 4, the measured AC voltage signal is used as an example to illustrate the measured power signal, and the model of the measured AC voltage signal is: f(t)=A m sin(ωt), in its period In T, N points are sampled at a time interval of ts=T/N, assuming that the first sampling point is at time t1 , and the Nth sampling point is at time t2 . As shown in Figure 4, due to the asynchronous sampling, that is, t 1 +T≠t 2 , there is a synchronization error Δt=t 2 -(t 1 +T), and the sampling time interval at this time is: According to this interval, the AC voltage f(t) is continuously sampled at N points, and the voltage amplitude corresponding to each sampling point is obtained as:
f(n)=Amsin(ω*(ts*n+t1))(1)f(n)=A m sin(ω*(ts*n+t 1 ))(1)
式中:n=0,1,2…,N-1。In the formula: n=0,1,2...,N-1.
第一个采样点在t1处,在[t1,t2]区间上采样N点,可令θ1=ω*t1、θ2=ω*t2,式中ω=2π/T。则有ΔT=ω*Δt由离散傅立叶变换可得实测信号电压的实部:The first sampling point is at t 1 , and N points are sampled in the [t 1 , t 2 ] interval, so that θ 1 =ω*t 1 , θ 2 =ω*t 2 , where ω=2π/T. Then there is ΔT=ω*Δt and the real part of the measured signal voltage can be obtained by discrete Fourier transform:
ff RR == 22 NN ΣΣ nno == 00 NN -- 11 ff (( nno )) ** coscos (( ωtωt )) == 22 NN ΣΣ nno == 00 NN -- 11 AA mm sinsin (( ωω ** (( tsts ** nno ++ tt 11 )) )) ** coscos (( 22 ππ NN nno )) -- -- -- (( 22 ))
对于实部有: f R ≈ A m sin ( ΔT 2 + θ 1 ) { sin ( ΔT 2 ) N sin ( ΔT + 4 π 2 N ) + 1 } - - - ( 3 ) For the real part there are: f R ≈ A m sin ( ΔT 2 + θ 1 ) { sin ( ΔT 2 ) N sin ( ΔT + 4 π 2 N ) + 1 } - - - ( 3 )
同理虚部为: f I ≈ A m cos ( ΔT 2 + θ 1 ) { sin ( ΔT 2 ) N sin ( ΔT + 4 π 2 N ) + 1 } - - - ( 4 ) Similarly, the imaginary part is: f I ≈ A m cos ( ΔT 2 + θ 1 ) { sin ( ΔT 2 ) N sin ( ΔT + 4 π 2 N ) + 1 } - - - ( 4 )
则实测被测信号幅值为: f = f R 2 = f I 2 = A m | sin ( ΔT 2 ) N sin ( ΔT + 4 π 2 N ) + 1 | - - - ( 5 ) Then the measured signal amplitude is: f = f R 2 = f I 2 = A m | sin ( ΔT 2 ) N sin ( ΔT + 4 π 2 N ) + 1 | - - - ( 5 )
公式(5)即为本发明应用的幅值误差模型,可知,当AT≠0时,采样所得信号电压幅值f与被测交流电压信号幅值Am存在误差。Formula (5) is the amplitude error model applied in the present invention. It can be seen that when AT≠0, there is an error between the sampled signal voltage amplitude f and the measured AC voltage signal amplitude A m .
图5是传统的软件同步采样过程示意图。FIG. 5 is a schematic diagram of a traditional software synchronous sampling process.
对于传统的软件同步采样被测交流电压信号,其采样周期通常是由上一次测量所得周期值确定。如图5所示,传统软件同步采样的第k个采样周期的采样时间间隔由第k-1次测量所得周期值确定,将测量所得周期值构成一个周期序列因为同步误差的存在,使得每次实际采样点与理想采样点有一定的偏移,导致电力参数测量精度较低。For the traditional software synchronously sampling the measured AC voltage signal, its sampling period is usually determined by the period value obtained from the last measurement. As shown in Figure 5, the sampling time interval of the k-th sampling period of traditional software synchronous sampling is determined by the period value obtained from the k-1th measurement OK, the measured periodic values form a periodic sequence Due to the existence of synchronization error, each actual sampling point has a certain deviation from the ideal sampling point, resulting in low power parameter measurement accuracy.
图6是本发明采用指数滑动平均的软件同步采样过程示意图。Fig. 6 is a schematic diagram of the software synchronous sampling process using exponential moving average in the present invention.
针对现有软件同步采样导致电力参数测量精度较低的问题,如图6所示,本发明采用指数滑动平均来得到下一次采样的采样周期,以此减小由非同步采样产生的误差,从而提高测量精度,指数滑动平均的软件同步采样过程如图6所示。Aiming at the problem of low power parameter measurement accuracy caused by synchronous sampling of existing software, as shown in Figure 6, the present invention uses exponential moving average to obtain the sampling period of the next sampling, thereby reducing the error generated by asynchronous sampling, thereby To improve measurement accuracy, the software synchronous sampling process of exponential moving average is shown in Figure 6.
应用本发明模型对被测交流电压信号采样,将测量所得周期值构成一个周期序列{Ti},由此序列利用本发明模型确定下一个采样周期。如图6中,本发明中对被测交流电压信号的第K+M次采样的采样周期TsK是由前K+M-1次测量所得周期构成的周期序列{Ti}利用指数滑动平均模型来确定的。相应的第K+M+1次采样的采样周期TsK+1的确定过程与第K+M次采样的采样周期TsK确定过程类似,以此类推,进行采样周期的计算。The model of the present invention is used to sample the measured AC voltage signal, and the measured period values form a period sequence {T i }, and the sequence uses the model of the present invention to determine the next sampling period. As shown in Figure 6, the sampling period Ts K of the K+M sampling of the AC voltage signal to be measured in the present invention is a periodic sequence {T i } formed by the period obtained from the previous K+M-1 measurements using exponential moving average model to determine. The corresponding determination process of the sampling period Ts K+1 of the K+M+1th sampling is similar to the determination process of the sampling period Ts K of the K+Mth sampling, and so on to calculate the sampling period.
利用本发明的方法确定的采样周期构成一个采样周期序列{Tsk},以此采样周期序列{Tsk}为基础,实时地对被测交流电压信号f(t)采样,进而改善了同步采样误差。同时,由以上本发明软件同步采样过程可看出,相比硬件同步采样本发明高精度的电力参数软件同步采样方法在结构上更简单、成本上更低。The sampling period determined by the method of the present invention constitutes a sampling period sequence {Ts k }, based on this sampling period sequence {Ts k }, the measured AC voltage signal f(t) is sampled in real time, thereby improving the synchronous sampling error. At the same time, it can be seen from the above software synchronous sampling process of the present invention that, compared with hardware synchronous sampling, the high-precision power parameter software synchronous sampling method of the present invention is simpler in structure and lower in cost.
被测交流电压信号f(t)具有平稳特性,本发明中基于具有平稳移动趋势的一次指数平滑模型为基础,提出本次发明的基本模型:对其进行递推拓展后得到本发明模型即指数滑动平均模型:The measured AC voltage signal f (t) has a steady characteristic, and based on a once-exponential smoothing model with a steady moving trend in the present invention, the basic model of this invention is proposed: After it is recursively expanded, the model of the present invention is obtained, namely the exponential moving average model:
TsTs KK == ΣΣ kk == 22 KK aa (( 11 -- aa )) KK -- kk TT →&Right Arrow; kk ++ (( 11 -- aa )) KK -- 11 TsTs 11 -- -- -- (( 66 ))
由于被测交流信号周期变化波动较小,长期变化不大,对于公式(6)中系数a取值选定在0.1~0.5范围内。多次采样过程之前利用本发明模型所得采样周期值与输入标准信号fs(t)=220*sin(100π*t)周期值Ts=20ms的平均绝对值误差作为依据选取系数a值。其选取过程如下图7所示。Since the periodic fluctuation of the measured AC signal is small and the long-term change is not large, the value of the coefficient a in the formula (6) is selected within the range of 0.1~0.5. Before the multi-sampling process, the average absolute value error between the sampling period value obtained by the model of the present invention and the input standard signal fs (t)=220*sin(100π*t) period value Ts =20ms is used as a basis to select the coefficient a value. The selection process is shown in Figure 7 below.
图7是采用MAE模型选取系数a值过程示意图;Fig. 7 is a schematic diagram of the process of selecting the value of coefficient a by using the MAE model;
本发明根据测量精度要求选取误差阈值为0.05ms、L=3;系数a取值范围0.1~0.5则步进递增起始a值为0.1,步进量为0.05。由图7所示,将本发明模型所得采样周期值Tsk,结合平均绝对值误差模型(MAE模型)选取系数a值。以固定步进递增后的a值利用指数滑动平均同步对系统中输入已知标准信号进行连续采样3个周期后,利用MAE计算公式,进而可计算出与此时a值相对应的MAE值;递增a值后同理可得到相应MAE值;当递增a值大于系数a值上限0.5后,在所得与a值相对应的MAE值中,找出满足MAE值小于0.05ms条件下的最小MAE值0.025ms,与最小MAE值相对应的a值0.2为本次系数a值选取结果,本次选取后系数a取0.2。The present invention selects an error threshold of 0.05ms and L=3 according to the measurement accuracy requirements; the value range of the coefficient a is 0.1~0.5, the initial value of a is 0.1, and the stepping amount is 0.05. As shown in Figure 7, the sampling period value Ts k obtained by the model of the present invention is combined with the mean absolute value error model (MAE model) Select the coefficient a value. Using the exponential moving average synchronously to continuously sample the known standard signal in the system for 3 cycles with the a value incremented by a fixed step, the MAE value corresponding to the a value at this time can be calculated by using the MAE calculation formula; After incrementing the value of a, the corresponding MAE value can be obtained in the same way; when the incrementing value of a is greater than the upper limit of the coefficient a value of 0.5, find the minimum MAE value that satisfies the condition that the MAE value is less than 0.05ms among the obtained MAE values corresponding to the a value 0.025ms, the a value of 0.2 corresponding to the minimum MAE value is the selection result of the coefficient a value this time, and the coefficient a takes 0.2 after this selection.
在本实施例中,滑动平均的电力信号周期个数M=3,Ts1为前三次测量被测交流电压信号所得周期值的算术平均值确定,在本实施例中,采样过程中被测交流电压信号f(t)周期T1=20.3452ms、T2=20.3633ms、T3=19.9754ms计算这三个的算术平均值可得初值Ts1=(T1+T2+T3)/3=20.2280ms。In this embodiment, the number of cycles of the moving average power signal is M=3, and Ts1 is determined by the arithmetic mean value of the cycle value obtained by measuring the AC voltage signal for the first three times. In this embodiment, the AC voltage signal measured during the sampling process Voltage signal f(t) period T 1 =20.3452ms, T 2 =20.3633ms, T 3 =19.9754ms Calculate the arithmetic mean of these three to get the initial value Ts 1 = (T 1 +T 2 +T 3 )/ 3=20.2280ms.
调整系数a值和初值Ts1后,由公式(6)得M+K次采样的采样周期为:After adjusting the value of coefficient a and the initial value Ts 1 , the sampling period of M+K samples can be obtained from the formula (6):
TsTs KK == ΣΣ kk == 22 KK 0.20.2 (( 11 -- 0.20.2 )) KK -- kk TT →&Right Arrow; kk ++ (( 11 -- 0.20.2 )) KK -- 11 20.228020.2280 ;;
以此类推,进行采样周期的计算得到一个采样周期序列{Tsk},以此采样周期序列{Tsk}为基础,确定单个采样周期采样点数N=128,本发明以采样时间间隔tsk=Tsk/N对被测交流电压信号f(t)采样,可得到相应的离散被测信号电压幅值f(n)。By analogy, the calculation of the sampling period obtains a sampling period sequence {Ts k }, based on this sampling period sequence {Ts k }, the number of sampling points N=128 for a single sampling period is determined, and the present invention takes the sampling time interval ts k = Ts k /N samples the measured AC voltage signal f(t), and the corresponding discrete measured signal voltage amplitude f(n) can be obtained.
传统同步采样测量被测交流电压信号所得的采样周期序列为其同步误差绝对值为应用本发明模型采样所得的采样周期序列为{Tsk},其同步误差绝对值为: | Δts k | = | Ts k - T | = | a * T k → + ( 1 - a ) * Ts k - 1 - T | , 式中T为被测交流电压信号周期。根据选取后系数a值可有结合公式(5)的幅值误差模型可知当采样点数N不变,采样所得信号电压幅值大小可以很好的逼近实际值电压幅值Am,相比传统软件同步采样应用本发明模型后测量精度有所提高。The sampling cycle sequence obtained by traditional synchronous sampling measurement of the measured AC voltage signal is The absolute value of the synchronization error is The sampling period sequence obtained by applying the model sampling of the present invention is {Ts k }, and its absolute value of synchronization error is: | Δts k | = | Ts k - T | = | a * T k &Right Arrow; + ( 1 - a ) * Ts k - 1 - T | , In the formula, T is the period of the measured AC voltage signal. According to the selected coefficient a value can have Combined with the amplitude error model of formula (5), it can be seen that when the number of sampling points N is constant, the amplitude of the signal voltage obtained by sampling can well approach the actual voltage amplitude A m . Accuracy has been improved.
由以上本发明实施过程对比现有方法如特殊窗函数法,计算量方面大大降低。特殊窗函数法是基于余弦窗的组合窗函数,其一般表达式为:Compared with existing methods such as the special window function method, the amount of calculation is greatly reduced in the implementation process of the present invention. The special window function method is a combined window function based on the cosine window, and its general expression is:
ww (( nno )) == 11 NN ΣΣ hh == 00 Hh aa hh coscos (( 22 πnhπnh NN )) -- -- -- (( 77 ))
式中:n=0,1,2…,N-1。与公式(6)对比可以看出本发明模型相比特殊窗函数法计算量上得到相应的减少。In the formula: n=0,1,2...,N-1. Compared with the formula (6), it can be seen that the calculation amount of the model of the present invention is correspondingly reduced compared with the special window function method.
实验结果Experimental results
在本实验中,被测交流电压信号为f(t)=220*sin(2π*50*t),图8中横坐标表示采样周期个数;纵坐标表示测量所得信号电压幅值f与被测信号幅值的绝对值误差|f-Am|。虚线曲线为传统采样的误差曲线,实线曲线为采用指数滑动平均法后的误差曲线。In this experiment, the measured AC voltage signal is f(t)=220*sin(2π*50*t), the abscissa in Figure 8 represents the number of sampling cycles; the ordinate represents the measured signal voltage amplitude f and the measured The absolute value error |fA m | of the measured signal amplitude. The dotted line curve is the error curve of traditional sampling, and the solid line curve is the error curve after using the exponential moving average method.
图8是与现有软件同步采集方法的实验结果对比图。Fig. 8 is a comparison chart of the experimental results with the existing software synchronous acquisition method.
图8中对比于传统软件同步采样,应用本发明方法后幅值绝对值误差曲线能更接近0,基本能将幅值绝对值误差减少50%左右。当传统绝对值误差较小时,应用本发明方法后的误差也比较小;特别在传统软件同步采样误差较大时,本发明方法的优势更明显。由此相比于传统的软件同步采样,引入本发明同步采样后的绝对值误差得到了相当大的改善,提高了测量精度;并且参照以上具体实施过程中相比现有软件同步采样方法,计算量较少,实现简单。In Fig. 8, compared with the traditional software synchronous sampling, the amplitude absolute value error curve can be closer to 0 after applying the method of the present invention, and the amplitude absolute value error can basically be reduced by about 50%. When the traditional absolute value error is small, the error after applying the method of the present invention is also relatively small; especially when the traditional software synchronous sampling error is large, the advantage of the method of the present invention is more obvious. Compared with the traditional software synchronous sampling, the absolute value error introduced after the synchronous sampling of the present invention has been greatly improved, which improves the measurement accuracy; and compared with the existing software synchronous sampling method in the above specific implementation process, calculate The amount is small and the implementation is simple.
尽管上面对本发明说明性的具体实施方式进行了描述,以便于本技术领域的技术人员理解本发明,但应该清楚,本发明不限于具体实施方式的范围,对本技术领域的普通技术人员来讲,只要各种变化在所附的权利要求限定和确定的本发明的精神和范围内,这些变化是显而易见的,一切利用本发明构思的发明创造均在保护之列。Although the illustrative specific embodiments of the present invention have been described above, so that those skilled in the art can understand the present invention, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art, As long as various changes are within the spirit and scope of the present invention defined and determined by the appended claims, these changes are obvious, and all inventions and creations using the concept of the present invention are included in the protection list.
Claims (2)
1. A high-precision power parameter software synchronous sampling method is characterized by comprising the following steps:
(1) measuring the period of the measured power signal f (T) to obtain a power signal period sequence { T) before M + K times of samplingi1,2, …, M + K-1, from the resulting periodic sequence { T }iCalculating K arithmetic mean values by using a moving average algorithm:
<math> <mrow> <mover> <msub> <mi>T</mi> <mn>1</mn> </msub> <mo>→</mo> </mover> <mo>=</mo> <mfrac> <mrow> <msub> <mi>T</mi> <mn>1</mn> </msub> <mo>+</mo> <msub> <mi>T</mi> <mn>2</mn> </msub> <mo>+</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mo>+</mo> <msub> <mi>T</mi> <mi>M</mi> </msub> </mrow> <mi>M</mi> </mfrac> </mrow> </math>
<math> <mrow> <mover> <msub> <mi>T</mi> <mn>2</mn> </msub> <mo>→</mo> </mover> <mo>=</mo> <mfrac> <mrow> <msub> <mi>T</mi> <mn>2</mn> </msub> <mo>+</mo> <msub> <mi>T</mi> <mn>3</mn> </msub> <mo>+</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mo>+</mo> <msub> <mi>T</mi> <mrow> <mi>M</mi> <mo>+</mo> <mn>1</mn> </mrow> </msub> </mrow> <mi>M</mi> </mfrac> </mrow> </math>
……
<math> <mrow> <mover> <msub> <mi>T</mi> <mi>K</mi> </msub> <mo>→</mo> </mover> <mo>=</mo> <mfrac> <mrow> <msub> <mi>T</mi> <mi>K</mi> </msub> <mo>+</mo> <msub> <mi>T</mi> <mrow> <mi>K</mi> <mo>+</mo> <mn>1</mn> </mrow> </msub> <mo>+</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mo>+</mo> <msub> <mi>T</mi> <mrow> <mi>M</mi> <mo>+</mo> <mi>K</mi> <mo>-</mo> <mn>1</mn> </mrow> </msub> </mrow> <mi>M</mi> </mfrac> </mrow> </math>
wherein M is the number of cycles of the power signal for performing the moving average, so as to obtain a new cycle sequence
<math> <mrow> <mo>{</mo> <mover> <msub> <mi>T</mi> <mi>k</mi> </msub> <mo>→</mo> </mover> <mo>}</mo> <mo>,</mo> <mi>k</mi> <mo>=</mo> <mn>1,2</mn> <mo>,</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mo>,</mo> <mi>K</mi> <mo>;</mo> </mrow> </math>(2) The new periodic sequence obtainedDetermining the sampling period of the M + K times of sampling by combining an exponential smoothing algorithm:
<math> <mrow> <msub> <mi>Ts</mi> <mi>K</mi> </msub> <mo>=</mo> <munderover> <mi>Σ</mi> <mrow> <mi>k</mi> <mo>=</mo> <mn>2</mn> </mrow> <mi>K</mi> </munderover> <mi>a</mi> <msup> <mrow> <mo>(</mo> <mn>1</mn> <mo>-</mo> <mi>a</mi> <mo>)</mo> </mrow> <mrow> <mi>K</mi> <mo>-</mo> <mi>k</mi> </mrow> </msup> <mover> <msub> <mi>T</mi> <mi>k</mi> </msub> <mo>→</mo> </mover> <mo>+</mo> <msup> <mrow> <mo>(</mo> <mn>1</mn> <mo>-</mo> <mi>a</mi> <mo>)</mo> </mrow> <mrow> <mi>K</mi> <mo>-</mo> <mn>1</mn> </mrow> </msup> <msub> <mi>Ts</mi> <mn>1</mn> </msub> </mrow> </math>
wherein,a is a coefficient;
the value of the coefficient a is selected according to an input known standard sinusoidal signal fs(t) sampling, and calculating to obtain a front L sampling period Ts 'according to the methods in the steps (1) and (2)'K-jRespectively with known standard sinusoidal signals fs(T) period TsThe average absolute value error of (a) is:
determining;
setting an error threshold, a coefficient a range and a stepping amount, wherein the coefficient a is increased by a fixed stepping amount, and the minimum MAE value meeting the condition that the MAE value is smaller than the error threshold is found by comparing the MAE value with the error threshold, and the coefficient is selected according to the corresponding a value at the moment, wherein the selection process comprises the following steps:
selecting the size of an error threshold according to the precision requirement of the system; in the value range of the selected coefficient a, the value of the coefficient a is increased by a fixed stepping amount from the minimum value, and the known standard sinusoidal signal f is input into the system by the increased value a each time by utilizing exponential moving average synchronizations(t) after continuous sampling is carried out for L periods, an MAE calculation formula is utilized, and then an MAE value corresponding to the value a at the moment can be calculated; increasing according to a fixed step amount, continuously calculating the MAE value corresponding to the value a until the value a of the coefficient is increased and exceeds the upper limit of the value a of the coefficient, and finding out the minimum MAE value meeting the condition that the MAE value is smaller than the error threshold value from the MAE values corresponding to the value aThe value a corresponding to the minimum MAE value is used as the coefficient value a;
(3) and for the sampling period of M + K +1, M + K +2 and … times of sampling, adopting the period of M + K-1 power signal of the previous measured power signal f (T), namely the sequence { T }iProcessing the obtained product by the steps (1) and (2) to obtain Ts, wherein i is 1,2, …, and M + K-1K+1,TsK+2…, constituting a sequence of sampling periods { Ts }kAt time intervals tsk=Tskand/N, sampling the measured power signal f (t), wherein N is the number of sampling points in one sampling period.
2. The synchronous sampling method according to claim 1, wherein the measured power signal is measured as an alternating voltage signal, the coefficient a ranges from 0.1 to 0.5, the step size of the coefficient a is 0.05, L is 3, and the error threshold is 0.05 ms.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210567750.8A CN103018555B (en) | 2012-12-24 | 2012-12-24 | High-precision electric power parameter software synchronous sampling method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210567750.8A CN103018555B (en) | 2012-12-24 | 2012-12-24 | High-precision electric power parameter software synchronous sampling method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103018555A CN103018555A (en) | 2013-04-03 |
CN103018555B true CN103018555B (en) | 2014-11-05 |
Family
ID=47967389
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210567750.8A Expired - Fee Related CN103018555B (en) | 2012-12-24 | 2012-12-24 | High-precision electric power parameter software synchronous sampling method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103018555B (en) |
Families Citing this family (8)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104076201B (en) * | 2014-07-15 | 2017-01-11 | 国家电网公司 | Method for measuring transient frequency of transformer substation busbar voltage without being affected by aperiodic noise |
CN104391464B (en) * | 2014-11-06 | 2017-04-05 | 电子科技大学 | A kind of hardware equivalent synchronized sampling unit based on FPGA |
CN104614586B (en) * | 2015-01-13 | 2019-01-18 | 上海惠安系统控制有限公司 | A kind of electrical quantity signal adaptive method of sampling based on GPS |
CN104678265A (en) * | 2015-01-30 | 2015-06-03 | 广东雅达电子股份有限公司 | Detection device and detection method for series arc faults |
CN106372369B (en) * | 2016-10-08 | 2019-07-19 | 国家电网公司 | Instantaneous Calculation Method for Inverter Output DC Component and Harmonic Component Detection |
CN106802367B (en) * | 2017-01-17 | 2019-09-24 | 基康仪器股份有限公司 | Vibrating string type sensor signal period measurement method and device based on overlapping grouping |
CN107942139B (en) * | 2017-12-28 | 2020-03-17 | 哈尔滨工业大学 | Synchronous sampling method for power harmonic parameter software |
CN108614148A (en) * | 2018-03-30 | 2018-10-02 | 国网江西省电力有限公司电力科学研究 | A kind of alternating current, voltage synchronous sampling system and its method of sampling |
Citations (1)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101593424A (en) * | 2009-07-10 | 2009-12-02 | 浙江大学 | An Intelligent Combined Forecasting Method for Short-term Traffic Flow |
-
2012
- 2012-12-24 CN CN201210567750.8A patent/CN103018555B/en not_active Expired - Fee Related
Patent Citations (1)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101593424A (en) * | 2009-07-10 | 2009-12-02 | 浙江大学 | An Intelligent Combined Forecasting Method for Short-term Traffic Flow |
Non-Patent Citations (2)
* Cited by examiner, † Cited by third partyTitle |
---|
电缆故障在线测距中高速同步采集卡精确时标获取方法;陈玉林等;《电力自动化设备》;20061031;第26卷(第10期);35-38页 * |
陈玉林等.电缆故障在线测距中高速同步采集卡精确时标获取方法.《电力自动化设备》.2006,第26卷(第10期), * |
Also Published As
Publication number | Publication date |
---|---|
CN103018555A (en) | 2013-04-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103018555B (en) | 2014-11-05 | High-precision electric power parameter software synchronous sampling method |
CN102435844B (en) | 2013-11-27 | Sinusoidal signal phasor calculating method being independent of frequency |
CN101806832B (en) | 2012-07-04 | Measuring method for frequencies of low-frequency signals |
CN101833036B (en) | 2012-09-26 | Method for measuring instantaneous phase of alternating current |
CN102095934B (en) | 2012-11-28 | Measuring method for phase difference of alternating current signals |
CN105137180B (en) | 2018-05-08 | High-precision harmonic analysis method based on six four spectral line interpolations of Cosine Window |
CN102818930B (en) | 2015-03-04 | Method for quickly calculating power harmonic parameters in high-accuracy mode |
CN106918741A (en) | 2017-07-04 | It is applied to the adaptively sampled phase difference correction method of frequency wide swings power network |
CN102508026B (en) | 2014-08-06 | Harmonic wave analysis method for electric energy quality harmonic wave analyzer |
CN102243272A (en) | 2011-11-16 | High-precision harmonic analysis method of sampling data synchronization |
CN104181391A (en) | 2014-12-03 | Harmonic detection method of digital power meter |
CN102095929A (en) | 2011-06-15 | Method for rapidly measuring frequency of alternating-current signals |
CN108918961B (en) | 2020-08-04 | Rapid frequency measurement method for frequency-time-varying sinusoidal signal |
CN102495285B (en) | 2013-08-21 | Method for estimating power harmonic wave parameter by using power gravity center of symmetric window function |
CN102095935A (en) | 2011-06-15 | Method for measuring instantaneous phase of alternating current electrical signal |
CN103575979A (en) | 2014-02-12 | Method for digital measuring of alternating current frequency |
CN102778606B (en) | 2014-11-19 | A Digital Measuring Method of Instantaneous Phase of Alternating Current |
CN102928666B (en) | 2014-08-13 | Digital measurement method for phase difference of alternating current |
CN104076203A (en) | 2014-10-01 | Ultralow-frequency inter-harmonic detection method with negative frequency influence considered |
CN103575981A (en) | 2014-02-12 | Method for accurately measuring alternating current frequency |
CN102346219A (en) | 2012-02-08 | Method for detecting phases of access point voltages of voltage source inverter by using three-phase software phase-locked loop |
CN105738698B (en) | 2018-08-14 | A kind of harmonic parameters algorithm for estimating based on centre frequency shift |
CN104808060A (en) | 2015-07-29 | Method for digitally measuring the phase difference of electrical signals |
CN102095936A (en) | 2011-06-15 | Method for measuring phase difference of alternating-current electric signals quickly |
CN104914308B (en) | 2017-12-15 | A kind of signal phase measuring method based on two DFT plural number spectral lines |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
2013-04-03 | C06 | Publication | |
2013-04-03 | PB01 | Publication | |
2013-05-01 | C10 | Entry into substantive examination | |
2013-05-01 | SE01 | Entry into force of request for substantive examination | |
2014-11-05 | C14 | Grant of patent or utility model | |
2014-11-05 | GR01 | Patent grant | |
2018-12-11 | CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20141105 Termination date: 20171224 |
2018-12-11 | CF01 | Termination of patent right due to non-payment of annual fee |