CN103344825B - Based on the electric energy metered system of AC sampling - Google Patents

Based on the electric energy metered system of AC sampling Download PDF

Info

Publication number
CN103344825B
CN103344825B CN201310284687.1A CN201310284687A CN103344825B CN 103344825 B CN103344825 B CN 103344825B CN 201310284687 A CN201310284687 A CN 201310284687A CN 103344825 B CN103344825 B CN 103344825B
Authority
CN
China
Prior art keywords
sampling
voltage
value
analog
current
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
CN201310284687.1A
Other languages
Chinese (zh)
Other versions
CN103344825A (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.)
SHENZHEN ARTEL TECHNOLOGY CO LTD
Original Assignee
SHENZHEN ARTEL TECHNOLOGY CO LTD
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 SHENZHEN ARTEL TECHNOLOGY CO LTD filed Critical SHENZHEN ARTEL TECHNOLOGY CO LTD
Priority to CN201310284687.1A priority Critical patent/CN103344825B/en
Publication of CN103344825A publication Critical patent/CN103344825A/en
Application granted granted Critical
Publication of CN103344825B publication Critical patent/CN103344825B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Measurement Of Current Or Voltage (AREA)

Abstract

一种基于交流采样的电能计量系统,其包括电压采样部分、用于对接入的来自电网的信号进行采样以获得电压模拟量采样值;电流采样部分;用于对接入的来自电网的信号进行采样以获得电流模拟量采样值;电压信号处理部分;对获得的电压模拟量采样值进行调理并偏置为预设阈值内的电压模拟量采样值;电流信号处理部分;对获得的电流模拟量采样值进行调理并偏置为预设阈值内的电流模拟量采样值;过零信号处理部分,接收来自电压采样部分的电压模拟量采样值,对电压模拟量采样值进行过零比较和整形滤波,获得过零脉冲信号送给处理器部分电压过零检测;还包括带模数转换器的基于ARM的处理器部分。该基于交流采样的电能计量系统的优势之一在于响应时间短。

An electric energy metering system based on AC sampling, which includes a voltage sampling part, which is used to sample the signal from the grid connected to obtain a voltage analog sampling value; a current sampling part; Sampling to obtain the current analog sampling value; voltage signal processing part; conditioning and biasing the obtained voltage analog sampling value to the voltage analog sampling value within the preset threshold; current signal processing part; The sampling value of the voltage is adjusted and biased to the current analog sampling value within the preset threshold; the zero-crossing signal processing part receives the voltage analog sampling value from the voltage sampling part, and performs zero-crossing comparison and shaping on the voltage analog sampling value Filter to obtain the zero-crossing pulse signal and send it to the processor part for voltage zero-crossing detection; it also includes an ARM-based processor part with an analog-to-digital converter. One of the advantages of this AC sampling based energy metering system is the short response time.

Description

基于交流采样的电能计量系统Electric Energy Metering System Based on AC Sampling

技术领域technical field

本实用新型属于电能计量采样系统,具体的讲,属于基于交流采样的电能计量系统。The utility model belongs to an electric energy metering and sampling system, in particular to an electric energy metering system based on AC sampling.

背景技术Background technique

随着电力系统自动化水平的日益提高,电力参数的获取和管理变得越来越重要。微机技术在电力系统中的普及应用,使电力系统的测量和监控技术得到了快速发展。从品种繁多的传统仪表获取电力参数已不能满足系统的要求,研制高精度、多参数、多功能、数字化的模块化电力仪表已成为当今的一个热门课题。With the increasing level of automation in power systems, the acquisition and management of power parameters is becoming more and more important. The popularization and application of microcomputer technology in the power system has made the measurement and monitoring technology of the power system develop rapidly. Obtaining power parameters from a wide variety of traditional instruments can no longer meet the requirements of the system, and developing high-precision, multi-parameter, multi-functional, digital modular power meters has become a hot topic today.

现有技术中通常采用电能计量芯片ADE7753作为电力侧控仪方案,ADE7753的推出对电能开发提供了便利,但作为电力测控仪方案,它存在着响应时间和谐波测量及成本方面存在着一定的局限性。In the prior art, the electric energy metering chip ADE7753 is usually used as the power side controller solution. The launch of the ADE7753 provides convenience for the development of electric energy, but as a power meter solution, it has certain limitations in response time, harmonic measurement and cost. limitation.

意法半导体推出STM32系列32位的CortexTM-M3内核的ARM是意法半导体公司在业界最先推出的基于ARMCortex-M3内核产品,继承了Cortex-M3内核的优良血统,同时增加了ST高性能的外设资源,FLASH、SRAM存储器,丰富的串行通信接口,如IIC、SPI、USART、CAN、USB等,以及12位的ADC和DAC模块,支持外部存储器访问的灵活的静态存储器控制器FSMC。其1M的采样速率,双ADC为实现交流同步采样提供基础。强大的外设功能形成一个稳定可靠的片上系统,具有良好性价比,开发出交流采样的电测量仪表平台。STMicroelectronics launched the STM32 series of 32-bit Cortex TM -M3 core ARM, which is the first ARM Cortex-M3 core product launched by STMicroelectronics in the industry. It inherits the excellent lineage of the Cortex-M3 core and adds ST high performance. Peripheral resources, FLASH, SRAM memory, rich serial communication interfaces, such as IIC, SPI, USART, CAN, USB, etc., and 12-bit ADC and DAC modules, flexible static memory controller FSMC that supports external memory access . Its 1M sampling rate and dual ADCs provide the basis for realizing AC synchronous sampling. Powerful peripheral functions form a stable and reliable system-on-chip with good cost performance, and develop an AC sampling electrical measuring instrument platform.

实用新型内容Utility model content

本实用新型旨在解决前述问题,提供一种基于交流采样的电能计量系统,其响应时间短。The utility model aims to solve the aforementioned problems, and provides an electric energy metering system based on AC sampling, which has a short response time.

