Electric energy meter and method for testing metering linearity of using and collecting terminal
By outputting a sinusoidal signal through a signal generator and fitting the response curve using Fourier transform and least squares method, the problems of long testing time and instrument dependence for linearity of high-resolution digital sampling devices are solved, and efficient linearity testing is achieved.
Patent Information
- Application Number
- CN202411274161.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-12-10
AI Technical Summary
In existing technologies, the linearity testing of high-resolution digital sampling devices takes a long time and relies on high-precision instruments, resulting in complex and costly calibration of metrology equipment.
A sinusoidal signal is output by a signal generator. The amplitude and phase are calculated using Fourier transform. The response curve is fitted using the least squares method to establish the correspondence between the sampling points and the input voltage, and the linearity of the sampling device is calculated.
It shortens testing time, reduces reliance on high-precision instruments, improves testing efficiency, and reduces costs.
Smart Images

Figure BDA0005039624350000021 
Figure BDA0005039624350000031 
Figure BDA0005039624350000033
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of electrical digital data processing, and in particular relates to a method for testing metrological linearity. Background Art
[0002] The linearity of the digital sampling device (usually the metering chip) of the electric energy meter and the sampling terminal as the metering equipment directly affects the metering accuracy. Generally, several calibration points are selected for the calibration of the metering equipment. After the calibration points are calibrated, it is considered that the calibration points are approximately linear, and then other positions are calibrated. If the linearity of the sampling device is poor, it will directly affect the metering accuracy of the metering equipment.
[0003] The conventional method for linearity testing of digital sampling devices is the histogram method. However, this method is only applicable to the case where the number of bits of digital sampling devices is small. For example, for a device with a sampling frequency of 12.8kHz and a number of bits of 16 bits, the time required to theoretically ensure that each code has at least one sampling point is: 2 16 / 12800 = 5.12 seconds. Modern digital sampling devices have a higher number of bits, generally 24 bits, so the time required for the same sampling frequency is: 2 24 / 12800=1310.72 seconds, the test time is very long.
[0004] Another linearity test method for high-resolution digital sampling devices is the fitting method. This method only needs to test some points and uses the curve fitting method to fit the entire output curve. However, this method requires a high-precision DC source and a high-precision multimeter. The entire test process is relatively complicated and the cost of the test instrument is high. Summary of the invention
[0005] The present invention provides an electric energy meter and a terminal measurement linearity test method, the purpose of which is to solve the problems of long test time and reliance on high-precision instruments in the existing measurement linearity test method.
[0006] The technical solution of the present invention is as follows:
[0007] A method for testing the linearity of an electric energy meter and a terminal for use, comprising the steps of:
[0008] Step 1: The signal generator outputs a sinusoidal signal with a frequency of fo to the electric energy meter or sampling terminal under test;
[0009] Step 2, obtaining a digital signal output by an electric energy meter or a user terminal;
[0010] Step 3, intercept a cycle in the digital signal to obtain a sampling point sequence S;
[0011] Step 4: Calculate the amplitude and phase at the frequency fo according to the sampling point sequence S;
[0012] Step 5: Establish a corresponding relationship between the sampling point sequence S and the input voltage according to the amplitude and phase at the frequency fo;
[0013] Step 6: According to the corresponding relationship between the sampling point sequence S and the input voltage, the parameters of the fitting response curve of the sampling device are obtained;
[0014] Step 7: Calculate the ideal response curve of the sampling device according to the parameters of the fitted response curve;
[0015] Step 8: Calculate the linearity of the sampling device by establishing a linearity encoding index according to the fitting response curve parameters and the ideal response curve parameters.
[0016] As a further improvement of the electric energy meter and the terminal measurement linearity test method: in step 1, the frequency fo of the sinusoidal signal should satisfy the following relationship:
[0017]
[0018] Wherein, M and fs are the number of bits and sampling frequency of the digital sampling device of the electric energy meter or the sampling terminal under test, respectively.
[0019] As a further improvement of the electric energy meter and the terminal measurement linearity test method, the specific process of step 4 is:
[0020] First, the amplitude-frequency response at frequency fo is calculated by Fourier transform:
[0021]
[0022] Where S[k] is the value of the kth sampling point in the sampling point sequence S, and Cs is the number of sampling points in the sampling point sequence S;
[0023] Then let: S′[1]=a+bj, find a and b;
[0024] Then calculate the amplitude A at the frequency fo fo and Phase
[0025]
[0026]
[0027] As a further improvement of the electric energy meter and the terminal measurement linearity test method, in step 5, for the kth sampling point in the sampling point sequence S, its corresponding input voltage U[k] is:
[0028]
[0029] Among them, A fo and are the amplitude and phase at the frequency fo obtained in step 4 respectively, and Cs is the number of sampling points in the sampling point sequence S.
[0030] As a further improvement of the electric energy meter and the terminal measurement linearity test method, the process of step 6 is:
[0031] Let the fitting response curve be αx 2 +βx+γ=y, then the following set of equations holds:
[0032] αS[k] 2 +βS[k]+γ=U[k]k=0, 1,…,Cs-1;
[0033] S[k] is the value of the kth sampling point in the sampling point sequence S;
[0034] The above equations can be expressed in matrix form as:
[0035] XΓ=Y;
[0036] in:
[0037]
[0038]
[0039] Y=[U[0]U[1]…U[Cs-1]] T ;
[0040] By solving the matrix using the least squares method, the parameters of the fitting response curve can be obtained as follows:
[0041] Γ=(X T X) -1 X T Y;
[0042] in,(·) T represents the matrix transpose operation, (·) -1 Represents a matrix inversion operation.
[0043] As a further improvement of the electric energy meter and the terminal measurement linearity test method, the process of step 7 is:
[0044] First, let the fitting response curve be αx 2 +βx+γ=y, x=0 and x=2 M Substitute into the fitting response curve to get the corresponding voltage value and
[0045]
[0046]
[0047] Then, calculate the ideal response curve parameters:
[0048]
[0049]
[0050] As a further improvement of the electric energy meter and the terminal measurement linearity test method, step 8 includes:
[0051] Step 8-1: Follow 0-2 M The linear encoding index is established in the order of Represents the i-th index, and the index is equal to the index value:
[0052] Step 8-2: Traverse all indexes, for The corresponding actual index x*[i] is obtained by the ideal response parameters and the fitted response parameters, and then The difference with x*[i] is taken as the linearity value when the sampling value is i.
[0053] As a further improvement of the electric energy meter and the terminal measurement linearity test method, the specific steps of step 8-2 are:
[0054] Step 8-2-1, calculate the index The ideal response
[0055]
[0056] Step 8-2-2: Calculate the response The actual index x*[i] at this time is:
[0057]
[0058] Step 8-2-3: Linearity value when the sampling value is i:
[0059] Compared with the prior art, the present invention has the following positive effects:
[0060] The present invention utilizes the characteristics of equally spaced sampling, establishes the corresponding relationship between the sampling points and the input voltage by estimating the phase and amplitude of the sinusoidal signal, and further implements the fitting of the actual response curve by the least squares method, thereby realizing linearity testing based on fewer sampling points, shortening the test time, and reducing the dependence on the test instrument. DETAILED DESCRIPTION
[0061] The technical solution of the present invention is described in detail below. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments.
[0062] A method for testing the metering linearity of an electric energy meter and a user terminal. The test platform used in the method includes a signal generator, a tested electric energy meter / user terminal, an RS485 Ethernet conversion module and a PC, and the PC runs dedicated analysis software.
[0063] Among them, the signal generator is used to generate a sine signal. The sine signal is connected to the signal input terminal of the tested electric energy meter / user terminal, and the electric energy meter / user terminal converts the input analog sine signal into a digital sine signal through the internal digital sampling device. The RS485 Ethernet conversion module is used to connect the electric energy meter / user terminal and the PC, and is used to convert the digital sine signal output by the RS485 interface of the electric energy meter / user terminal into an Ethernet signal and transmit it to the PC. The analysis software performs linearity analysis after receiving the digital sine signal.
[0064] It should be noted that the RS485 port is a common interface for electricity meters / user terminals. Under the premise of meeting the communication rate, other forms of interfaces such as RS232 and MODBUS can also be considered; the RS485 Ethernet conversion module is only for the convenience of transmitting the digital signal output by the electricity meter / user terminal to the PC, and is not limited to a specific interface form.
[0065] The specific test steps include:
[0066] Step 1: The signal generator outputs a sinusoidal signal to the electric energy meter or sampling terminal under test.
[0067] Assume that the lower limit and upper limit of the input reference voltage range of the digital sampling device (hereinafter referred to as sampling device) of the electric energy meter / user sampling terminal are Vref- and Vref+ respectively, the lower limit of the input voltage of the sinusoidal signal should be equal to or slightly higher than Vref-, and the upper limit of the input voltage should be equal to or slightly lower than Vref+. For the convenience of subsequent analysis, it can be assumed that the lower limit of the input voltage of the sinusoidal signal is Vref-, and the upper limit of the input voltage is Vref+.
[0068] To ensure the data accuracy of the subsequent steps, the frequency of the sinusoidal signal should be as low as possible. Assume that the frequency of the sinusoidal signal is fo, which should satisfy the following relationship:
[0069]
[0070] Wherein, M and fs are the number of bits and sampling frequency of the digital sampling device of the electric energy meter or the sampling terminal under test, respectively.
[0071] In this embodiment, assuming that M=24, fs=12800, fo can be selected as 0.05 Hz.
[0072] Step 2: Obtain the digital signal output by the electric energy meter or the sampling terminal.
[0073] The sinusoidal signal is connected to the signal input terminal of the electric energy meter / user terminal, converted into a digital signal by the sampling device, and output to the RS485 port of the electric energy meter / user terminal. The output digital signal is converted into an Ethernet signal through the RS485 Ethernet conversion module and transmitted to the PC for analysis and processing.
[0074] Step 3: intercept a cycle in the digital signal to obtain a sampling point sequence S. Assume that the number of sampling points in the sampling point sequence S is Cs, then:
[0075]
[0076] Generally, the sampling points initially output by the sampling device are not stable. You can consider starting from the first point received and recursively push forward several cycles to save Cs sampling points for subsequent linearity analysis.
[0077] Step 4: Calculate the amplitude and phase at the frequency fo according to the sampling point sequence S.
[0078] First, the amplitude-frequency response at frequency fo is calculated by Fourier transform:
[0079]
[0080] Where S[k] is the value of the kth sampling point in the sampling point sequence S.
[0081] Then let: S′[1]=a+bj, find a and b;
[0082] Then calculate the amplitude A at the frequency fo fo and Phase
[0083]
[0084]
[0085] Step 5: Establish the corresponding relationship between the sampling point sequence S and the input voltage.
[0086] For the kth sampling point in the sampling point sequence S, the corresponding input voltage U[k] is:
[0087]
[0088] Step 6: According to the corresponding relationship between the sampling point sequence S and the input voltage, the parameters of the fitting response curve of the sampling device are obtained.
[0089] Let the fitting response curve be αx 2 +βx+γ=y, then the following set of equations holds:
[0090] αS[k] 2 +βS[k]+γ=U[k]k=0, 1,…,Cs-1;
[0091] The above equations can be expressed in matrix form as:
[0092] XΓ=Y;
[0093] in:
[0094]
[0095]
[0096] Y=[U[0]U[1]…U[Cs-1]] T .
[0097] By solving the matrix using the least squares method, the parameters of the fitting response curve can be obtained as follows:
[0098] Γ=(X T X) -1 X T Y;
[0099] in,(·) T represents the matrix transpose operation, (·) -1 Represents a matrix inversion operation.
[0100] Step 7: Calculate the ideal response curve of the sampling device according to the parameters of the fitted response curve.
[0101] First, set x=0 and x=2 M Substitute into the fitting response curve to get the corresponding voltage value and
[0102]
[0103]
[0104] Then, calculate the ideal response curve parameters:
[0105]
[0106]
[0107] Step 8: Calculate the linearity of the sampling device based on the fitting response curve parameters and the ideal response curve parameters.
[0108] Step 8-1: Follow 0-2 M The linear encoding index is established in the order of Represents the i-th index, and the index is equal to the index value:
[0109] Step 8-2: Traverse all indexes, for The corresponding actual index x is obtained by the ideal response parameter and the fitting response parameter. * [i], then With x * The difference between [i] is taken as the linearity value when the sampling value is i.
[0110] The specific steps are:
[0111] Step 8-2-1, calculate the index The ideal response
[0112]
[0113] Step 8-2-2: Calculate the response The actual index x at * [i]:
[0114]
[0115] Step 8-2-3: Linearity value when the sampling value is i:
[0116] At this point, the linearity test of the electric energy meter / user terminal is completed.
[0117] It should be noted that it is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. The scope of the present invention is defined by the claims rather than the above description.
Claims
1. A method for testing the linearity of an electric energy meter and a terminal for use, characterized in that the steps include: Step 1: The signal generator outputs a sinusoidal signal with a frequency of fo to the electric energy meter or sampling terminal under test; Step 2, obtaining a digital signal output by an electric energy meter or a user terminal; Step 3, intercept a cycle in the digital signal to obtain a sampling point sequence S; Step 4: Calculate the amplitude and phase at the frequency fo according to the sampling point sequence S; Step 5: Establish a corresponding relationship between the sampling point sequence S and the input voltage according to the amplitude and phase at the frequency fo; Step 6: According to the corresponding relationship between the sampling point sequence S and the input voltage, the parameters of the fitting response curve of the sampling device are obtained; Step 7: Calculate the ideal response curve of the sampling device according to the parameters of the fitted response curve; Step 8: Calculate the linearity of the sampling device by establishing a linearity encoding index according to the fitting response curve parameters and the ideal response curve parameters.
2. The electric energy meter and the terminal measurement linearity test method according to claim 1, characterized in that: In step 1, the frequency fo of the sinusoidal signal should satisfy the following relationship: Wherein, M and fs are the number of bits and sampling frequency of the digital sampling device of the electric energy meter or the sampling terminal under test, respectively.
3. The electric energy meter and the terminal measurement linearity test method according to claim 1, characterized in that: The specific process of step 4 is: First, the amplitude-frequency response at frequency fo is calculated by Fourier transform: Where S[k] is the value of the kth sampling point in the sampling point sequence S, and Cs is the number of sampling points in the sampling point sequence S; Then let: S′[1]=a+bj, find a and b; Then calculate the amplitude A at the frequency fo fo and Phase 4. The electric energy meter and the terminal measurement linearity test method according to claim 1, characterized in that: In step 5, for the kth sampling point in the sampling point sequence S, the corresponding input voltage U[k] is: Among them, A fo and are the amplitude and phase at the frequency fo obtained in step 4 respectively, and Cs is the number of sampling points in the sampling point sequence S.
5. The electric energy meter and the terminal measurement linearity test method as claimed in claim 4, characterized in that: The process of step 6 is: Let the fitting response curve be αx 2 +βx+γ=y, then the following set of equations holds: αS[k] 2 +βS[k]+γ=U[k]k=0,1,…,Cs-1; S[k] is the value of the kth sampling point in the sampling point sequence S; The above equations can be expressed in matrix form as: XΓ=Y; in: Y=[U[0] U[1] … U[Cs-1]] T ; By solving the matrix using the least squares method, the parameters of the fitting response curve can be obtained as follows: Γ=(X T X) -1 X T Y; in,(·) T represents the matrix transpose operation, (·) -1 Represents a matrix inversion operation.
6. The electric energy meter and the terminal measurement linearity test method according to claim 1, characterized in that: The process of step 7 is: First, let the fitting response curve be αx 2 +βx+γ=y, x=0 and x=2 M Substitute into the fitting response curve to get the corresponding voltage value and Then, calculate the ideal response curve parameters:
7. The electric energy meter and the terminal measurement linearity test method according to claim 6, characterized in that: Step 8 includes: Step 8-1: Follow 0-2 M The linear encoding index is established in the order of Represents the i-th index, and the index is equal to the index value: Step 8-2: Traverse all indexes, for The corresponding actual index x is obtained by the ideal response parameter and the fitting response parameter. * [i], then With x * The difference between [i] is taken as the linearity value when the sampling value is i.
8. The electric energy meter and the terminal measurement linearity test method according to claim 7, characterized in that: The specific steps of step 8-2 are: Step 8-2-1, calculate the index The ideal response Step 8-2-2: Calculate the response as The actual index x at * [i]: Step 8-2-3: Linearity value when the sampling value is i:
