Calibration phase value determination method and device, storage medium and electric metering equipment
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN CLOU POWER TECH CO LTD
- Filing Date
- 2025-03-03
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]本申请旨在至少解决现有技术或相关技术中存在的单通道ADC非同步采样交流标准表,在测量非校准频率的信号时,相位测量结果不准确的问题
[0081]本申请通过将采样相位差与硬件相位差分开处理,在每次采样后单独处理采样相位差,因此能够在软件层面上解决被测信号频率非标准的情况下,电计量设备得到的相位值与实际值出现偏差的问题,该方法不需要对原有的电计量设备硬件,比如三相交流电能表的硬件进行改动,不增加硬件成本,也不会改变原有的校准流程,能够以低成本、高兼容性实现提高电测量设备的相位测量的准确度。
Smart Images

Figure CN120065099B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electrical metering equipment technology, and more specifically, to a method and apparatus for determining calibration phase values, a storage medium, and electrical metering equipment. Background Technology
[0002] In related technologies, electricity metering equipment such as AC standard meters needs to be able to measure voltage and current signals simultaneously. For a three-phase AC energy meter with a single-channel ADC, it samples a total of six signals, including three-phase voltage signals and three-phase current signals, using time-division multiplexing sampling.
[0003] The time-division multiplexing sampling method described above directly affects the phase value calculation. Therefore, the hardware phase difference needs to be calibrated and eliminated during phase meter calibration. When measuring non-standard frequency signals, such as non-50Hz electrical signals, the frequency of the measured signal changes. Even if the hardware phase difference remains unchanged, the sampling phase difference will inevitably change, causing the phase calibration coefficient to fail. Ultimately, the calculated phase value will be deviated, resulting in inaccurate phase measurement results. Summary of the Invention
[0004] This application aims to at least address the problem in the prior art or related technologies where the phase measurement results of a single-channel ADC asynchronous sampling AC standard meter are inaccurate when measuring signals at uncalibrated frequencies.
[0005] Therefore, the first aspect of this application proposes a method for determining the calibration phase value of an electrical metering device.
[0006] The second aspect of this application provides a device for determining the calibration phase value of an electrical metering device.
[0007] A third aspect of this application provides a device for determining the calibration phase value of an electrical metering device.
[0008] The fourth aspect of this application proposes a readable storage medium.
[0009] The fifth aspect of this application proposes an electrical metering device.
[0010] In view of this, the first aspect of this application provides a method for determining the calibration phase value of an electrical metering device. The method includes: sampling a target signal to obtain an original sampled data sequence; performing interpolation resampling processing on the original sampled data sequence to obtain a resampled data sequence, the resampled data sequence including continuous integer-cycle data; performing fast Fourier transform processing on the continuous integer-cycle data to obtain harmonic data of each harmonic in the resampled data sequence; determining the absolute phase information of the target signal based on the harmonic data; and determining the calibration phase value based on the hardware phase difference and absolute phase information of the electrical metering device.
[0011] In this technical solution, the electricity metering equipment includes, but is not limited to, AC standard meters, oscilloscopes, and portable energy meters. The energy standard meter can simultaneously measure multiple signals. Taking a three-phase AC standard meter as an example, it needs to be able to simultaneously measure a total of six signals, including three-phase voltage and three-phase current.
[0012] The working principle of the three-phase AC standard meter is to use the input values of the three address lines A, B, and C controlled by the MCU (Micro Controller Unit) to cyclically select the independent input / output terminals, including terminals X0 to X5, with the common output / input terminal X, so as to connect the six sampling signals to the sampling input port of the ADC in a time-division manner.
[0013] In addition, during the time interval between the sequential selection of two adjacent channels of the multi-channel analog switch chip, the MCU needs to output a conversion trigger signal to the single-channel ADC (analog-to-digital converter) chip and read the AD (analog-to-digital) conversion value of that selection signal through the connected SPI (Serial Peripheral Interface) data bus. This process is executed continuously, allowing the sampling data of six voltage and current channels to be continuously input into the MCU, enabling the MCU to calculate the frequency, amplitude, phase, and power value of each signal.
[0014] Theoretically, when the measured voltage and current signals are both sinusoidal waves, and the sampling rate is much higher than the frequency of each signal, this time-division multiplexing sampling method has no effect on the calculated frequency, amplitude, and power of the measured signal, but it does have a direct impact on the phase value. This is because the other five channels each have a sampling trigger interval relative to the A-phase voltage, and the interval time increases sequentially from the first to the last. Using such asynchronous sampling data inevitably leads to a phase difference between the other five phases and the A-phase voltage due to the sampling trigger interval, i.e., a sampling phase difference. Furthermore, this sampling phase difference is positively correlated with the frequency of the measured voltage and current signal; the higher the frequency, the larger the sampling phase difference.
[0015] When the signal being measured is a single-frequency signal, such as when used only in a 50Hz environment, the aforementioned sampling phase difference can be eliminated along with the hardware phase difference during phase calibration. However, once the frequency of the signal being measured changes, even if the hardware phase difference remains unchanged, the sampling phase difference will inevitably change, causing the phase calibration coefficient to fail and ultimately resulting in a deviation in the calculated phase value.
[0016] To address the aforementioned issues, this application performs interpolation and resampling on the original sampled data sequence obtained from sampling the target signal, thereby obtaining a resampled data sequence that satisfies a specific number of sampling points for one cycle, i.e., includes continuous integer cycle data. The target signal is also the signal being measured. This operation ensures that the data in the resampled data sequence is suitable for Fast Fourier Transform (FFT) processing.
[0017] After obtaining the resampled data sequence including continuous integer cycle data, the data sequence is processed by Fast Fourier Transform to obtain the harmonic data of each harmonic, including the harmonic data of the 1st harmonic, the harmonic data of the 2nd harmonic, ... and the harmonic data of the nth harmonic.
[0018] After obtaining the harmonic data for each harmonic, the absolute phase information of the target signal, i.e., the measured signal, can be calculated based on the harmonic data. Combined with the known hardware phase difference of the electrical metering equipment, the calibration phase value can be obtained.
[0019] This application separates the sampling phase difference from the hardware phase difference, processing the sampling phase difference individually after each sampling. Therefore, it can solve the problem of deviation between the phase value obtained by the electrical metering equipment and the actual value when the frequency of the measured signal is non-standard at the software level. This method does not require modification to the original electrical metering equipment hardware, such as the hardware of a three-phase AC energy meter, does not increase hardware costs, and does not change the original calibration process. It can improve the accuracy of phase measurement of electrical measuring equipment at low cost and with high compatibility.
[0020] In addition, the method for determining the calibration phase value of the electrical metering equipment in the above-mentioned technical solution provided in this application may also have the following additional technical features:
[0021] Optionally, in some technical solutions of this application, the target signal includes multiple signals; sampling the target signal includes: sampling the multiple signals separately according to a preset sampling interval; determining the calibration phase value based on the hardware phase difference and absolute phase information of the electrical metering equipment includes: determining the number of cycle sampling points of the original sampling data sequence; determining the sampling phase difference between each signal in the multiple signals according to the number of cycle sampling points; and determining the calibration phase value corresponding to each sampled signal according to the hardware phase difference, the sampling phase difference, and the absolute phase information.
[0022] In this technical solution, taking a three-phase electrical signal as the target signal as an example, the target signal includes three voltage signals and three current signals. The three voltage signals are phase A voltage signal, phase B voltage signal, and phase C voltage signal. The three current signals are phase A current signal, phase B current signal, and phase C current signal.
[0023] When sampling the target signal, time-division multiplexing sampling is performed on the above 6 signals based on fixed sampling detection.
[0024] For example, each signal is sampled at equal intervals according to a fixed sampling rate to obtain the original sampling sequence, which is denoted as f. s According to the Nyquist theorem, the sampling rate is denoted as f. s Satisfy the following formula (1):
[0025] f s ≥2f Max (1)
[0026] Among them, f s f is the sampling frequency at which the target signal is sampled. Max This refers to the highest frequency value that needs to be detected in the target signal. For example, at the mains frequency (50Hz), when analyzing parameters down to the 64th harmonic, f... Max =50 × 64 = 3200Hz. Optionally, the sampling frequency is 2.56 to 4 times the highest frequency value mentioned above, then f s =3200×4=12800Hz.
[0027] At a sampling rate of 12800Hz, if the fundamental frequency of the target signal is 50Hz, then the number of sampling points per cycle is 256.
[0028] For example, by detecting the zero-crossing position of the original sampled data, a precise cycle sampling circuit can be obtained, and then the fundamental frequency can be calculated based on the original sampling rate and the number of precise cycle points using the following formula (2):
[0029]
[0030] Among them, f b f is the fundamental frequency of the target signal. s Where N is the sampling frequency. b This represents the number of sampling points for the cycle.
[0031] Based on the above number of sampling points, the sampling phase difference between each signal in the multi-channel signal can be calculated.
[0032] Let the hardware phase difference be Absolute phase information is The sampling phase difference is The calibration phase value corresponding to each sampling signal can then be calculated using the following formula (3).
[0033]
[0034] in, To calibrate the phase value, For absolute phase information, For sampling phase difference, This refers to the hardware phase difference.
[0035] This application improves the accuracy of phase measurement by processing hardware phase difference and sampling phase difference separately.
[0036] In some technical solutions of this application, optionally, the original sampled data sequence is subjected to interpolation and resampling processing to obtain a resampled data sequence, including:
[0037] Interpolation resampling is performed using the following formula (4):
[0038] y m =x n +(x n+1 -x n )×(Δm-n); (4)
[0039] Among them, y m For the m-th data in the resampled data sequence, x n x is the nth data point in the original sampled data. n+1 Let Δ be the (n+1)th data point in the original sampled data, Δ be the step value for interpolation resampling, and Δm be the resampling time for the m-th resampling point. n is the floor value of Δm.
[0040] In this technical solution, the original sampled data sequence obtained by equal-interval sampling is interpolated and resampled at a set resampling frequency to obtain a resampled sequence of exactly 256 points for one cycle. The purpose of this operation is to make the obtained resampled data sequence meet the conditions of the subsequent FFT operation, that is, the number of operation points is 2 to the power of n, and the data involved in the operation is data of the whole cycle.
[0041] The principle of resampling is to use the original sampled data sequence, where the number of cycles may not be a set value, and then use an interpolation algorithm to calculate a resampled sequence with the set number of cycles. Assume the actual number of cycles in the original sampled data sequence is N. b The required number of cycles is set to 256. The interpolation resampling step value Δ can be determined by the following formula (5), and the resampling frequency f can be determined by the following formula (6). s ′:
[0042]
[0043] f s =256f b (6);
[0044] Where Δ is the step value for interpolation resampling, and N b f represents the actual number of cycles in the original sampled data sequence. s ′ is the resampling frequency, f b The fundamental frequency of the target signal.
[0045] The formula used for interpolation resampling is as shown in formula (4) above.
[0046] This application improves the accuracy and efficiency of calibration phase value calculation by interpolating and resampling the original sampled data sequence, thereby meeting the format requirements of FFT operation.
[0047] In some technical solutions of this application, optionally, the harmonic data includes the real part data and imaginary part data of each harmonic; based on the harmonic data, determining the absolute phase information of the target signal includes:
[0048] The absolute phase information is determined by the following formula (7):
[0049]
[0050] in, For the absolute phase information of the nth harmonic, im n Let re be the imaginary part of the nth harmonic. n Let be the real part of the nth harmonic.
[0051] In this technical solution, by performing a fast Fourier transform on the resampled data sequence, the real part data re of each harmonic can be obtained. n imaginary part data n Then, the absolute phase information of each harmonic can be calculated using the above formula (7).
[0052] Among them, due to the characteristics of the FFT algorithm, the harmonic frequency resolution f of the calculation result is... n The following formula (8) must be satisfied:
[0053]
[0054] Among them, f n f is the harmonic frequency resolution after FFT operation. s ′ is the resampling frequency, f b Let N be the fundamental frequency of the target signal, N be the number of resampling points for the FFT operation, and k be the number of cycles for the FFT operation. Wherein, when k = 1, f n =f b That is, the harmonic frequency resolution is equal to the fundamental frequency.
[0055] Substituting into formula (7), the harmonic frequency resolution f calculated according to formula (8) is obtained. n When k=1, f n =f b At this point, n=0 represents the DC component data, and n=1 represents the fundamental frequency data. The absolute phase of the fundamental frequency, i.e., the absolute phase information mentioned above, is denoted as...
[0056] In some technical solutions of this application, optionally, determining the sampling phase difference between each of the multiple signals includes:
[0057] The sampling phase difference is determined by the following formula (9):
[0058]
[0059] in, Let N be the sampling phase difference, k be the phase difference multiple of the multiple signals, and N be the sampling phase difference. b This represents the number of sampling points for the cycle.
[0060] In this technical solution, the sampling phase difference between each signal is calculated using the above formula (9). The derivation process of formula (9) is shown in the following formula (10):
[0061]
[0062] in, The sampling phase difference is denoted as m, where m is the phase difference multiple of each signal.
[0063] Taking the asynchronous sampling circuit structure of a single-channel ADC multi-channel signal as an example, the cyclic sampling order is Ua, Ub, Uc, Ia, Ib, Ic, then the phase difference multiples of each channel are 0, 1, 2, 3, 4, 5 respectively.
[0064] In some technical solutions of this application, optionally, after determining the calibration phase value based on the hardware phase difference and absolute phase information of the electrical metering equipment, the determination method further includes: obtaining a standard phase value; and correcting the hardware phase difference according to the standard phase value and the calibration phase value.
[0065] In this technical solution, regarding hardware phase difference After determining the relative phase value, the hardware phase difference can be... Calibration is performed. For example, the hardware phase difference can be calibrated using the following formula (11). Perform calibration:
[0066]
[0067] in, For the calibrated hardware phase difference, The hardware phase difference before calibration. The relative phase value, This refers to the obtained standard phase value. For example, the standard phase value is a relative value and can be obtained through external input.
[0068] Optionally, in some technical solutions of this application, the target signal includes multiple signals, and the multiple signals include a first signal; after determining the calibration phase value based on the hardware phase difference and absolute phase information of the electrical metering equipment, the determination method further includes: determining the relative phase value corresponding to each signal in the multiple signals according to the first calibration phase value corresponding to the first signal.
[0069] In this technical solution, taking a three-phase electrical signal as the target signal as an example, the multi-channel signal of the three-phase electrical signal includes three-phase voltage signals and three-phase current signals. Let the first signal be the A-phase voltage signal Ua, and the first calibration phase value corresponding to the first signal be... The relative phase value corresponding to each signal is then calculated using the following formulas (12) to (17):
[0070]
[0071] in, This represents the relative phase value of the A-phase voltage signal. This is the calibration phase value corresponding to the A-phase voltage signal. This represents the relative phase value of the B-phase voltage signal. This is the calibration phase value corresponding to the B-phase voltage signal. This represents the relative phase value of the C-phase voltage signal. This is the calibration phase value corresponding to the C-phase voltage signal. This represents the relative phase value of the A-phase current signal. This is the calibration phase value corresponding to the A-phase current signal. This represents the relative phase value of the B-phase current signal. This is the calibration phase value corresponding to the B-phase current signal. This represents the relative phase value of the C-phase current signal. This is the calibration phase value corresponding to the C-phase current signal.
[0072] The second aspect of this application provides a device for determining the calibration phase value of an electrical metering device. The device includes: a sampling module for sampling a target signal to obtain an original sampled data sequence; a processing module for performing interpolation and resampling processing on the original sampled data sequence to obtain a resampled data sequence, the resampled data sequence including continuous integer-cycle data; and performing fast Fourier transform processing on the continuous integer-cycle data to obtain harmonic data of each harmonic in the resampled data sequence; and a determination module for determining the absolute phase information of the target signal based on the harmonic data; and determining the calibration phase value based on the hardware phase difference and absolute phase information of the electrical metering device.
[0073] In this technical solution, the electricity metering equipment includes, but is not limited to, AC standard meters, oscilloscopes, and portable energy meters. The energy standard meter can simultaneously measure multiple signals. Taking a three-phase AC standard meter as an example, it needs to be able to simultaneously measure a total of six signals, including three-phase voltage and three-phase current.
[0074] The working principle of the three-phase AC standard meter is to use the input values of the three address lines A, B, and C controlled by the MCU (Micro Controller Unit) to cyclically select the independent input / output terminals, including terminals X0 to X5, with the common output / input terminal X, so as to connect the six sampling signals to the sampling input port of the ADC in a time-division manner.
[0075] In addition, during the time interval between the sequential selection of two adjacent channels of the multi-channel analog switch chip, the MCU needs to output a conversion trigger signal to the single-channel ADC (analog-to-digital converter) chip and read the AD (analog-to-digital) conversion value of that selection signal through the connected SPI (Serial Peripheral Interface) data bus. This process is executed continuously, allowing the sampling data of six voltage and current channels to be continuously input into the MCU, enabling the MCU to calculate the frequency, amplitude, phase, and power value of each signal.
[0076] Theoretically, when the measured voltage and current signals are both sinusoidal waves, and the sampling rate is much higher than the frequency of each signal, this time-division multiplexing sampling method has no effect on the calculated frequency, amplitude, and power of the measured signal, but it does have a direct impact on the phase value. This is because the other five channels each have a sampling trigger interval relative to the A-phase voltage, and the interval time increases sequentially from the first to the last. Using such asynchronous sampling data inevitably leads to a phase difference between the other five phases and the A-phase voltage due to the sampling trigger interval, i.e., a sampling phase difference. Furthermore, this sampling phase difference is positively correlated with the frequency of the measured voltage and current signal; the higher the frequency, the larger the sampling phase difference.
[0077] When the signal being measured is a single-frequency signal, such as when used only in a 50Hz environment, the aforementioned sampling phase difference can be eliminated along with the hardware phase difference during phase calibration. However, once the frequency of the signal being measured changes, even if the hardware phase difference remains unchanged, the sampling phase difference will inevitably change, causing the phase calibration coefficient to fail and ultimately resulting in a deviation in the calculated phase value.
[0078] To address the aforementioned issues, this application performs interpolation and resampling on the original sampled data sequence obtained from sampling the target signal, thereby obtaining a resampled data sequence that satisfies a specific number of sampling points for one cycle, i.e., includes continuous integer cycle data. The target signal is also the signal being measured. This operation ensures that the data in the resampled data sequence is suitable for Fast Fourier Transform (FFT) processing.
[0079] After obtaining the resampled data sequence including continuous integer cycle data, the data sequence is processed by Fast Fourier Transform to obtain the harmonic data of each harmonic, including the harmonic data of the 1st harmonic, the harmonic data of the 2nd harmonic, ... and the harmonic data of the nth harmonic.
[0080] After obtaining the harmonic data for each harmonic, the absolute phase information of the target signal, i.e., the measured signal, can be calculated based on the harmonic data. Combined with the known hardware phase difference of the electrical metering equipment, the calibration phase value can be obtained.
[0081] This application separates the sampling phase difference from the hardware phase difference, processing the sampling phase difference individually after each sampling. Therefore, it can solve the problem of deviation between the phase value obtained by the electrical metering equipment and the actual value when the frequency of the measured signal is non-standard at the software level. This method does not require modification to the original electrical metering equipment hardware, such as the hardware of a three-phase AC energy meter, does not increase hardware costs, and does not change the original calibration process. It can improve the accuracy of phase measurement of electrical measuring equipment at low cost and with high compatibility.
[0082] The third aspect of this application provides an apparatus for determining the calibration phase value of an electrical metering device, comprising: a memory for storing programs or instructions; and a processor for executing programs or instructions to implement the steps of the method for determining the calibration phase value of an electrical metering device as provided in any of the above technical solutions, thus achieving the same technical effect. To avoid repetition, it will not be described again here.
[0083] The fourth aspect of this application provides a readable storage medium having a program or instructions stored thereon. When the program or instructions are executed by a processor, they implement the steps of the method for determining the calibration phase value of an electrical metering device as provided in any of the above technical solutions. Therefore, the same technical effect can be achieved. To avoid repetition, it will not be described again here.
[0084] The fifth aspect of this application provides an electrical metering device, including: a device for determining the calibration phase value of the electrical metering device as provided in any of the above technical solutions, and / or a readable storage medium as provided in any of the above technical solutions, thus achieving the same technical effect. To avoid repetition, it will not be described again here. Attached Figure Description
[0085] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0086] Figure 1 A flowchart illustrating a method for determining the calibration phase value of an electrical metering device according to some embodiments of this application is shown;
[0087] Figure 2 The following is a schematic diagram of the structure of a single-channel ADC multi-signal asynchronous sampling circuit according to some embodiments of this application;
[0088] Figure 3 This invention illustrates a phase calculation logic diagram of a single-channel ADC asynchronous sampling AC standard table according to some embodiments of this application;
[0089] Figure 4 A schematic diagram of the original sampled data sequence in some embodiments of this application is shown;
[0090] Figure 5 A schematic diagram of resampled data sequences in some embodiments of this application is shown;
[0091] Figure 6 A structural block diagram of a device for determining the calibration phase value of an electrical metering device according to some embodiments of this application is shown;
[0092] Figure 7 A structural block diagram of a device for determining the calibration phase value of an electrical metering device according to some embodiments of this application is shown. Detailed Implementation
[0093] To better understand the above-mentioned objectives, features, and advantages of this application, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0094] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, this application may also be implemented in other ways different from those described herein. Therefore, the scope of protection of this application is not limited to the specific embodiments disclosed below.
[0095] The following reference Figures 1 to 7 This application describes a method and apparatus for determining calibration phase values, a storage medium, and an electrical metering device according to some embodiments of the present application.
[0096] In some embodiments of this application, a method for determining the calibration phase value of an electrical metering device is provided. Figure 1 A flowchart illustrating a method for determining the calibration phase value of an electrical metering device according to some embodiments of this application is shown, such as... Figure 1 As shown, the determination method includes:
[0097] Step 102: Sample the target signal to obtain the original sampled data sequence;
[0098] Step 104: Perform interpolation and resampling on the original sampled data sequence to obtain a resampled data sequence, which includes continuous integer cycle data;
[0099] Step 106: Perform Fast Fourier Transform on the continuous integer cycle data to obtain the harmonic data of each harmonic in the resampled data sequence.
[0100] Step 108: Determine the absolute phase information of the target signal based on the harmonic data;
[0101] Step 110: Determine the calibration phase value based on the hardware phase difference and absolute phase information of the electrical metering equipment.
[0102] In this embodiment, the electricity metering equipment includes, but is not limited to, AC standard meters, oscilloscopes, and portable energy meters. The energy standard meter can simultaneously measure multiple signals. Taking a three-phase AC standard meter as an example, it needs to be able to simultaneously measure a total of six signals, including three-phase voltages and three-phase currents.
[0103] Figure 2 The following are schematic diagrams illustrating the structure of a single-channel ADC multi-signal asynchronous sampling circuit according to some embodiments of this application, such as... Figure 2As shown, the working principle of the three-phase AC standard meter is to use the input values of the three address lines A, B, and C controlled by the MCU (Micro Controller Unit) to cyclically select the independent input / output terminals, including terminals X0 to X5, with the common output / input terminal X, thereby enabling the six sampling signals to be connected to the sampling input port of the ADC in a time-division manner.
[0104] In addition, during the time interval between the sequential selection of two adjacent channels of the multi-channel analog switch chip, the MCU needs to output a conversion trigger signal to the single-channel ADC (analog-to-digital converter) chip and read the AD (analog-to-digital) conversion value of that selection signal through the connected SPI (Serial Peripheral Interface) data bus. This process is executed continuously, allowing the sampling data of six voltage and current channels to be continuously input into the MCU, enabling the MCU to calculate the frequency, amplitude, phase, and power value of each signal.
[0105] Theoretically, when the measured voltage and current signals are both sinusoidal waves, and the sampling rate is much higher than the frequency of each signal, this time-division multiplexing sampling method has no effect on the calculated frequency, amplitude, and power of the measured signal, but it does have a direct impact on the phase value. This is because the other five channels each have a sampling trigger interval relative to the A-phase voltage, and the interval time increases sequentially from the first to the last. Using such asynchronous sampling data inevitably leads to a phase difference between the other five phases and the A-phase voltage due to the sampling trigger interval, i.e., a sampling phase difference. Furthermore, this sampling phase difference is positively correlated with the frequency of the measured voltage and current signal; the higher the frequency, the larger the sampling phase difference.
[0106] When the signal being measured is a single-frequency signal, such as when used only in a 50Hz environment, the aforementioned sampling phase difference can be eliminated along with the hardware phase difference during phase calibration. However, once the frequency of the signal being measured changes, even if the hardware phase difference remains unchanged, the sampling phase difference will inevitably change, causing the phase calibration coefficient to fail and ultimately resulting in a deviation in the calculated phase value.
[0107] To address the above issues, for example, Figure 3 The following is a schematic diagram illustrating the phase calculation logic of a single-channel ADC asynchronous sampling AC standard table according to some embodiments of this application, such as... Figure 3As shown, this application performs interpolation and resampling processing on the original sampled data sequence obtained based on the target signal sampling, thereby obtaining a resampled data sequence that exactly satisfies a specific number of sampling points for one cycle, i.e., includes continuous integer cycle data. The target signal is also the signal being measured. This operation enables the data in the resampled data sequence to be processed by Fast Fourier Transform (FFT). The Fast Fourier Transform is an efficient algorithm for Discrete Fourier Transform, which can transform a discrete sequence in the time domain to the frequency domain to analyze the amplitude and phase parameters of each harmonic frequency point contained in the original signal.
[0108] After obtaining the resampled data sequence including continuous integer cycle data, the data sequence is processed by Fast Fourier Transform to obtain the harmonic data of each harmonic, including the harmonic data of the 1st harmonic, the harmonic data of the 2nd harmonic, ... and the harmonic data of the nth harmonic.
[0109] After obtaining the harmonic data for each harmonic, the absolute phase information of the target signal, i.e., the measured signal, can be calculated based on the harmonic data. Combined with the known hardware phase difference of the electrical metering equipment, the calibration phase value can be obtained.
[0110] This application separates the sampling phase difference from the hardware phase difference, processing the sampling phase difference individually after each sampling. Therefore, it can solve the problem of deviation between the phase value obtained by the electrical metering equipment and the actual value when the frequency of the measured signal is non-standard at the software level. This method does not require modification to the original electrical metering equipment hardware, such as the hardware of a three-phase AC energy meter, does not increase hardware costs, and does not change the original calibration process. It can improve the accuracy of phase measurement of electrical measuring equipment at low cost and with high compatibility.
[0111] In some embodiments of this application, optionally, the target signal includes multiple signals; sampling the target signal includes: sampling the multiple signals separately according to a preset sampling interval; determining the calibration phase value based on the hardware phase difference and absolute phase information of the electrical metering device includes: determining the number of cycle sampling points of the original sampling data sequence; determining the sampling phase difference between each signal in the multiple signals according to the number of cycle sampling points; and determining the calibration phase value corresponding to each sampled signal according to the hardware phase difference, the sampling phase difference, and the absolute phase information.
[0112] In this embodiment, taking a three-phase electrical signal as the target signal as an example, the target signal includes three voltage signals and three current signals. The three voltage signals are phase A voltage signal, phase B voltage signal, and phase C voltage signal. The three current signals are phase A current signal, phase B current signal, and phase C current signal.
[0113] When sampling the target signal, time-division multiplexing sampling is performed on the above 6 signals based on fixed sampling detection.
[0114] For example, each signal is sampled at equal intervals according to a fixed sampling rate to obtain the original sampling sequence, which is denoted as f. s According to the Nyquist theorem, the sampling rate is denoted as f. s Satisfy the following formula (1):
[0115] f s ≥2f Max (1)
[0116] Among them, f s f is the sampling frequency at which the target signal is sampled. Max This refers to the highest frequency value that needs to be detected in the target signal. For example, at the mains frequency (50Hz), when analyzing parameters down to the 64th harmonic, f... Max =50 × 64 = 3200Hz. Optionally, the sampling frequency is 2.56 to 4 times the highest frequency value mentioned above, then f s =3200×4=12800Hz.
[0117] At a sampling rate of 12800Hz, if the fundamental frequency of the target signal is 50Hz, then the number of sampling points per cycle is 256.
[0118] For example, by detecting the zero-crossing position of the original sampled data, a precise cycle sampling circuit can be obtained, and then the fundamental frequency can be calculated based on the original sampling rate and the number of precise cycle points using the following formula (2):
[0119]
[0120] Among them, f b f is the fundamental frequency of the target signal. s Where N is the sampling frequency. b This represents the number of sampling points for the cycle.
[0121] Based on the above number of sampling points, the sampling phase difference between each signal in the multi-channel signal can be calculated.
[0122] Let the hardware phase difference be Absolute phase information is The sampling phase difference is The calibration phase value corresponding to each sampling signal can then be calculated using the following formula (3).
[0123]
[0124] in, To calibrate the phase value, For absolute phase information, For sampling phase difference, This refers to the hardware phase difference.
[0125] This application improves the accuracy of phase measurement by processing hardware phase difference and sampling phase difference separately.
[0126] In some embodiments of this application, optionally, the original sampled data sequence is subjected to interpolation and resampling processing to obtain a resampled data sequence, including:
[0127] Interpolation resampling is performed using the following formula (4):
[0128] y m =x n +(x n+1 -x n )×(Δm-n); (4)
[0129] Among them, y m For the m-th data in the resampled data sequence, x n x is the nth data point in the original sampled data. n+1 The n+1th data point in the original sampled data, where Δ is the step value for interpolation resampling (e.g., ...). Figure 5 The difference step value shown), Δm is the resampling time of the m-th resampling point (i.e., the resampling time of the m-th sampling point at...). Figure 5 (The coordinates shown on the time axis) n is the floor value of Δm.
[0130] In this embodiment, the original sampled data sequence obtained by equal-interval sampling is interpolated and resampled at a set resampling frequency to obtain a resampled sequence of exactly 256 points per cycle. The purpose of this operation is to ensure that the obtained resampled data sequence meets the conditions for subsequent FFT operations, namely, the number of operation points is 2 to the power of n, and the data involved in the operation is data from an entire cycle. For example, Figure 4 The diagram shows a schematic representation of the original sampled data sequence in some embodiments of this application. Figure 5 The diagram illustrates resampled data sequences in some embodiments of this application, such as... Figure 4 and Figure 5 As shown, where X0, X1...X n+1 These are the original sampled data points, Y0, Y1...Y m For resampled data points, interpolation resampling can satisfy the conditions for FFT operation.
[0131] The principle of resampling is to use the original sampled data sequence, where the number of cycles may not be a set value, and then use an interpolation algorithm to calculate a resampled sequence with the set number of cycles. Assume the actual number of cycles in the original sampled data sequence is N. b The required number of cycles is set to 256. The interpolation resampling step value Δ can be determined by the following formula (5), and the resampling frequency f can be determined by the following formula (6). s ′:
[0132]
[0133] f s =256f b (6);
[0134] Where Δ is the step value for interpolation resampling, and N b f represents the actual number of cycles in the original sampled data sequence. s ′ is the resampling frequency, f b The fundamental frequency of the target signal.
[0135] The formula used for interpolation resampling is as shown in formula (4) above.
[0136] This application improves the accuracy and efficiency of calibration phase value calculation by interpolating and resampling the original sampled data sequence, thereby meeting the format requirements of FFT operation.
[0137] In some embodiments of this application, optionally, the harmonic data includes the real and imaginary parts of each harmonic; determining the absolute phase information of the target signal based on the harmonic data includes:
[0138] The absolute phase information is determined by the following formula (7):
[0139]
[0140] in, For the absolute phase information of the nth harmonic, im n Let re be the imaginary part of the nth harmonic. n Let be the real part of the nth harmonic.
[0141] In this embodiment, by performing a Fast Fourier Transform on the resampled data sequence, the real part data re of each harmonic can be obtained. n imaginary part data n Then, the absolute phase information of each harmonic can be calculated using the above formula (7).
[0142] Among them, due to the characteristics of the FFT algorithm, the harmonic frequency resolution f of the calculation result is... n The following formula (8) must be satisfied:
[0143]
[0144] Among them, f n f is the harmonic frequency resolution after FFT operation. s ′ is the resampling frequency, f b Let N be the fundamental frequency of the target signal, N be the number of resampling points for the FFT operation, and k be the number of cycles for the FFT operation. Wherein, when k = 1, f n =f b That is, the harmonic frequency resolution is equal to the fundamental frequency.
[0145] Substituting into formula (7), the harmonic frequency resolution f calculated according to formula (8) is obtained. n When k=1, f n =f b At this point, n=0 represents the DC component data, and n=1 represents the fundamental frequency data. The absolute phase of the fundamental frequency, i.e., the absolute phase information mentioned above, is denoted as...
[0146] In some embodiments of this application, optionally, determining the sampling phase difference between each of the multiple signals includes:
[0147] The sampling phase difference is determined by the following formula (9):
[0148]
[0149] in, Let N be the sampling phase difference, k be the phase difference multiple of the multiple signals, and N be the sampling phase difference. b This represents the number of sampling points for the cycle.
[0150] In this embodiment, the sampling phase difference between each signal is calculated using the above formula (9).
[0151] The derivation of formula (9) is shown in formula (10) below:
[0152]
[0153] in, The sampling phase difference is denoted as m, where m is the phase difference multiple of each signal.
[0154] Taking the asynchronous sampling circuit structure of a single-channel ADC multi-channel signal as an example, the cyclic sampling order is Ua, Ub, Uc, Ia, Ib, Ic, then the phase difference multiples of each channel are 0, 1, 2, 3, 4, 5 respectively.
[0155] In some embodiments of this application, optionally, after determining the calibration phase value based on the hardware phase difference and absolute phase information of the electrical metering device, the determination method further includes: obtaining a standard phase value; and correcting the hardware phase difference according to the standard phase value and the calibration phase value.
[0156] In this embodiment, for hardware phase difference After determining the relative phase value, the hardware phase difference can be... Calibration is performed. For example, the hardware phase difference can be calibrated using the following formula (11). Perform calibration:
[0157]
[0158] in, For the calibrated hardware phase difference, The hardware phase difference before calibration. The relative phase value, This refers to the obtained standard phase value. For example, the standard phase value is a relative value and can be obtained through external input.
[0159] Optionally, in some embodiments of this application, the target signal includes multiple signals, and the multiple signals include a first signal; after determining the calibration phase value based on the hardware phase difference and absolute phase information of the electrical metering device, the determination method further includes: determining the relative phase value corresponding to each of the multiple signals according to the first calibration phase value corresponding to the first signal.
[0160] In this embodiment, taking a three-phase electrical signal as the target signal as an example, the multi-channel signal of the three-phase electrical signal includes three-phase voltage signals and three-phase current signals. Let the first signal be the A-phase voltage signal Ua, and the first calibration phase value corresponding to the first signal be... The relative phase value corresponding to each signal is then calculated using the following formulas (12) to (17):
[0161]
[0162] in, This represents the relative phase value of the A-phase voltage signal. This is the calibration phase value corresponding to the A-phase voltage signal. This represents the relative phase value of the B-phase voltage signal. This is the calibration phase value corresponding to the B-phase voltage signal. This represents the relative phase value of the C-phase voltage signal. This is the calibration phase value corresponding to the C-phase voltage signal. This represents the relative phase value of the A-phase current signal. This is the calibration phase value corresponding to the A-phase current signal. This represents the relative phase value of the B-phase current signal. This is the calibration phase value corresponding to the B-phase current signal. This represents the relative phase value of the C-phase current signal. This is the calibration phase value corresponding to the C-phase current signal.
[0163] In some embodiments of this application, a device for determining the calibration phase value of an electrical metering device is provided. Figure 6 The following is a structural block diagram of a device for determining the calibration phase value of an electrical metering device according to some embodiments of this application, such as... Figure 6 As shown, the determining device 600 includes: a sampling module 602 for sampling the target signal to obtain an original sampled data sequence; a processing module 604 for performing interpolation and resampling processing on the original sampled data sequence to obtain a resampled data sequence, the resampled data sequence including continuous integer cycle data; and performing fast Fourier transform processing on the continuous integer cycle data to obtain harmonic data of each harmonic in the resampled data sequence; and a determining module 606 for determining the absolute phase information of the target signal based on the harmonic data; and determining the calibration phase value based on the hardware phase difference and absolute phase information of the electrical metering equipment.
[0164] In this embodiment, the electricity metering equipment includes, but is not limited to, AC standard meters, oscilloscopes, and portable energy meters. The energy standard meter can simultaneously measure multiple signals. Taking a three-phase AC standard meter as an example, it needs to be able to simultaneously measure a total of six signals, including three-phase voltages and three-phase currents.
[0165] The working principle of the three-phase AC standard meter is to use the input values of the three address lines A, B, and C controlled by the MCU (Micro Controller Unit) to cyclically select the independent input / output terminals, including terminals X0 to X5, with the common output / input terminal X, so as to connect the six sampling signals to the sampling input port of the ADC in a time-division manner.
[0166] In addition, during the time interval between the sequential selection of two adjacent channels of the multi-channel analog switch chip, the MCU needs to output a conversion trigger signal to the single-channel ADC (analog-to-digital converter) chip and read the AD (analog-to-digital) conversion value of that selection signal through the connected SPI (Serial Peripheral Interface) data bus. This process is executed continuously, allowing the sampling data of six voltage and current channels to be continuously input into the MCU, enabling the MCU to calculate the frequency, amplitude, phase, and power value of each signal.
[0167] Theoretically, when the measured voltage and current signals are both sinusoidal waves, and the sampling rate is much higher than the frequency of each signal, this time-division multiplexing sampling method has no effect on the calculated frequency, amplitude, and power of the measured signal, but it does have a direct impact on the phase value. This is because the other five channels each have a sampling trigger interval relative to the A-phase voltage, and the interval time increases sequentially from the first to the last. Using such asynchronous sampling data inevitably leads to a phase difference between the other five phases and the A-phase voltage due to the sampling trigger interval, i.e., a sampling phase difference. Furthermore, this sampling phase difference is positively correlated with the frequency of the measured voltage and current signal; the higher the frequency, the larger the sampling phase difference.
[0168] When the signal being measured is a single-frequency signal, such as when used only in a 50Hz environment, the aforementioned sampling phase difference can be eliminated along with the hardware phase difference during phase calibration. However, once the frequency of the signal being measured changes, even if the hardware phase difference remains unchanged, the sampling phase difference will inevitably change, causing the phase calibration coefficient to fail and ultimately resulting in a deviation in the calculated phase value.
[0169] To address the aforementioned issues, this application performs interpolation and resampling on the original sampled data sequence obtained from sampling the target signal, thereby obtaining a resampled data sequence that satisfies a specific number of sampling points for one cycle, i.e., includes continuous integer cycle data. The target signal is also the signal being measured. This operation ensures that the data in the resampled data sequence is suitable for Fast Fourier Transform (FFT) processing.
[0170] After obtaining the resampled data sequence including continuous integer cycle data, the data sequence is processed by Fast Fourier Transform to obtain the harmonic data of each harmonic, including the harmonic data of the 1st harmonic, the harmonic data of the 2nd harmonic, ... and the harmonic data of the nth harmonic.
[0171] After obtaining the harmonic data for each harmonic, the absolute phase information of the target signal, i.e., the measured signal, can be calculated based on the harmonic data. Combined with the known hardware phase difference of the electrical metering equipment, the calibration phase value can be obtained.
[0172] This application separates the sampling phase difference from the hardware phase difference, processing the sampling phase difference individually after each sampling. Therefore, it can solve the problem of deviation between the phase value obtained by the electrical metering equipment and the actual value when the frequency of the measured signal is non-standard at the software level. This method does not require modification to the original electrical metering equipment hardware, such as the hardware of a three-phase AC energy meter, does not increase hardware costs, and does not change the original calibration process. It can improve the accuracy of phase measurement of electrical measuring equipment at low cost and with high compatibility.
[0173] In some embodiments of this application, a device for determining the calibration phase value of an electrical metering device is provided. Figure 7 The following is a structural block diagram of a device for determining the calibration phase value of an electrical metering device according to some embodiments of this application, such as... Figure 7 As shown, the determining device 700 includes: a memory 702 for storing programs or instructions; and a processor 704 for executing programs or instructions to implement the steps of the method for determining the calibration phase value of the electrical metering device as provided in any of the above embodiments, thus achieving the same technical effect. To avoid repetition, it will not be described again here.
[0174] In some embodiments of this application, a readable storage medium is provided, on which a program or instructions are stored. When the program or instructions are executed by a processor, they implement the steps of the method for determining the calibration phase value of the electrical metering device as provided in any of the above embodiments, and thus can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0175] In some embodiments of this application, an electrical metering device is provided, including: a device for determining the calibration phase value of the electrical metering device as provided in any of the above embodiments, and / or a readable storage medium as provided in any of the above embodiments. Therefore, the same technical effect can be achieved, and to avoid repetition, it will not be described again here.
[0176] The methods can be implemented in various ways depending on specific features and / or example applications. For example, these methods can be implemented by a combination of hardware, firmware, and / or software. For instance, in a hardware implementation, the processor can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, electronic devices, other device units for performing the functions described above, and / or combinations thereof.
[0177] A computer-readable storage medium can be a tangible device that holds and stores instructions for use by an instruction execution device. A computer-readable storage medium can be an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing, but is not limited thereto. A non-exhaustive list of more specific examples of computer-readable storage media includes: portable computer floppy disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory, static random-access memory (SRAM), portable optical disc read-only memory (CD-ROM), digital video disc (DVD), memory cards, floppy disks, encoding mechanical devices (e.g., punched cards or grooves with raised structures for recording instructions), and any suitable combination of the foregoing. The computer-readable storage medium used herein should not be construed as the transmission signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media, or electrical signals transmitted through wires.
[0178] In the description of this application, the term "multiple" refers to two or more. Unless otherwise expressly defined, the terms "upper," "lower," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. The terms "connection," "installation," "fixing," etc., should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0179] In the description of this application, the terms "one embodiment," "some embodiments," "specific embodiment," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of this application. In this application, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0180] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for determining the calibration phase value of an electrical metering device, characterized in that, The determination method includes: The target signal is sampled to obtain the original sampled data sequence; The original sampled data sequence is subjected to interpolation and resampling to obtain a resampled data sequence, which includes continuous integer cycle data. The continuous integer-cycle data is processed by Fast Fourier Transform to obtain the harmonic data of each harmonic in the resampled data sequence. Based on the harmonic data, determine the absolute phase information of the target signal; The calibration phase value is determined based on the hardware phase difference of the electrical metering device and the absolute phase information. The target signal includes multiple signals; The sampling of the target signal includes: The multiple signals are sampled separately according to a preset sampling interval; The step of determining the calibration phase value based on the hardware phase difference of the electrical metering device and the absolute phase information includes: Determine the number of cycle sampling points in the original sampled data sequence; Based on the number of frequency sampling points, determine the sampling phase difference between each of the multiple signals; The calibration phase value corresponding to each sampling signal is determined based on the hardware phase difference, the sampling phase difference, and the absolute phase information.
2. The determination method according to claim 1, characterized in that, The original sampled data sequence is interpolated and resampled to obtain a resampled data sequence, including: Interpolation resampling is performed using the following formula: ; Among them, y m For the m-th data in the resampled data sequence, x n x is the nth data point in the original sampled data. n+1 This refers to the (n+1)th data point in the original sampled data. The step value for interpolation resampling processing. Let n be the resampling time for the m-th resampling point, and n be the resampling time for the m-th resampling point. The floor value.
3. The determination method according to claim 1, characterized in that, The harmonic data includes the real and imaginary parts of each harmonic; determining the absolute phase information of the target signal based on the harmonic data includes: The absolute phase information is determined using the following formula: ; in, This represents the absolute phase information of the nth harmonic. The imaginary part of the nth harmonic is given. Let be the real part of the nth harmonic.
4. The determination method according to claim 1, characterized in that, Determining the sampling phase difference between each of the multiple signals includes: The sampling phase difference is determined by the following formula: ; in, Let N be the sampling phase difference, k be the phase difference multiple of the multi-channel signals, and N be the sampling phase difference. b The number of sampling points for the specified cycle.
5. The determination method according to any one of claims 1 to 4, characterized in that, After determining the calibration phase value based on the hardware phase difference of the electrical metering device and the absolute phase information, the determination method further includes: Obtain the standard phase value; The hardware phase difference is corrected based on the standard phase value and the calibrated phase value.
6. The determining method according to any one of claims 1 to 4, characterized in that, The target signal includes multiple signals, and the multiple signals include a first signal; after determining the calibration phase value based on the hardware phase difference of the electrical metering device and the absolute phase information, the determination method further includes: Based on the first calibration phase value corresponding to the first signal, determine the relative phase value corresponding to each of the multiple signals.
7. A device for determining the calibration phase value of an electrical metering device, characterized in that, The determining device includes: The sampling module is used to sample the target signal to obtain the original sampled data sequence; A processing module is configured to perform interpolation and resampling processing on the original sampled data sequence to obtain a resampled data sequence, wherein the resampled data sequence includes continuous integer-cycle data; and The continuous integer-cycle data is processed by Fast Fourier Transform to obtain the harmonic data of each harmonic in the resampled data sequence. The determining module is used to determine the absolute phase information of the target signal based on the harmonic data; and The calibration phase value is determined based on the hardware phase difference of the electrical metering device and the absolute phase information. The target signal includes multiple signals; the sampling module is used to sample the multiple signals separately according to a preset sampling interval; The determining module is used to determine the number of cycle sampling points in the original sampled data sequence; determine the sampling phase difference between each signal in the multiple signals based on the number of cycle sampling points; and determine the calibration phase value corresponding to each sampled signal based on the hardware phase difference, the sampling phase difference, and the absolute phase information.
8. A device for determining the calibration phase value of an electrical metering device, characterized in that, include: Memory, used to store programs or instructions; A processor for implementing the steps of the determining method as described in any one of claims 1 to 6 when executing the program or instructions.
9. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or instructions are executed by the processor, they implement the steps of the determination method as described in any one of claims 1 to 6.
10. An electricity metering device, characterized in that, include: The apparatus for determining the calibration phase value of an electrical metering device as described in claim 7 or 8; and / or The readable storage medium as described in claim 9.
Citation Information
Patent Citations
Phase error detection apparatus, phase error detection method, and reproduction apparatus
CN102025369A
Electric energy metering method based on discrete frequency spectrum correction
CN107390022A