本实用新型的一个方面提供了一种基于交流采样的电能计量系统,其包括One aspect of the utility model provides an electric energy metering system based on AC sampling, which includes

电压采样部分,用于对接入的来自电网的信号进行采样以获得电压模拟量采样值;The voltage sampling part is used to sample the connected signal from the power grid to obtain the sampled value of the voltage analog quantity;

电流采样部分,用于对接入的来自电网的信号进行采样以获得电流模拟量采样值;The current sampling part is used to sample the connected signal from the power grid to obtain the sampled value of the current analog quantity;

电压信号处理部分,对获得的电压模拟量采样值进行调理并偏置为预设阈值内的电压模拟量采样值;The voltage signal processing part adjusts the obtained voltage analog sampling value and biases it to the voltage analog sampling value within the preset threshold;

电流信号处理部分,对获得的电流模拟量采样值进行调理并偏置为预设阈值内的电流模拟量采样值;The current signal processing part adjusts the obtained current analog sampling value and biases it to the current analog sampling value within the preset threshold;

过零信号处理部分,接收来自电压采样部分的电压模拟量采样值,对电压模拟量采样值进行过零比较和整形滤波,获得过零脉冲信号送给处理器部分电压过零检测;The zero-crossing signal processing part receives the voltage analog sampling value from the voltage sampling part, performs zero-crossing comparison and shaping filtering on the voltage analog sampling value, and obtains a zero-crossing pulse signal and sends it to the processor part for voltage zero-crossing detection;

带模数转换器的基于ARM的处理器部分:包括电压采样值模数转换器、电流采样值模数转换器、过零中断部分以及参数运算部分;其中,电压采样值模数转换器用于由过零脉冲信号启动对来自电压信号处理部分的预设阈值内的电压模拟量采样值进行模数转换并将数字化的电压采样值保存在一电压值存储部;电流采样值模数转换器用于由过零脉冲信号启动对来自电流信号处理部分的预设阈值内的电流模拟量采样值进行模数转换并将数字化的电流采样值保存在一电流值存储部;该参数运算部分根据得到的数字化的电压采样值和数字化的电流采样值依据交流采样原理计算出针对该电网的电能计量参数。ARM-based processor part with analog-to-digital converter: including voltage sampling value analog-to-digital converter, current sampling value analog-to-digital converter, zero-crossing interrupt part and parameter operation part; among them, the voltage sampling value analog-to-digital converter is used by The zero-crossing pulse signal starts the analog-to-digital conversion of the voltage analog sample value within the preset threshold from the voltage signal processing part and saves the digitized voltage sample value in a voltage value storage unit; the current sample value analog-to-digital converter is used by The zero-crossing pulse signal starts the analog-to-digital conversion of the current analog sampling value within the preset threshold from the current signal processing part and saves the digitized current sampling value in a current value storage part; the parameter operation part is based on the obtained digital The voltage sampling value and the digitized current sampling value are used to calculate the electric energy metering parameters for the grid according to the AC sampling principle.

该电压采样部分还包括相位补偿部。The voltage sampling part also includes a phase compensating part.

该电流采样部分还包括相位补偿部。The current sampling part also includes a phase compensating part.

本实用新型的的基于ARM处理器的交流采样系统和方法,采用了ST公司的ARM处理器STM32F103RC,建立了交流数据采集的公共采样电路,软件算法平台,STM32的强大外设功能和处理速度,可以方便实现电力测控仪,多功能电能表,数字显示仪表及谐波仪表等电测量仪表开发,建立了标准化的采样模块,实现资源重用,提高了产品开发速度和开发质量。The AC sampling system and method based on the ARM processor of the present utility model adopts the ARM processor STM32F103RC of ST Company, establishes a public sampling circuit for AC data collection, a software algorithm platform, powerful peripheral functions and processing speed of STM32, It is convenient to realize the development of electrical measurement instruments such as electric power measurement and control instruments, multi-functional electric energy meters, digital display instruments and harmonic instruments. A standardized sampling module has been established to realize resource reuse and improve product development speed and development quality.

附图说明Description of drawings

图1为根据本实用新型的基于交流采样电能计量系统的原理框图;Fig. 1 is the functional block diagram based on AC sampling electric energy metering system according to the utility model;

图2为根据本实用新型的基于交流采样电能计量系统的电压采样部分和电压信号处理部分的一种实施例的电路图;Fig. 2 is a circuit diagram of an embodiment of a voltage sampling part and a voltage signal processing part of an AC sampling electric energy metering system according to the present invention;

图3为根据本实用新型的基于交流采样电能计量系统的电流采样部分和电流信号处理部分的一种实施例的电路图;Fig. 3 is a circuit diagram of an embodiment of the current sampling part and the current signal processing part of the electric energy metering system based on AC sampling according to the present invention;

图4为过零信号处理部分的一种实施例的电路图;Fig. 4 is the circuit diagram of a kind of embodiment of zero crossing signal processing part;

图5为根据本实用新型的基于交流采样电能计量方法的流程图。Fig. 5 is a flow chart of the electric energy metering method based on AC sampling according to the present invention.

图6为采样方法一实施例的流程图。Fig. 6 is a flowchart of an embodiment of a sampling method.

具体实施方式detailed description

本实用新型的交流采样系统的一种实施例如图1所示,其中,该交流采样系统的硬件包括电压采样部分、电流采样部分等采样电路;电压信号处理部分、电流信号处理部分、和过零信号处理部分等前端处理电路;以及带模数转换器的基于ARM的处理器部分(MCU),例如可以是意法半导体(TM)的STM32F103RC的处理器模块。An embodiment of the AC sampling system of the present utility model is shown in Figure 1, wherein the hardware of the AC sampling system includes sampling circuits such as a voltage sampling part and a current sampling part; a voltage signal processing part, a current signal processing part, and a zero crossing A front-end processing circuit such as a signal processing part; and an ARM-based processor part (MCU) with an analog-to-digital converter, such as a processor module of STM32F103RC of STMicroelectronics (TM).

