Power grid equipment frequency adaptive resampling method based on dynamic scale factor
By dynamically adjusting the sampling frequency and interpolation method of power grid equipment, the problems of inaccurate data collection caused by grid frequency fluctuations and the high complexity of traditional interpolation methods are solved, efficient and accurate data recovery and frequency detection are achieved, and the automation level of the power system is improved.
Patent Information
- Application Number
- CN202510702766.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-09-12
AI Technical Summary
When the grid frequency fluctuates, grid equipment uses fixed-frequency sampling, which leads to inaccurate data collection. Traditional interpolation methods are computationally complex and have poor adaptability. Frequency zero-crossing detection is susceptible to noise interference and has a high misjudgment rate.
An adaptive resampling method for power grid equipment frequency based on dynamic proportional factor is adopted. The sampling strategy is dynamically adjusted by detecting the real-time frequency of the power grid. Combined with multi-channel differential processing and linear interpolation, adaptive resampling of data and lost point recovery are achieved.
It improves the accuracy and reliability of data collection of power grid equipment, reduces sampling errors and misjudgment rates, and enhances the automation level of the power system.
Smart Images

Figure CN120629753A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power system distribution automation, and specifically relates to a method for adaptively resampling the frequency of power grid equipment when the power grid frequency fluctuates. The method aims to solve technical problems such as inaccurate data sampling and missed points of power grid equipment caused by power grid frequency fluctuations and communication interference during power system operation. Background Art
[0002] Some traditional power grid equipment uses fixed-frequency sampling. However, the actual power system operating environment is complex and volatile. Grid frequency fluctuates due to factors such as dynamic load changes and intermittent access to renewable energy generation. When the fixed sampling frequency of the grid equipment does not match the actual grid frequency, spectral leakage occurs during FFT (Fast Fourier Transform) analysis, leading to increased harmonic amplitude measurement errors. For example, when the frequency increases to 52Hz, a sampling strategy of 160 points per cycle will result in the actual number of sampling points per cycle being reduced to 153, increasing harmonic analysis errors.
[0003] In the existing technology, the repair of interference loss points mainly relies on linear interpolation or polynomial fitting algorithms, usually using cubic spline interpolation, but these methods have high computational complexity (O(n 3 ), unable to meet the real-time requirements of embedded systems. When addressing communication point loss, traditional interpolation methods only consider the linear relationship of the data, failing to fully account for the dynamic characteristics of the signal and the impact of frequency changes on the data. This significantly reduces the accuracy and reliability of data processing under complex operating conditions. Therefore, a method that can adaptively resample the frequency of power grid equipment based on grid frequency changes is urgently needed to improve the accuracy and reliability of power system monitoring data. Summary of the Invention
[0004] The main technical problems to be solved by the present invention are: (1) Some power grid equipment samples at a fixed sampling frequency. When the power grid frequency changes, the data collected at the fixed frequency is not a complete cycle, resulting in a large error in the acquisition accuracy and failure to meet the requirements of acquisition and relay protection; (2) Communication interference or noise interference causes data loss. Traditional methods generally rely on complex modes such as slope calculation or multi-point fitting, which are computationally complex, especially inefficient multi-channel processing; (3) The problems with frequency zero-crossing detection are noise sensitivity and rough time calculation. The zero-crossing point is judged only by the change in signal polarity, which is easily affected by high-order harmonics or noise interference and has a high misjudgment rate.
[0005] In order to solve the above technical problems, the present invention proposes a resampling method based on a frequency-adaptive dynamic scaling factor. This method can dynamically adjust the resampling strategy according to the real-time frequency of the power grid to adapt to changes in the power grid frequency. The technical solution adopted by the present invention is as follows:
[0006] A method for adaptively resampling the frequency of power grid equipment based on a dynamic scaling factor comprises the following steps:
[0007] The data acquisition unit collects data at fixed time intervals. The power grid equipment compares the packet numbers of adjacent data packets. If the packet numbers are discontinuous, it is considered that there is a point loss. When it is detected that the number of consecutive lost points is less than or equal to 3, the linear interpolation method is used to fill in the points.
[0008] Prioritize dynamically selecting the first voltage signal channel with a voltage amplitude ≥ the voltage threshold in the voltage signal channel for zero-crossing detection and real-time frequency calculation. If no suitable voltage signal channel is found, further search for a current signal channel with a current amplitude ≥ the current threshold in the current signal channel for zero-crossing detection and real-time frequency calculation;
[0009] When the calculated real-time frequency deviates from the nominal frequency, the power grid equipment introduces a dynamic proportional factor to control the data acquisition unit to resample. When the real-time frequency is higher than the nominal frequency, the sampling points are increased, and when the real-time frequency is lower than the nominal frequency, the sampling points are reduced.
[0010] The resampled data are written into a calculation ring buffer of the power grid device in a cyclic order, and FFT calculation is performed on the resampled data to obtain power grid parameters.
[0011] Preferably, the method of introducing a dynamic proportional factor to control the data acquisition unit to perform resampling in the power grid equipment is:
[0012] The dynamic scaling factor is Where f0 is the nominal frequency and f is the real-time frequency;
[0013] Virtual position calculation: For each index i of the resampled data point, calculate the virtual position pos. The calculation formula of virtual position pos is: pos = i*R(i = 0, 1, 2...Ntarget), where Ntarget is a fixed value for the number of target points.
[0014] Calculate the integer part idx and the fractional part frac of the virtual position pos; idx = (int)(pos), idx is the integer of pos, frac = pos-idx;
[0015] The actual indexes idx0 and idx1 in the calculation ring buffer are obtained by modulo operation, and the fractional part of the virtual position is cached as the interpolation starting point: idx0 = idx% L cache , L cache To calculate the length of the circular buffer, cache the interpolation end point: idx1 = (idx0 + 1) % L cache .
[0016] Linear interpolation calculation: perform linear interpolation on each channel sampling point, introduce the channel gain compensation coefficient k, and calculate the value y of the resampled interpolation point based on the sampling values of two points at a known fixed frequency. out [i,c], the calculation formula is:
[0017] y out [i,c]=(x[idx0,c]*(1-frac)+x[ixd1,c]*frac)*k.
[0018] Preferably, when resampling based on the dynamic scale factor, data of 2 cycles are cached, the target number of points of each cycle of data is 32 points, and one point is taken every 5 points.
[0019] Preferably, the specific method of using the linear interpolation method to fill in the points is:
[0020] Read the latest 10 cycles of data from the sampling ring buffer, build an extrapolation formula based on two adjacent normal sampling points, and perform interpolation calculation on the mth lost point to obtain the mth lost point value y m , m∈[1,3], the interpolation calculation formula is: y m =(m+1)×y m-2 -y m-1 ; Among them, y m-1 is the nearest normal point value before the mth lost point, y m-2 It is the previous normal point value of the nearest normal point before the lost point.
[0021] Preferably, the steps of zero-crossing point detection and real-time frequency calculation are as follows:
[0022] The voltage signal channel or current signal channel whose amplitude exceeds the threshold is selected as the zero-crossing detection signal source, and the 400 most recent sampling points of the selected voltage signal channel or current signal channel are extracted from the frequency ring buffer and recorded as the array data_f
[400] ;
[0023] Search the array data_f
[400] . If four consecutive sampling points meet the symbol sequence (+, +, -, -) and the amplitude conditions (q>s)&&(s≥0)&&(u≤0)&&(u>v), it is determined to be a zero-crossing point. +: represents a positive number, -: represents a negative number, 0 is the midpoint between positive and negative numbers, used to determine the zero point, q, s, u, v represent the sampling values of the four points;
[0024] For each zero-crossing point, linear interpolation is used to calculate the time offset of the zero-crossing point: Δt_offset = (q / (qv))*3*arr_val; arr_val is the value of the ARR register of the timer, and Δt_offset is the time offset of the zero-crossing point relative to the sampling point;
[0025] Combined with the timer count value, the exact time of zero crossing is obtained: t = i*arr_val + Δt_offset;
[0026] According to the time t1 and t2 of two consecutive zero-crossing points, the time difference between the two adjacent zero-crossing points is calculated as the period T, T=t2-t1;
[0027] Calculate the real-time frequency f of the power grid, f = 1 / T.
[0028] Preferably, the data collected by the data collection unit includes: three-phase voltage signals Ua, Ub, Uc, three-phase current signals Ia, Ib, Ic, zero voltage signal U0, and zero current signal I0.
[0029] Preferably, the annular buffer area adopts a first-in-first-out buffer mechanism.
[0030] Beneficial technical effects of the present invention:
[0031] The present invention detects and calculates the real-time frequency of the power grid, and dynamically adjusts the sampling interval of the data acquisition unit by increasing or decreasing the sampling points, so that the sampling timing is strictly synchronized with the actual signal period. Dynamic frequency tracking technology is used to calculate the dynamic proportional factor in real time, achieving adaptive matching of the sampling frequency with the power grid frequency. This supports a wide frequency range of 40Hz-60Hz, and reduces the synchronization error between the sampling point and the signal waveform to within 0.3%, effectively solving the sampling distortion problem under power grid frequency fluctuations. Multi-channel differentiated processing of the voltage signal channel and the current signal channel is used for linear interpolation and point filling, forming a set of efficient, accurate, and low-cost data loss point recovery solutions. This solves the problems of high complexity and poor adaptability of traditional interpolation methods in power system applications, and has high execution efficiency in embedded systems. The present invention breaks through the traditional static sampling mode and constructs a closed-loop system of "real-time frequency perception-sampling strategy adaptation-precise data acquisition", providing key technical support for high-precision monitoring and reliable control of smart distribution networks, and significantly improving the level of power system automation. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0033] Figure 1 This is a schematic diagram of the structure and connection of a digital FTU according to the first embodiment of the present invention;
[0034] Figure 2 This is a flowchart of the frequency adaptive resampling method according to the first embodiment of the present invention. DETAILED DESCRIPTION
[0035] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, but not all of the embodiments.
[0036] Example 1
[0037] like Figure 1 As shown, an embodiment of the present invention provides a method for adaptively resampling grid frequency changes in a digital FTU (feeder terminal unit). The FTU model is XNSZ-FTU-3Z, and includes a main control unit and a storage unit. It is suitable for feeder monitoring in 10kV distribution networks. The main control unit is an STM32F407VET6 (STMicroelectronics product, 32-bit Cortex-M4 core, 168MHz main frequency, supporting DMA data transmission). The main control unit communicates with the ADMU via the 485 bus. The ADMU samples at a fixed interval of 125us and supports 8-channel parallel sampling. The timer TIM8 (divide-by-four, 42M) is used to control the periodic reading of ADMU collected data. The storage unit uses 2M SRAM (S6R1616) for the ring buffer and 32M Flash (S29GL256S10TFI01) for storing configuration parameters and calibration coefficients.
[0038] The ADMU (Analog-Digital Multi-function Unit) is a module in digital pole-mounted circuit breakers. A crucial component of digital pole-mounted circuit breakers, the ADMU is primarily used to achieve primary and secondary integration, converting analog signals from primary equipment into digital signals for processing and transmission.
[0039] Figure 1 In the code, maintenance refers to communication with maintenance tools, CHT8305 is a temperature and humidity acquisition chip, RX8025T is a clock chip, and DC acquisition mainly involves battery voltage, opening and closing voltage, opening and closing current, energy storage current and other DC quantities. DM9000 is a network port chip (bottom-layer hardware), a driver for the physical layer, and 104 is just a protocol for the application layer; FTU communicates with the 4G module through the serial port, and the 4G module communicates with the main station to realize data interaction between FTU and the main station. The 101 communication protocol is a communication protocol between FTU and the main station; line loss is a unit for measuring electric energy, connected to the FTU serial port; the Bluetooth module and FTU are connected through the serial port for near-end maintenance; GPRS longitude and latitude positioning is connected to the FTU through the serial port. These functions are not related to the technical improvements of the present invention. Figure 1 The system architecture is shown.
[0040] like Figure 2As shown, a method for adaptively resampling the frequency of power grid equipment based on a dynamic scaling factor includes the following steps:
[0041] 1. Data collection and cache update.
[0042] Figure 1 The ADMU in the system serves as a data acquisition unit, collecting voltage, current, zero voltage, and zero current data at a fixed interval of 125 μs (corresponding to a nominal frequency of 50 Hz and sampling at 160 points / cycle). The FTU communicates with the ADMU to read the data collected by the ADMU. The data collected by the ADMU is 8 signal channels, including: three-phase voltage signals Ua, Ub, Uc, three-phase current signals Ia, Ib, Ic, zero voltage signal U0, and zero current signal I0.
[0043] This fixed-interval sampling method ensures the regularity and stability of data collection. The collected data is output in the form of data packets, each containing a certain number of data points and accompanied by a packet sequence number for subsequent data management and point loss detection.
[0044] A large-capacity storage unit SRAM is provided in the FTU, and a circular buffer area (essentially an array) is provided in the SRAM. The CPU (the main control unit of the FTU, STM32F407VET6) accesses the SRAM through a pointer to read the circular buffer area data, and adopts a FIFO (first-in-first-out) strategy to cyclically read the circular buffer area data. When new cycle data arrives, the earliest data is automatically overwritten to ensure that the latest 10 cycle data are always stored in the storage unit, providing real-time and effective data support for subsequent data processing. In the embodiment of the present invention, 10 cycle data are always stored in the storage unit SRAM. On the one hand, this is to take into account the size of the memory and the limited storage resources of the embedded unit. On the other hand, the amount of data can meet the needs of the subsequent interpolation processing data. One cycle data contains eight data packets, namely three-phase voltage data, three-phase current data, one zero-voltage data and one zero-current data.
[0045] 2. Data verification and lost data repair.
[0046] The digital FTU performs data verification by comparing the sequence numbers of adjacent data packets. If the sequence numbers are discontinuous, it is considered that there is a point loss. If the number of consecutive missing points is less than or equal to 3, linear interpolation is used to fill in the missing points. If the number of consecutive missing points is greater than 3, the data is considered invalid.
[0047] Calculation cache update: In each cycle of sampling data, one point is taken every 5 points, and the 32 points of each cycle of data are written into the calculation ring buffer in sequence for subsequent effective value calculation.
[0048] 3. Zero-crossing point detection and real-time frequency calculation.
[0049] Channel selection: The first voltage signal channel with a voltage amplitude ≥ the voltage threshold (for example, the voltage threshold is 9.5V) is dynamically selected in the voltage signal channel for zero-crossing detection and real-time frequency calculation. If no suitable voltage signal channel is found, the current signal channel with a current amplitude ≥ the current threshold (for example, the current threshold is 0.95A) can be further searched for to perform zero-crossing detection and real-time frequency calculation, ensuring the reliability of zero-crossing detection under high signal-to-noise ratio conditions.
[0050] 4. Frequency judgment and resampling strategy selection.
[0051] The calculated real-time frequency is compared with the nominal frequency (eg, 50 Hz). When the real-time frequency deviates from the nominal frequency reference value (|Δf|>0.02 Hz), an interpolation strategy or a sampling strategy is enabled for resampling.
[0052] Deviation from nominal frequency: Resampling is triggered when the real-time frequency f meets the frequency increase (f>50.02Hz) or frequency decrease (f<49.98Hz).
[0053] In the high-frequency scenario, if f > 50.02 Hz, indicating an increase in the real-time frequency of the power grid, an interpolation strategy is used to increase the number of sampling points for resampling, capturing the detailed features of the high-frequency signal more precisely and ensuring that the data accurately reflects the signal changes.
[0054] In the low-frequency scenario, f < 49.98 Hz indicates a decrease in the real-time grid frequency. A sampling strategy is used to reduce the number of sampling points for resampling, improving data processing efficiency. After resampling is complete, the cached data is updated.
[0055] By increasing or decreasing the number of sampling points, the sampling timing is strictly synchronized with the actual signal period.
[0056] 5. Dynamic resampling is performed.
[0057] Dynamic scale factor: Where f0 is the original nominal frequency, and f is the current real-time frequency; for example, at 52 Hz, R = 0.96.
[0058] Virtual position calculation: For each index i of the resampled data point, calculate the virtual position pos. Two cycles of data are cached for virtual position calculation. The target number of points per cycle is 32, and a point is taken every 5 points. The virtual position pos is calculated using the formula: pos = i * R(i = 0, 1, 2, ... Ntarget), where Ntarget is the target number of points, fixed at 32.
[0059] Calculate the integer part idx and the fractional part frac of the virtual position pos; idx = (int)(pos), idx is the integer of pos, and frac = pos-idx.
[0060] The actual indexes idx0 and idx1 in the calculation ring buffer are obtained by modulo operation, and the fractional part of the virtual position is cached as the interpolation starting point: idx0 = idx% L cache , L cache To calculate the length of the circular buffer, cache the interpolation end point: idx1 = (idx0 + 1) % L cache .
[0061] Linear interpolation calculation: perform linear interpolation on each channel sampling point, introduce the channel gain compensation coefficient k, and calculate the value y of the resampled interpolation point based on the sampling values of two points at a known fixed frequency. out [i,c], the calculation formula is:
[0062] y out [i,c]=(x[idx0,c]*(1-frac)+x[ixd1,c]*frac)*k.
[0063] Through dynamic frequency tracking technology, the dynamic proportional factor is calculated in real time, and the virtual sampling position is driven to dynamically adjust to achieve adaptive matching of the sampling frequency and the signal frequency. It supports a wide frequency range of 40Hz-60Hz, and the synchronization error between the sampling point and the signal waveform is reduced to within 0.3%, effectively solving the sampling distortion problem under grid frequency fluctuations.
[0064] 6. Perform FFT calculation to obtain grid parameters.
[0065] Effective value calculation: The resampled 32-point data of one cycle is read into the calculation ring buffer area to perform FFT calculation to obtain grid parameters such as fundamental wave amplitude and harmonic distortion rate.
[0066] 32 points per cycle are selected from the calculation ring buffer for FFT calculation. This data selection method reduces the amount of computation while ensuring accuracy and improves efficiency. An FFT calculation is performed on these 32 selected data points to obtain the signal's spectrum information. By analyzing this spectrum information, important parameters such as the signal's frequency content and harmonic content can be determined.
[0067] The first embodiment of the present invention implements adaptive adjustment of the sampling point through a dynamic scaling factor. When the grid frequency changes from 40 Hz to 60 Hz, the dynamic scaling factor of the resampling is automatically adjusted. Compared with the traditional fixed-frequency sampling method, the voltage and current detection accuracy is improved by 20%, effectively solving the sampling distortion problem under grid frequency fluctuations.
[0068] Embodiment 1 of the present invention breaks through the traditional static sampling mode and constructs a closed-loop system of "real-time frequency perception - sampling strategy adaptation - accurate data recovery". Through dynamic, differentiated and refined technical means, it solves industry pain points such as fixed frequency sampling desynchronization, inefficient interference loss repair, and poor frequency detection anti-interference performance. It provides key technical support for high-precision monitoring and reliable control of smart distribution networks, and significantly improves the automation level of power systems.
[0069] Example 2
[0070] The specific method of data verification and missing point repair in the first embodiment using linear interpolation method to fill in the points is:
[0071] The data of the latest 10 cycles are read from the sampling ring buffer, and the FIFO (first in first out) strategy is used to read the latest 10 cycle data.
[0072] Point loss detection: Determine whether a point has been lost by the difference in sequence numbers between adjacent data packets. For example, if the current packet sequence number is N, the next packet sequence number should be N+1. If the next packet sequence number is N+2, it is determined that one point has been lost.
[0073] Double-point prediction linear interpolation algorithm: Based on two adjacent normal sampling points, an extrapolation formula is constructed and interpolation calculation is performed on the mth missing point, m∈[1,3]. The interpolation calculation formula is: m =(m+1)×y m-2 -y m-1 ; Among them, y m-1 is the nearest normal point value before the mth lost point, y m-2 It is the previous normal point value of the nearest normal point before the point is lost.
[0074] When the number of consecutive lost points is ≤3, perform recursion based on the first two normal points (the closest normal point before the lost point, and the normal point before the closest normal point before the lost point):
[0075] The first lost point: y1=2y m-2 -y m-1 ;
[0076] The second lost point: y2=3y m-2 -2y m-1 ;
[0077] The third lost point: y3=4y m-2 -3y m-1 ;
[0078] Example: If the mth and m+1th points are lost, and the value of the m-1th point is known to be y m-1 =1000, m-2 point value y m-2 is 980, then the value of point m is y m ym =2×y m-1 -y m-2 =2×1000-980=1020, m+1 point value y m+1 y m+1 =3×y m-1 -2×y m-2 =3×1000-2×980=1040.
[0079] This lost point repair algorithm uses linear interpolation, which allows the values of multiple subsequent interpolation points to be calculated based on the values of the first two normal data points. Compared to traditional linear interpolation methods, this method does not require complex slope calculations or additional sampling point information, nor does it require additional parameters or complex operations. Its complexity is O(1), which greatly simplifies the calculation process. It has high execution efficiency in embedded systems, improving data processing efficiency and real-time performance.
[0080] The second embodiment of the present invention utilizes dual-point prediction linear recursion, multi-channel differentiated processing, and adaptive control of the number of lost points to form an efficient, accurate, and low-consumption data loss point recovery solution, which solves the problems of high complexity and poor adaptability of traditional interpolation methods in power system applications and has high execution efficiency in embedded systems.
[0081] Example 3
[0082] The specific method of zero-crossing point detection and real-time frequency calculation in the first embodiment is:
[0083] The voltage signal channel with a voltage amplitude ≥ 9.5V (voltage threshold) is dynamically selected as the signal source channel for zero-crossing detection. If the voltage signal channel does not meet the requirements, the current signal channel (current amplitude > 0.95A (current threshold)) is switched to for search and selection.
[0084] The 400 most recent sampling points (400 / 160=2.5, i.e., greater than two cycles to ensure that two zero crossing points can be found) of the selected voltage signal channel or current signal channel are extracted from the frequency ring buffer for subsequent zero crossing detection.
[0085] In terms of zero-crossing point detection, embodiment three of the present invention adopts an accurate judgment method based on waveform characteristics. Search for four consecutive points that meet the symbol sequence (+, +, -, -) and the amplitude conditions (q>s)&&(s≥0)&&(u≤0)&&(u>v), and determine them as zero-crossing points. This judgment method not only takes into account the basic characteristics of the signal zero-crossing point, but also combines the changing trend of the signal, which can more accurately capture the zero-crossing point and reduce misjudgments caused by factors such as noise interference. In the formula, +: represents a positive number; -: represents a negative number; 0 is the midpoint between positive and negative numbers, and is used to determine the zero point; q, s, u, v represent the sampling values of the four points of the selected channel. If the channel selected is a voltage signal channel, q, s, u, v are the voltage sampling values.
[0086] A noise suppression strategy combining sign changes at four sampling points with interpolation: Zero crossings are determined by sign changes at four consecutive sampling points (+, +, -, -), and linear interpolation is used to improve time resolution. This strategy, combined with waveform slope and polarity changes, eliminates unipolar noise interference, reducing the false positive rate to below 0.1%. Linear interpolation, based on the waveform slope near the zero crossing and the timer count value, improves time resolution and ensures high frequency calculation accuracy.
[0087] Assume that among the four sampling points w, w+1, w+2, and w+3, q is the value of the w sampling point, s is the value of the w+1 sampling point, u is the value of the w+2 sampling point, and v is the value of the w+3 sampling point. Assume that the signal changes linearly between w and w+3. For each zero crossing, use linear interpolation to calculate the time offset of the zero crossing:
[0088] Δt_offset=(q / (qv))*3*arr_val;
[0089] arr_val is the value of the ARR register of the timer, that is, the interval between each sampling point is arr_val clock cycles; Δt_offset: the time offset of the zero crossing point relative to the sampling point.
[0090] Combined with the timer count value, the exact time of zero crossing is obtained:
[0091] t=i*arr_val+Δt_offset;
[0092] Calculate the time difference between two consecutive zero crossings:
[0093] According to the time t1 and t2 of two adjacent zero-crossing points, the time difference between the two adjacent zero-crossing points is a period T, T=t2-t1.
[0094] The real-time frequency of the power grid is: f=1 / T.
[0095] The third embodiment of the present invention accurately captures the signal zero-crossing point through specific waveform feature detection combined with linear interpolation, and uses the timer clock cycle to quantify the time difference, thereby effectively improving the frequency calculation accuracy. It is suitable for scenarios requiring high-precision frequency measurement, such as power systems.
[0096] An embodiment of the present invention provides a method for adaptively resampling the frequency of power grid equipment based on a dynamic scaling factor, which can dynamically adjust the dynamic scaling factor according to the real-time frequency to adapt to changes in the power grid frequency; the ring buffer area adopts multi-use multi-channel parallel interpolation processing, and independently interpolates the data of each channel through nested loops, thereby improving the efficiency of data processing; the resampling algorithm adds a correction coefficient to further improve the accuracy and stability of the interpolation.
[0097] In the embodiments of the present invention, technical features not described in detail are all existing technologies or conventional technical means and will not be described in detail here.
[0098] Finally, it should be noted that the above embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them, and the protection scope of the present invention is not limited thereto. Those skilled in the art should understand that any person skilled in the art can modify or easily think of changes to the technical solutions described in the above embodiments within the technical scope disclosed by the present invention, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for adaptive resampling of power grid equipment frequency based on dynamic scaling factor, characterized in that: The following steps are involved: The data acquisition unit collects data at fixed time intervals. The power grid equipment compares the packet numbers of adjacent data packets. If the packet numbers are discontinuous, it is considered that there is a point loss. When it is detected that the number of consecutive lost points is less than or equal to 3, the linear interpolation method is used to fill in the points. Prioritize dynamically selecting the first voltage signal channel with a voltage amplitude ≥ the voltage threshold in the voltage signal channel for zero-crossing detection and real-time frequency calculation. If no suitable voltage signal channel is found, further search for a current signal channel with a current amplitude ≥ the current threshold in the current signal channel for zero-crossing detection and real-time frequency calculation; When the calculated real-time frequency deviates from the nominal frequency, the power grid equipment introduces a dynamic proportional factor to control the data acquisition unit to resample. When the real-time frequency is higher than the nominal frequency, the sampling points are increased, and when the real-time frequency is lower than the nominal frequency, the sampling points are reduced. The resampled data are written into a calculation ring buffer of the power grid device in a cyclic order, and FFT calculation is performed on the resampled data to obtain power grid parameters.
2. The method for adaptively resampling the frequency of power grid equipment based on a dynamic scaling factor according to claim 1, characterized in that: The method of introducing a dynamic proportional factor to control the data acquisition unit to perform resampling in the power grid equipment is: The dynamic scaling factor is Where f0 is the nominal frequency and f is the real-time frequency; Virtual position calculation: For each index i of the resampled data point, calculate the virtual position pos. The calculation formula of virtual position pos is: pos = i*R(i = 0, 1, 2...Ntarget), where Ntarget is a fixed value for the number of target points. Calculate the integer part idx and the fractional part frac of the virtual position pos; idx = (int)(pos), idx is the integer of pos, frac = pos-idx; The actual indexes idx0 and idx1 in the calculation ring buffer are obtained by modulo operation, and the fractional part of the virtual position is cached as the interpolation starting point: idx0 = idx% L cache , L cache To calculate the length of the circular buffer, cache the interpolation end point: idx1 = (idx0 + 1) % L cache . Linear interpolation calculation: perform linear interpolation on each channel sampling point, introduce the channel gain compensation coefficient k, and calculate the value y of the resampled interpolation point based on the sampling values of two points at a known fixed frequency. out [i,c], the calculation formula is: y out [i,c]=(x[idx0,c]*(1-frac)+x[ixd1,c]*frac)*k。 3. The method for adaptively resampling the frequency of power grid equipment based on a dynamic scaling factor according to claim 2, characterized in that: When resampling based on the dynamic scale factor, 2 cycles of data are cached. The target number of points per cycle is 32 points, and one point is taken every 5 points.
4. The method for adaptively resampling the frequency of power grid equipment based on a dynamic scaling factor according to claim 2, wherein: The specific method of using the linear interpolation method to fill in the points is: Read the latest 10 cycles of data from the sampling ring buffer, build an extrapolation formula based on two adjacent normal sampling points, and perform interpolation calculation on the mth lost point to obtain the mth lost point value y m , m∈[1,3], the interpolation calculation formula is: y m =(m+1)×y m-2 -y m-1 ; Among them, y m-1 is the nearest normal point value before the mth lost point, y m-2 It is the previous normal point value of the nearest normal point before the lost point.
5. The method for adaptively resampling the frequency of power grid equipment based on a dynamic scaling factor according to claim 4, characterized in that: The steps of zero-crossing point detection and real-time frequency calculation are as follows: The voltage signal channel or current signal channel whose amplitude exceeds the threshold is selected as the zero-crossing detection signal source, and the 400 most recent sampling points of the selected voltage signal channel or current signal channel are extracted from the frequency ring buffer and recorded as the array data_f[400]; Search the array data_f[400]. If four consecutive sampling points meet the symbol sequence (+, +, -, -) and the amplitude conditions (q>s)&&(s≥0)&&(u≤0)&&(u>v), it is determined to be a zero-crossing point. +: represents a positive number, -: represents a negative number, 0 is the midpoint between positive and negative numbers, used to determine the zero point, q, s, u, v represent the sampling values of the four points; For each zero-crossing point, linear interpolation is used to calculate the time offset of the zero-crossing point: Δt_offset = (q / (qv))*3*arr_val; arr_val is the value of the ARR register of the timer, and Δt_offset is the time offset of the zero-crossing point relative to the sampling point; Combined with the timer count value, the exact time of zero crossing is obtained: t = i*arr_val + Δt_offset; According to the time t1 and t2 of two consecutive zero-crossing points, the time difference between the two adjacent zero-crossing points is calculated as the period T, T=t2-t1; Calculate the real-time frequency f of the power grid, f = 1 / T.
6. The method for adaptively resampling the frequency of power grid equipment based on a dynamic scaling factor according to claim 5, characterized in that: The data collected by the data acquisition unit include: three-phase voltage signals Ua, Ub, Uc, three-phase current signals Ia, Ib, Ic, zero voltage signal U0, and zero current signal I0.
7. The method for adaptively resampling the frequency of power grid equipment based on a dynamic scaling factor according to claim 1, characterized in that: The ring buffer area adopts a first-in-first-out cache mechanism.
Citation Information
Cited By
Metering method, device and equipment of electric energy meter and medium
CN121577961A
Remote power grid simulation test method and system based on delay compensation data transmission
CN122043135A
Low-voltage power grid high-precision alternating current sampling method based on broadband harmonic scene
CN122259944A