电压采样可以通过电阻分压获取,如图2所示。其中,以A相电压采样为例,通过电阻R6、R9、R23、R11、R24、R25、R27、R28分压,信号经VREF偏置电压1.65VDC,在R24、R25获得信号变换处理后,再由滤波放大器U4-B滤波放大后,一路传送给处理器运算部分(MCU)的ADC1采样,另一路传给过零信号处理电路(图4)UA_PLUS经U1-B过零比较和整形滤波,获得UA-INT过零脉冲信号送给MCU的外部中断IO口,进行A相电压过零检测。Voltage sampling can be obtained through resistor division, as shown in Figure 2. Among them, taking phase A voltage sampling as an example, the voltage is divided by resistors R6, R9, R23, R11, R24, R25, R27, and R28, and the signal is biased by VREF at 1.65VDC. After the signal is converted and processed by R24, R25, then After being filtered and amplified by the filter amplifier U4-B, one path is sent to the ADC1 sampling of the processor operation part (MCU), and the other path is passed to the zero-crossing signal processing circuit (Figure 4). The UA-INT zero-crossing pulse signal is sent to the external interrupt IO port of the MCU to detect the zero-crossing of the A-phase voltage.

图3示出了针对某一相,例如A相,的电流采样部分和电流信号处理部分的一种实施例的电路图。其中,以A相电流为例,A相电流经电流互感器T2采样,再通过U4-A滤波放大后,传送给MCU的ADC2采样;Fig. 3 shows a circuit diagram of an embodiment of a current sampling part and a current signal processing part for a certain phase, such as phase A. Among them, taking the A-phase current as an example, the A-phase current is sampled by the current transformer T2, and then filtered and amplified by U4-A, and then sent to the ADC2 of the MCU for sampling;

上述以A相电流电压为例,对电压、电流的采样电路进行了描述,B、C相电流电压采样电路原理、实现可与A相完全一致,这里不再赘述。Taking the current and voltage of phase A as an example, the sampling circuit of voltage and current is described above. The principle and implementation of the current and voltage sampling circuits of phase B and C can be completely consistent with that of phase A, and will not be repeated here.

三相电压和三相电流经信号调理电路和1.65V基准偏置电路转换成为0V~1.65V~3.3V电压,分别送入ADC1和ADC2转换器,实现6路模拟信号同相采样与转换,确保了每相电压、电流检测是同相位,它的精度为12位;为消除互感器与电路所产生的相位延迟,可以在电路设计时提供相位补偿,如图2中的电容C10,如图3中的电容C14。Three-phase voltage and three-phase current are converted into 0V ~ 1.65V ~ 3.3V voltage by signal conditioning circuit and 1.65V reference bias circuit, and sent to ADC1 and ADC2 converters respectively to realize in-phase sampling and conversion of 6 analog signals, ensuring The voltage and current detection of each phase is in the same phase, and its accuracy is 12 bits; in order to eliminate the phase delay generated by the transformer and the circuit, phase compensation can be provided during circuit design, such as capacitor C10 in Figure 2, as shown in Figure 3 The capacitor C14.

得到的数据可经DMA队列存贮器转移,对CPU资源占用量少;电压信号经过零比较电路转换成方波送STM32外部中断输入口检测,获得交流信号的周期;The obtained data can be transferred through the DMA queue memory, which occupies less CPU resources; the voltage signal is converted into a square wave through the zero comparison circuit and sent to the STM32 external interrupt input port for detection, and the cycle of the AC signal is obtained;

STM32具有强大的外设和运算处理能力,很方便实现仪表实时测量、分析:U、I、P、Q、S、COSΦ、F、kWh、kvarh等电力参数。STM32 has powerful peripherals and computing processing capabilities, and it is very convenient to realize real-time measurement and analysis of instruments: U, I, P, Q, S, COSΦ, F, kWh, kvarh and other power parameters.

系统中STM32处理器运行程序完成:控制A/D数据采样、对采样结果进行FFT运算,根据交流采样原理结合系统的硬件参数计算电量中所有参数,将结果送入RAM备用。其流程如下图5所示。The STM32 processor in the system runs the program to complete: control A/D data sampling, perform FFT operation on the sampling results, calculate all parameters in the power according to the AC sampling principle combined with the system hardware parameters, and send the results to RAM for backup. The process is shown in Figure 5 below.

该方法包括:对接入的来自电网的信号进行采样以获得电压模拟量采样值;对接入的来自电网的信号进行采样以获得电流模拟量采样值;对获得的电压模拟量采样值进行调理并偏置为预设阈值内的电压模拟量采样值;对获得的电流模拟量采样值进行调理并偏置为预设阈值内的电流模拟量采样值;接收来自电压采样部分的电压模拟量采样值,对电压模拟量采样值进行过零比较和整形滤波,获得过零脉冲信号送给处理器部分电压过零检测;以及由过零脉冲信号启动对来自电压信号处理部分的预设阈值内的电压模拟量采样值进行模数转换并将数字化的电压采样值保存在一电压值存储部;由过零脉冲信号启动对来自电流信号处理部分的预设阈值内的电流模拟量采样值进行模数转换并将数字化的电流采样值保存在一电流值存储部;根据得到的数字化的电压采样值和数字化的电流采样值依据交流采样原理计算出针对该电网的电能计量参数。The method includes: sampling a signal from the grid connected to obtain a sampled value of a voltage analog quantity; sampling a signal connected to a grid from a power grid to obtain a sampled value of a current analog quantity; conditioning the obtained sampled value of a voltage analog quantity And offset to the sampling value of the voltage analog quantity within the preset threshold; adjust the obtained sampling value of the current analog quantity and bias it to the sampling value of the current analog quantity within the preset threshold; receive the sampling value of the voltage analog quantity from the voltage sampling part value, zero-crossing comparison and shaping filtering are performed on the sampled value of the voltage analog quantity, and the zero-crossing pulse signal is sent to the processor part for voltage zero-crossing detection; Perform analog-to-digital conversion on the sampled value of the voltage analog quantity and store the digitized voltage sampled value in a voltage value storage unit; start the analog-to-digital conversion of the current analog quantity sampled value within the preset threshold value from the current signal processing part by the zero-crossing pulse signal Converting and saving the digitized current sampling value in a current value storage unit; calculating the electric energy metering parameters for the power grid according to the obtained digitized voltage sampling value and digitized current sampling value according to the AC sampling principle.

其中,还包括消除电压采样过程中产生的相位差。Among them, it also includes eliminating the phase difference generated during the voltage sampling process.

其中,还包括消除电流采样过程中产生的相位差。Among them, it also includes eliminating the phase difference generated during the current sampling process.

其中,还包括对经过数字化的电压和电流采样值进行FFT。Among them, FFT is also performed on the digitized voltage and current sampling values.

其中,根据实时检测的电网的频率对电压、电流信号的采样频率实时地调整。Wherein, the sampling frequency of the voltage and current signals is adjusted in real time according to the frequency of the power grid detected in real time.

具体采样方法为,如图6所示:The specific sampling method is as shown in Figure 6:

首先,通过DMA1不断地将电压、电流的AD值放入一数组AD_Value[7]中S101,然后通过一个UA_INT外部过零中断找到一个启始点,在一个周期内通过一个定时器采128次,并将每一次采样的7个数据放到一个Tmp_AD_Value[128*7]的数组中,在一个周期内的第128次采样时同时启用DMA2将Tmp_AD_Value[128*7]的数组里的数据放到Cal_AD_Value[128*7]中,用于计算时用到,在DMA2完成中断中禁止DMA2且启动计算过程S103.First, continuously put the AD value of voltage and current into an array AD_Value[7] S101 through DMA1, then find a starting point through a UA_INT external zero-crossing interrupt, and collect 128 times through a timer in one cycle, and Put the 7 data of each sampling into an array of Tmp_AD_Value[128*7], and enable DMA2 at the same time at the 128th sampling in a cycle, and put the data in the array of Tmp_AD_Value[128*7] into Cal_AD_Value[ 128*7], used for calculation, disable DMA2 and start calculation process S103 in DMA2 completion interrupt.

其中,通过一个UA_INT外部过零中断找出周期时间T,则频率就是F=1/T;Among them, the cycle time T is found through a UA_INT external zero-crossing interrupt, and the frequency is F=1/T;

通过另一下外部中断UC-INT的过零中断找出UA与UC的相角;Find the phase angle between UA and UC through another zero-crossing interrupt of the external interrupt UC-INT;

通过另一下外部中断IA-INT的过零中断找出U与I的相角;Find the phase angle between U and I through another zero-crossing interrupt of the external interrupt IA-INT;

交流周期检测,电压转换成的方波信号送入STM32的外部硬件中断,在中断服务程序中读取定时器的计数值,转换成周期(频率),根据周期调整系统采样的周期。AC cycle detection, the square wave signal converted from the voltage is sent to the external hardware interrupt of STM32, the count value of the timer is read in the interrupt service program, converted into a cycle (frequency), and the cycle of system sampling is adjusted according to the cycle.

采用交流采样在硬件电路基础上,通过1-15公式非常方便获得U、I、P、Q、S、COSΦ、F、kWh、kvarh等电力参数Using AC sampling on the basis of hardware circuits, it is very convenient to obtain power parameters such as U, I, P, Q, S, COSΦ, F, kWh, kvarh through 1-15 formulas

交流采样是按一定规律对被测信号的瞬时值进行采样,再用一定的数值算法求得被测量的值,相对于经过直流整流后再进行采样测量的直流采样更精确。AC sampling is to sample the instantaneous value of the measured signal according to a certain rule, and then use a certain numerical algorithm to obtain the measured value, which is more accurate than DC sampling after DC rectification and then sampling measurement.

在本实用新型中,可以应用STM32F103RC为仪表智能核心部件,采用该芯片内部的A/D变换器作为数据采集器,对接入的电网中的电信号进行逐点瞬间采样,再由单片机计算出电压、电流有效值,有功功率,无功功率,视在功率,功率因数,信号频率,有功电能,无功电能及谐波分析等。In this utility model, the STM32F103RC can be used as the intelligent core component of the instrument, and the A/D converter inside the chip is used as the data collector to sample the electrical signals in the connected power grid moment by point, and then the single-chip computer calculates Voltage and current RMS, active power, reactive power, apparent power, power factor, signal frequency, active energy, reactive energy and harmonic analysis, etc.

其中,电压有效值的计算步骤如下:Among them, the calculation steps of the voltage effective value are as follows:

首先,将电压有效值公式First, the voltage rms formula

Uu == 11 TT ∫∫ 00 TT uu 22 (( tt )) dd tt -- -- -- (( 11 ))

离散化,以一个周期内有限个采样电压数字量来代替一个周期内连续变化的电压函数值,则得到Discretization, using a limited number of sampling voltage digital quantities in a cycle to replace the continuously changing voltage function value in a cycle, then we get

Uu cc ≈≈ 11 TT ΣΣ mm == 11 NN uu mm 22 ΔTΔT mm -- -- -- (( 22 ))

式中:ΔTm为相邻两次采样的时间间隔;um为第m-1个时间间隔的电压采样瞬时值;N为1个周期的采样点数。令相邻两采样的时间间隔相等,即ΔTm为常数ΔT,考虑到N=(T/ΔT)+1,则有In the formula: ΔTm is the time interval between two adjacent samples; u m is the instantaneous value of voltage sampling in the m-1th time interval; N is the number of sampling points in one cycle. Let the time intervals of two adjacent samples be equal, that is, ΔTm is a constant ΔT, considering N=(T/ΔT)+1, then we have

Uu cc == 11 NN -- 11 ΣΣ mm == 11 NN uu mm 22 -- -- -- (( 33 ))

式(3)就是根据一个周期各采样瞬时值及每周期采样点数计算电压信号有效值的公式。Equation (3) is the formula for calculating the effective value of the voltage signal according to the instantaneous value of each sampling in a cycle and the number of sampling points in each cycle.

同理,电流有效值计算公式如下:Similarly, the formula for calculating the effective value of the current is as follows:

II cc == 11 NN -- 11 ΣΣ mm == 11 NN ii mm 22 -- -- -- (( 44 ))

式(1)就是根据一个周期各采样瞬时值及每周期采样点数计算电压信号有效值的公式。Equation (1) is the formula for calculating the effective value of the voltage signal according to the instantaneous value of each sampling in one cycle and the number of sampling points per cycle.

计算某一相有功功率,功率的计算从连续周期信号有效值的定义和功率的定义出发,用数值积分近似代替连续积分。有功功率的计算公式如式(5)To calculate the active power of a certain phase, the calculation of the power starts from the definition of the effective value of the continuous periodic signal and the definition of the power, and the continuous integral is replaced by numerical integral approximation. The calculation formula of active power is as formula (5)

PP == 11 TT ∫∫ 00 TT ii uu dd tt -- -- -- (( 55 ))

离散化后为After discretization is

PP == 11 NN -- 11 ΣΣ mm == 11 NN ii mm uu mm -- -- -- (( 66 ))

式中:im、um为同一时刻的电流、电压采样值。In the formula: im and um are current and voltage sampling values at the same time.

视在功率:S=UIApparent power: S=UI

式中U,I为电压和电流的有效值;In the formula, U and I are the effective values of voltage and current;

功率因数可由下式求得:The power factor can be obtained by the following formula:

cosφ=P/S=P/UIcosφ=P/S=P/UI

计算无功功率有多种算法,采用数字移相法微机计算量较小,数据处理实时性好。因为有功功率P和无功功率Q仅在电压和电流相位上差90°,所以将无功功率写成There are many algorithms for calculating reactive power, and the digital phase-shifting method has a small amount of computer calculation, and the data processing has good real-time performance. Because the active power P and reactive power Q differ only by 90° in voltage and current phase, the reactive power is written as

QQ == 11 NN ΣΣ KK == 11 NN (( uu KK ×× ii (( KK ++ NN 44 )) )) -- -- -- (( 77 ))

式中i(k+N/4)表示第(k+N/4)次的电流采样值(移相90°后的采样值),当(k+N/4)大于N时,(k+N/4)取为(k-3N/4)。In the formula, i (k+N/4) represents the (k+N/4)th current sampling value (sampling value after phase shifting 90°), when (k+N/4) is greater than N, (k+ N/4) is taken as (k-3N/4).

在三相四线制中用三元法,离散后求功率的表达式如下:Using the three-element method in the three-phase four-wire system, the expression for calculating the power after the discretization is as follows:

PP == 11 NN ΣΣ KK == 11 NN (( uu Uu KK ×× ii Uu KK ++ uu VV KK ×× ii VV KK ++ uu WW KK ×× ii WW KK )) -- -- -- (( 88 ))

QQ == 11 NN ΣΣ KK == 11 NN (( uu Uu KK ×× ii Uu (( KK ++ NN 44 )) )) ++ uu VV KK ×× ii VV (( KK ++ NN 44 )) ++ uu WW KK ×× ii WW (( KK ++ NN 44 )) -- -- -- (( 99 ))

式中Uuk,Uvk,Uwk表示一个周期内三个相电压的第k次采样值;iUK,iVK,iWK表示一个周期内三个相电流的第k次采样值。In the formula, Uuk, Uvk, Uwk represent the k-th sampling value of the three phase voltages in one cycle; i UK , i VK , i WK represent the k-th sampling value of the three phase currents in one cycle.

在三相三线制中用两元法,离散化后求功率的公式如下:Using the two-element method in the three-phase three-wire system, the formula for calculating the power after discretization is as follows:

PP == 11 NN ΣΣ KK == 11 NN (( uu Uu VV KK ×× ii Uu KK ++ uu VV WW KK ×× ii WW KK )) -- -- -- (( 1010 ))

QQ == 11 NN ΣΣ KK == 11 NN (( uu Uu VV KK ×× ii Uu (( KK ++ NN 44 )) ++ uu VV WW KK ×× ii WW (( KK ++ NN 44 )) )) -- -- -- (( 1111 ))

式中uuvk,uvwk分别表示1个周期内两个线电压的第k次采样值。In the formula, u uvk and u vwk respectively represent the kth sampling value of the two line voltages in one cycle.

视在功率S及功率因数cosφ可以用以下公式求出:Apparent power S and power factor cosφ can be obtained by the following formula:

SS == PP 22 ++ QQ 22 -- -- -- (( 1212 ))

将有功功率和无功功率分别对时间积分就可以求出有功电能和无功电能。Active power and reactive power can be obtained by integrating active power and reactive power with respect to time respectively.

FFT运算:FFT operation:

电力输电线路中的电压和电流的余弦信号,受非线性负载的影响,电网的波形会发生畸变,畸变后仍然为周期函数,且满足狄里赫利条件,可以用傅立叶级数分解法把电压和电流分解成基波和一系列谐波的叠加,即The cosine signal of the voltage and current in the power transmission line is affected by the nonlinear load, and the waveform of the power grid will be distorted. After the distortion, it is still a periodic function and satisfies the Dirichli condition. Fourier series decomposition method can be used to decompose the voltage and the current is decomposed into the superposition of the fundamental wave and a series of harmonics, namely

uu (( tt )) == Uu 00 ++ ΣΣ nno == 11 ∞∞ Uu nno coscos (( nno ωω tt ++ αα nno )) -- -- -- (( 1414 ))

ii (( tt )) == II 00 ++ ΣΣ nno == 11 ∞∞ II nno cc oo sthe s (( nno ωω tt ++ ββ nno )) -- -- -- (( 1515 ))

式中U0、I0-电压、电流的直流分量;Where U 0 , I 0 - DC components of voltage and current;

Un、In-各次谐波幅度的峰值;αn、βn之差为谐波相位差。U n , I n - the peak value of each harmonic amplitude; the difference between α n and β n is the harmonic phase difference.

对电网的连续时间信号进行实时采样得到离散的采样序列,用FFT算法对其进行时频域转换,可以分析基波和各次谐波的幅度和相位情况,以实现谐波的监控。另外,电网中每一路的相电压和相电流之间存在相位差,对电压和电流信号同步采样并进行FFT变换,就可以算出各次谐波的相位差,准确地测出各次谐波的有功和无功功率。The continuous time signal of the power grid is sampled in real time to obtain a discrete sampling sequence, and the FFT algorithm is used to convert it to the time-frequency domain, and the amplitude and phase of the fundamental wave and each harmonic can be analyzed to realize harmonic monitoring. In addition, there is a phase difference between the phase voltage and phase current of each channel in the power grid. By synchronously sampling the voltage and current signals and performing FFT transformation, the phase difference of each harmonic can be calculated, and the phase difference of each harmonic can be accurately measured. Active and reactive power.

而对于FFT计算来说,如果采样数据集的端点不连续,就需要引入窗函数,从而增加了计算的繁琐程度。而在满足相关采样原理,采样的数据点集正好为整周期的情况下,采样数据集两端点连续,就可以把采样信号序列近似看成无穷的周期信号,从而使FFT计算量减少。For FFT calculation, if the endpoints of the sampling data set are discontinuous, a window function needs to be introduced, which increases the complexity of the calculation. However, when the relevant sampling principle is satisfied and the sampled data point set is exactly the entire period, the two ends of the sampled data set are continuous, and the sampled signal sequence can be approximately regarded as an infinite periodic signal, thereby reducing the amount of FFT calculation.

采样点数的确定:Determination of the number of sampling points:

根据时域取样定理本系统要求分析出63次谐波,因此在一个周期内最少的采样点数为78点,FFT蝶形算法本身要求采样点数为2的幂时,计算速度最快,装置的采样频率为基波频率的256倍。由于电网频率,会在50Hz左右上下波动,因此在硬件实现上,不可以用固定频率对电压、电流信号进行采样,而要根据电网的频率,实时地调整采样频率。According to the time domain sampling theorem This system requires the analysis of 63 harmonics, so the minimum number of sampling points in one cycle is 78 points. The FFT butterfly algorithm itself requires the number of sampling points to be a power of 2, the calculation speed is the fastest, and the sampling frequency of the device is the fundamental frequency. 256 times. Since the frequency of the power grid will fluctuate around 50Hz, in terms of hardware implementation, it is not possible to use a fixed frequency to sample voltage and current signals, but to adjust the sampling frequency in real time according to the frequency of the power grid.

本系统采用128点FFT算法,即在采样两个周期后完成一次FFT运算,其中有一个周期为上次采样的结果;完成一次128点FFT运算的时间约为0.5ms,因而能满足仪器在线检测与分析。This system adopts 128-point FFT algorithm, that is to complete an FFT operation after two sampling cycles, one of which is the result of the last sampling; the time to complete a 128-point FFT operation is about 0.5ms, so it can meet the online detection of the instrument and analyse.

交流电网的频率确定,确定的方法也比较多,本系统采用由硬件的方法来测量周期,即将交流电压经调理与整形以后送STM32F103RC进行定时,从而得到交流电网的频率;由于电网的频率变化具有较大的惯性,因而可以采用软件低通滤波器对所测量的数据进行处理。The frequency of the AC grid is determined, and there are many ways to determine it. This system uses the method of hardware to measure the period, that is, the AC voltage is conditioned and shaped and then sent to STM32F103RC for timing, so as to obtain the frequency of the AC grid; because the frequency of the grid has a Larger inertia, so the measured data can be processed by software low-pass filter.

Claims (6)

1.一种基于交流采样的电能计量系统,其特征在于:该系统包括1. An electric energy metering system based on AC sampling, characterized in that: the system includes 电压采样部分,用于对接入的来自电网的信号以可变的电压采样频率进行采样以获得电压模拟量采样值;The voltage sampling part is used to sample the connected signal from the power grid at a variable voltage sampling frequency to obtain the voltage analog sampling value; 电流采样部分,用于对接入的来自电网的信号以可变的电流采样频率进行采样以获得电流模拟量采样值;The current sampling part is used to sample the connected signal from the power grid at a variable current sampling frequency to obtain the current analog sampling value; 电压信号处理部分,对获得的电压模拟量采样值进行调理并偏置为预设阈值内的电压模拟量采样值;The voltage signal processing part adjusts the obtained voltage analog sampling value and biases it to the voltage analog sampling value within the preset threshold; 电流信号处理部分,对获得的电流模拟量采样值进行调理并偏置为预设阈值内的电流模拟量采样值;The current signal processing part adjusts the obtained current analog sampling value and biases it to the current analog sampling value within the preset threshold; 过零信号处理部分,接收来自电压采样部分的电压模拟量采样值,对电压模拟量采样值进行过零比较和整形滤波,获得过零脉冲信号送给处理器部分电压过零检测;以及The zero-crossing signal processing part receives the voltage analog sampled value from the voltage sampling part, performs zero-crossing comparison and shaping filtering on the voltage analog sampled value, obtains a zero-crossing pulse signal and sends it to the processor part for voltage zero-crossing detection; and 带模数转换器的基于ARM的处理器部分:包括电压采样值模数转换器、电流采样值模数转换器、过零中断部分以及参数运算部分;其中,电压采样值模数转换器用于由过零脉冲信号启动对来自电压信号处理部分的预设阈值内的电压模拟量采样值进行模数转换并将数字化的电压采样值保存在一电压值存储部;电流采样值模数转换器用于由过零脉冲信号启动对来自电流信号处理部分的预设阈值内的电流模拟量采样值进行模数转换并将数字化的电流采样值保存在一电流值存储部;该参数运算部分根据得到的数字化的电压采样值和数字化的电流采样值依据交流采样原理计算出针对该电网的电能计量参数。ARM-based processor part with analog-to-digital converter: including voltage sampling value analog-to-digital converter, current sampling value analog-to-digital converter, zero-crossing interrupt part and parameter operation part; among them, the voltage sampling value analog-to-digital converter is used by The zero-crossing pulse signal starts the analog-to-digital conversion of the voltage analog sample value within the preset threshold from the voltage signal processing part and saves the digitized voltage sample value in a voltage value storage unit; the current sample value analog-to-digital converter is used by The zero-crossing pulse signal starts the analog-to-digital conversion of the current analog sampling value within the preset threshold from the current signal processing part and saves the digitized current sampling value in a current value storage part; the parameter operation part is based on the obtained digital The voltage sampling value and the digitized current sampling value are used to calculate the electric energy metering parameters for the grid according to the AC sampling principle. 2.根据权利要求1的基于交流采样的电能计量系统,其特征在于:该电压采样部分还包括相位补偿部用于消除采样过程中产生的相位差。2. The electric energy metering system based on AC sampling according to claim 1, characterized in that: the voltage sampling part further comprises a phase compensation part for eliminating the phase difference generated during the sampling process. 3.根据权利要求1的基于交流采样的电能计量系统,其特征在于:该电流采样部分还包括相位补偿部用于消除采样过程中产生的相位差。3. The electric energy metering system based on AC sampling according to claim 1, characterized in that: the current sampling part further comprises a phase compensation part for eliminating the phase difference generated during the sampling process. 4.根据权利要求1的基于交流采样的电能计量系统,其特征在于:采样频率调整部,用于实时检测电网的频率,并根据测得的电网的频率对电压、电流的采样频率进行调整。4. The electric energy metering system based on AC sampling according to claim 1, characterized in that: the sampling frequency adjustment unit is used to detect the frequency of the power grid in real time, and adjust the sampling frequency of voltage and current according to the measured frequency of the power grid. 5.根据权利要求1的基于交流采样的电能计量系统,其特征在于:该存储部是RAM。5. The electric energy metering system based on AC sampling according to claim 1, characterized in that: the storage unit is RAM. 6.一种基于交流采样的电能计量方法,其特征在于:包括6. An electric energy metering method based on AC sampling, characterized in that: comprising 对接入的来自电网的信号以可变的电压采样频率进行采样以获得电压模拟量采样值;Sampling the connected signal from the power grid with a variable voltage sampling frequency to obtain the voltage analog sampling value; 对接入的来自电网的信号以可变的电流采样频率进行采样以获得电流模拟量采样值;Sampling the connected signal from the power grid at a variable current sampling frequency to obtain the sampling value of the current analog quantity; 对获得的电压模拟量采样值进行调理并偏置为预设阈值内的电压模拟量采样值;Conditioning and biasing the obtained voltage analog sampling value to a voltage analog sampling value within a preset threshold; 对获得的电流模拟量采样值进行调理并偏置为预设阈值内的电流模拟量采样值;Conditioning the obtained sampled value of the current analog quantity and biasing it to the sampled value of the current analog quantity within the preset threshold; 接收来自电压采样部分的电压模拟量采样值,对电压模拟量采样值进行过零比较和整形滤波,获得过零脉冲信号送给处理器部分电压过零检测;以及receiving the voltage analog sampling value from the voltage sampling part, performing zero-crossing comparison and shaping filtering on the voltage analog sampling value, and obtaining a zero-crossing pulse signal and sending it to the processor part for voltage zero-crossing detection; and 由过零脉冲信号启动对来自电压信号处理部分的预设阈值内的电压模拟量采样值进行模数转换并将数字化的电压采样值保存在一电压值存储部;The zero-crossing pulse signal starts to perform analog-to-digital conversion on the voltage analog sampling value within the preset threshold value from the voltage signal processing part, and saves the digitized voltage sampling value in a voltage value storage part; 由过零脉冲信号启动对来自电流信号处理部分的预设阈值内的电流模拟量采样值进行模数转换并将数字化的电流采样值保存在一电流值存储部;以及The zero-crossing pulse signal starts to perform analog-to-digital conversion on the current analog sample value within the preset threshold value from the current signal processing part and saves the digitized current sample value in a current value storage part; and 根据得到的数字化的电压采样值和数字化的电流采样值依据交流采样原理计算出针对该电网的电能计量参数。According to the obtained digitized voltage sampling value and digitized current sampling value, the electric energy metering parameters for the power grid are calculated according to the AC sampling principle.
CN201310284687.1A 2012-12-28 2013-07-08 Based on the electric energy metered system of AC sampling Expired - Fee Related CN103344825B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310284687.1A CN103344825B (en) 2012-12-28 2013-07-08 Based on the electric energy metered system of AC sampling

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN201220738856 2012-12-28
CN201220738856.5 2012-12-28
CN201310284687.1A CN103344825B (en) 2012-12-28 2013-07-08 Based on the electric energy metered system of AC sampling

Publications (2)

Publication Number Publication Date
CN103344825A CN103344825A (en) 2013-10-09
CN103344825B true CN103344825B (en) 2016-01-20

Family

ID=49279638

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310284687.1A Expired - Fee Related CN103344825B (en) 2012-12-28 2013-07-08 Based on the electric energy metered system of AC sampling

Country Status (1)

Country Link
CN (1) CN103344825B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103605030A (en) * 2013-11-28 2014-02-26 国家电网公司 Chip and method for measuring power quality
CN104502698B (en) * 2014-12-10 2017-07-14 广东电网有限责任公司电力科学研究院 The frequency measurement method and system of electric power signal
CN105652077A (en) * 2015-12-30 2016-06-08 天津诚电科技有限公司 Current testing instrument
CN107543956B (en) * 2016-06-24 2021-07-27 东方电气集团东方电机有限公司 Excitation system synchronization signal conditioning circuit and its realization method
CN106154032A (en) * 2016-07-25 2016-11-23 嘉兴清源电气科技有限公司 A kind of Bidirectional intelligent ammeter electric energy gauging method based on power factor
CN106053931B (en) * 2016-08-09 2019-04-26 河南森尼瑞电气有限公司 Protective relaying device based on 12 AD inside SOC chip
CN107233664B (en) * 2017-07-18 2020-03-10 南京仙能医疗科技有限公司 Electric needle treatment system based on acupuncture point impedance
CN108761193A (en) * 2018-06-04 2018-11-06 江苏师范大学 Quick self-adapted electric parameter metering without phase difference sensor and computational methods
CN109142868A (en) * 2018-08-10 2019-01-04 上海电机学院 Electric harmonic detector
CN109358229B (en) * 2018-09-28 2023-09-12 深圳市中电电力技术股份有限公司 Power self-adaptive calculation method, system and storage medium
CN109596914A (en) * 2018-11-26 2019-04-09 中国电子产品可靠性与环境试验研究所((工业和信息化部电子第五研究所)(中国赛宝实验室)) Electronic component test method, device, system and storage medium
CN109828145A (en) * 2018-12-30 2019-05-31 南京传麒信息技术合伙企业(普通合伙) A kind of wide scope adaptive voltage monitoring device and method
CN111239482A (en) * 2020-03-04 2020-06-05 惠州化能汇通智能科技有限公司 Electric energy metering system and implementation method thereof
CN114089028A (en) * 2021-11-16 2022-02-25 宁波迦南智能电气股份有限公司 Alternating current sampling plate with harmonic detection function
CN114254864A (en) * 2021-11-18 2022-03-29 深圳供电局有限公司 Power utilization data processing method and device, computer equipment and storage medium
CN115184662A (en) * 2022-07-01 2022-10-14 帝森克罗德集团有限公司 Current unit
CN115862666A (en) * 2022-11-23 2023-03-28 小水怪(深圳)智能科技有限公司 Water cup capable of jumping along with temperament and jumping display method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1498740A1 (en) * 2003-07-15 2005-01-19 Iskraemeco, Merjenje in Upravljanje Energije, D.D. Watthour-meter measuring circuit including a detection of an incorrect line connection
CN201289504Y (en) * 2008-09-18 2009-08-12 李颖 Wide range energy counting device
CN102230959A (en) * 2011-04-21 2011-11-02 深圳市锐能微科技有限公司 Method and system for calibrating electric energy meter and electric energy meter
CN102565523A (en) * 2012-01-12 2012-07-11 上海理工大学 Current harmonic detection system and working method
CN202486210U (en) * 2011-12-31 2012-10-10 广东电网公司韶关供电局 A device for improving the accuracy of electric energy measurement under the influence of harmonics

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1498740A1 (en) * 2003-07-15 2005-01-19 Iskraemeco, Merjenje in Upravljanje Energije, D.D. Watthour-meter measuring circuit including a detection of an incorrect line connection
CN201289504Y (en) * 2008-09-18 2009-08-12 李颖 Wide range energy counting device
CN102230959A (en) * 2011-04-21 2011-11-02 深圳市锐能微科技有限公司 Method and system for calibrating electric energy meter and electric energy meter
CN202486210U (en) * 2011-12-31 2012-10-10 广东电网公司韶关供电局 A device for improving the accuracy of electric energy measurement under the influence of harmonics
CN102565523A (en) * 2012-01-12 2012-07-11 上海理工大学 Current harmonic detection system and working method

Also Published As

Publication number Publication date
CN103344825A (en) 2013-10-09

Similar Documents

Publication Publication Date Title
CN103344825B (en) Based on the electric energy metered system of AC sampling
CN103257271B (en) A kind of micro-capacitance sensor harmonic wave based on STM32F107VCT6 and m-Acetyl chlorophosphonazo pick-up unit and detection method
CN203149027U (en) Voltage fluctuation and flicker detection apparatus based on energy operator and frequency spectrum correction
CN102288807B (en) Method for measuring electric network voltage flicker
CN102004186B (en) High-accuracy sinusoidal signal measuring method for removing frequency spectrum leakage
CN104237622A (en) Sampling method based on software frequency tracking and broadband voltage/power calibration device
CN109633262A (en) Three phase harmonic electric energy gauging method, device based on composite window multiline FFT
CN203287435U (en) A micro electrical network harmonic wave and inter-harmonic wave test apparatus based on an STM32F107VCT6
CN101261292A (en) Fundamental wave and harmonic detection method based on 5-term Rife-Vincent (I) window bispectral interpolation FFT
CN102495282A (en) Measuring method of alternating current voltage frequency
CN114035142A (en) Electric energy meter error compensation method and system based on segmented Lagrange interpolation
CN112415457A (en) A method and system for realizing AC quantity acquisition and calibration of power comprehensive tester
CN101701985B (en) Constant-frequency variable dot power grid harmonic wave detection method and admeasuring apparatus thereof
CN101561462A (en) Phasor amplitude measurement method of power system
CN103983849A (en) Real-time high-accuracy power harmonic analysis method
CN106645942A (en) Low cost and high precision embedded type signal collection and analysis system and method
CN202631630U (en) Novel intelligent electric energy meter based on spectrum correction of Blackman-Harris window
CN204945273U (en) A kind of power quality data harvester of self-adaptation mains frequency
CN109444525B (en) RMS and Power Factor Calculation Method of AC Sampling Data of Substation Measurement and Control Device
CN112098918A (en) Direct current electric energy meter calibrating device and method applied to working condition with larger direct current ripple factor
CN115639400A (en) High-precision alternating current electric energy metering method
CN217085091U (en) Multi-mode power factor measuring device
CN109283386A (en) A harmonic energy meter based on ADC and Rife-Vincent window triple-line interpolation FFT
CN104391176A (en) Software and hardware frequency measurement circuit compatible with electric power system signals
CN114200381A (en) System and method for detecting reliability of intelligent electric meter

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160120