Power grid harmonic fine compensation method and system
By improving the sparse Fourier transform (SFT) and time-frequency joint analysis, load harmonic fingerprint database, and deep reinforcement learning (DDPG) algorithm to optimize compensator parameters, the problems of low accuracy and insufficient adaptability of traditional power grid harmonic detection are solved, and high efficiency and flexibility of fine power grid harmonic compensation are achieved.
Patent Information
- Application Number
- CN202511625392.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-02-06
AI Technical Summary
Existing power grid harmonic detection methods rely on traditional Fourier transform, which reduces accuracy when processing non-stationary signals. Furthermore, the compensator control parameters lack adaptability and flexibility, making it difficult to cope with complex and ever-changing power grid environments.
Harmonic separation is performed using an improved sparse Fourier transform (SFT) and time-frequency joint analysis method. The compensator parameters are optimized by combining a pre-constructed load harmonic fingerprint database and the deep reinforcement learning DDPG algorithm. Multi-objective optimization is performed using the NSGA-II algorithm to generate the compensation current.
It improves the accuracy of harmonic frequency identification and the flexibility and adaptability of compensators, enabling them to exhibit optimal performance at different frequencies and comprehensively improve the power quality of the power grid.
Smart Images

Figure CN121484933A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power grid harmonic compensation technology, and in particular to a method and system for fine-grained power grid harmonic compensation. Background Technology
[0002] Power grid harmonic compensation technology refers to a series of technical means to reduce or eliminate harmonic components in the power system, thereby improving power quality, protecting electrical equipment, and ensuring the stable operation of the power grid. Harmonics in the power system are mainly caused by nonlinear loads, leading to distortions in voltage and current waveforms, which in turn affect the normal operation of the power grid. Therefore, how to utilize advanced technologies to improve the intelligence and safety of power grid harmonic compensation has become one of the urgent problems to be solved.
[0003] In the field of power grid harmonic compensation, existing harmonic detection methods usually rely on traditional Fourier transform, which leads to limitations in processing non-stationary signals. In particular, when the harmonic frequency changes rapidly or there are interharmonic components, the detection accuracy decreases. Furthermore, the adjustment of traditional compensator control parameters is usually based on fixed rules or empirical formulas, which lacks adaptability and flexibility, and often performs poorly when facing complex and ever-changing power grid environments. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a fine-grained harmonic compensation method for power grids to address the limitations of existing harmonic detection methods, which typically rely on traditional Fourier transforms. This limitation leads to limitations when processing non-stationary signals, especially when harmonic frequencies change rapidly or interharmonic components are present, resulting in a significant decrease in detection accuracy. Furthermore, traditional compensator control parameter adjustments are usually based on fixed rules or empirical formulas, lacking adaptability and flexibility, and often perform poorly in the face of complex and ever-changing power grid environments.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] In a first aspect, the present invention provides a method for fine compensation of power grid harmonics, comprising:
[0008] Three-phase voltage and current signals are synchronously acquired at the point of common coupling (PCC) of the power grid and labeled as a mixed power grid signal.
[0009] An improved sparse Fourier transform (SFT) combined with time-frequency analysis method is used to separate harmonics in the mixed power grid signal and obtain the harmonic components of each order.
[0010] By combining a pre-constructed load harmonic fingerprint database, decoupling analysis is performed on each harmonic component to obtain the contribution of independent harmonic sources.
[0011] Based on the contribution of independent harmonic sources, the target impedance parameters of the compensator are generated using a virtual impedance synthesis method.
[0012] The target impedance parameters of the compensator are optimized by combining the Actor network with deep reinforcement learning DDPG, and the output control parameters are generated.
[0013] An improved NSGA-II algorithm is used to perform multi-objective optimization of the control parameters and generate a compensation current.
[0014] As a preferred embodiment of the power grid harmonic fine compensation method of the present invention, the step of synchronously acquiring three-phase voltage and current signals at the power grid point of common coupling (PCC) and marking them as a power grid mixed signal includes the following steps:
[0015] A high-precision digital acquisition device (DAQ) is used to sample the three-phase voltage and three-phase current signals at the power grid's point of common coupling (PCC) in real time, resulting in a three-phase voltage signal sequence and a three-phase current signal sequence.
[0016] Based on a preset voltage reference value With current reference value The three-phase voltage signal sequence and the three-phase current signal sequence data are normalized, and the expression is: ; in, and They represent the first Phase at sampling time The original sampled values of voltage and current, and This is the corresponding normalized signal;
[0017] The normalized three-phase voltage and current signals are weighted and fused based on the energy fusion function to obtain the power grid hybrid signal.
[0018] A sliding window Fourier transform is used to perform local spectral analysis on the mixed power grid signal to extract its time-domain and frequency-domain features;
[0019] Based on time-domain and frequency-domain features, the mixed signals of the power grid are classified and labeled to generate a labeled mixed signal dataset of the power grid.
[0020] As a preferred embodiment of the power grid harmonic fine compensation method of the present invention, the step of using an improved sparse Fourier transform (SFT) and time-frequency joint analysis method to separate harmonics in the power grid mixed signal to obtain each harmonic component is as follows:
[0021] Using the Improved Sparse Fourier Transform (MSFT) for mixed signals of the power grid Initial spectrum estimation is performed to obtain a preliminary set of harmonic frequencies. and the corresponding amplitude set ;
[0022] An adaptive time-frequency joint analysis graph is constructed by fusing short-time Fourier transform and Chirp model to enhance the time-frequency resolution of non-stationary harmonic components;
[0023] For power grid mixed signals Local frequency tracking is performed, and the time-frequency evolution path of each harmonic component is identified by combining adaptive time-frequency joint analysis plots to obtain a set of dynamic harmonic frequency trajectories. and its rate of change
[0024] For power grid mixed signals Perform an improved sparse Fourier transform to extract the dominant sparse spectral components in the signal and obtain the MSFT spectral results;
[0025] The MSFT spectrum results and the adaptive time-frequency joint analysis plot are input into a multi-scale peak detection algorithm. Through cross-scale energy accumulation analysis, the center frequencies of each harmonic are extracted. and its amplitude ;
[0026] A multi-scale peak detection algorithm is used to analyze the fused spectral intensity. The frequency peaks are extracted and marked as candidate harmonic frequencies;
[0027] The center frequency of each harmonic With the preset integer harmonic frequency set ;in, The fundamental frequency, A positive integer, representing the first... Second harmonics;
[0028] Set preset frequency tolerance If satisfied Then the frequency is determined to be the first. The first integer harmonics are classified as harmonics; otherwise, they are classified as interharmonics or noise.
[0029] The least squares fitting method is used to analyze the mixed signals of the power grid. At the center frequency of each harmonic The components of each harmonic are then reconstructed to obtain the harmonic components.
[0030] The amplitude, phase, and frequency parameters of each harmonic component were obtained directly from the original signal using the least squares method.
[0031] As a preferred embodiment of the power grid harmonic fine compensation method of the present invention, the step of decoupling and analyzing each harmonic component by combining a pre-constructed load harmonic fingerprint database to obtain the contribution of independent harmonic sources is as follows:
[0032] Harmonic impedance matching model is used to analyze each harmonic component. Frequency domain mapping was performed to obtain the equivalent admittance response of each harmonic component under different loads; all parameters are complex data and were obtained through online measurement.
[0033] The energy distribution of each harmonic is calculated to obtain the harmonic power proportion of each load node;
[0034] The harmonic fingerprint database LHFD is used to match and retrieve the harmonic features of each load, and the typical harmonic fingerprint vector corresponding to each load is extracted.
[0035] The similarity coefficients of each harmonic component and the typical harmonic fingerprint vector corresponding to each load are obtained by performing similarity matching.
[0036] The contribution of each harmonic source is obtained by combining the harmonic power proportion of each load node with the load matching coefficient.
[0037] As a preferred embodiment of the power grid harmonic fine compensation method of the present invention, the specific steps of generating the target impedance parameters of the compensator based on the contribution of independent harmonic sources using a virtual impedance synthesis method are as follows:
[0038] For a containing Each node and For a power grid system with multiple loads, define the load-node connection matrix. ;
[0039] Define a reference virtual impedance function, set the equivalent impedance under the standard frequency of the power grid, and obtain the reference impedance frequency response curve;
[0040] The frequency correction of the reference virtual impedance is performed using the harmonic frequency response factor to obtain the first... Corrected impedance at subharmonic frequencies;
[0041] Harmonic weights of combined nodes And the corrected virtual impedance, calculate the virtual impedance parameter of each node at a specific frequency. .
[0042] As a preferred embodiment of the power grid harmonic fine compensation method of the present invention, the step of using deep reinforcement learning (DDPG) to optimize the target impedance parameters of the compensator and combining it with the output control parameters of the Actor network includes the following specific steps:
[0043] The current operating state of the power grid is modeled using a state observation function to obtain the state input vector for the DDPG algorithm;
[0044] The Actor network in DDPG is used to map the state input and output the current optimal control action. A Critic network is used to evaluate the value of the current control action, and then outputs the result. value;
[0045] Store historical state-action-reward data to build an experience pool;
[0046] Iterative optimization of the Actor-Critic dual network parameters was performed, and the network parameters were updated.
[0047] The control action output by the Actor network is used as the control parameter to generate control commands suitable for the compensation device.
[0048] The parameters are output by the Actor network and sent to the controller after being clipped, to drive the APF or SVG device for real-time compensation.
[0049] As a preferred embodiment of the power grid harmonic fine compensation method of the present invention, the step of using the improved NSGA-II algorithm to perform multi-objective optimization of control parameters to generate the final compensation current includes the following steps:
[0050] The population is initialized using the improved NSGA-II algorithm to obtain an initial feasible solution set;
[0051] The individuals in the current population are sorted into hierarchical levels to obtain the Pareto front level to which each individual belongs;
[0052] A dynamic adaptive weight allocation mechanism is adopted to weight different objective functions to obtain individual fitness functions, thereby improving global search capability and convergence speed;
[0053] Assess the distribution density of individuals within the same tier to determine their selection priority. To avoid premature convergence and maintain population diversity;
[0054] The next generation population is generated using binary tournament selection, simulated binary crossover (SBX), and polynomial mutation operations. to complete the evolutionary iteration;
[0055] The stopping condition is defined as the maximum number of iterations. The current algebraic and convergence state are evaluated, and the optimal solution set is output when the stopping condition is met.
[0056] Select the optimal control parameters from the optimal solution set and generate the compensation current command. ;
[0057] The compensation current command As a reference current for active power filters (APFs) or SVGs, it is used to track and inject compensation current to cancel harmonics.
[0058] Secondly, the present invention provides a fine-grained power grid harmonic compensation system, comprising:
[0059] Signal acquisition module, harmonic separation module, source contribution analysis module, impedance synthesis module, parameter optimization module, and current generation module;
[0060] The signal acquisition module is used to synchronously acquire three-phase voltage and current signals at the power grid common coupling point (PCC), and obtain a power grid mixed signal dataset through normalization processing and time-frequency fusion modeling.
[0061] The harmonic separation module is used to perform spectrum estimation and frequency tracking of the mixed power grid signal by using the improved sparse Fourier transform (MSFT) and adaptive time-frequency joint analysis (ATFJA). Combined with multi-scale peak detection and least squares fitting, it outputs each harmonic component, including the fundamental, 3rd, 5th, 7th and interharmonic components.
[0062] The source contribution analysis module is used to model the decoupled propagation path of each harmonic based on the harmonic impedance matching model and the load harmonic fingerprint library LHFD, and output the independent harmonic source contribution of each load node by combining the power ratio and similarity matching algorithm.
[0063] The impedance synthesis module is used to construct a virtual impedance mapping function based on the load topology and harmonic weight distribution, and combine it with a frequency response correction strategy to generate a set of target impedance parameters for each node at different harmonic frequencies.
[0064] The parameter optimization module is used to optimize the target impedance parameters online using the Deep Deterministic Strategy Gradient (DDPG) algorithm, and generate active, reactive, and impedance regulation control commands by combining the output control actions of the Actor network.
[0065] The current generation module is used to perform Pareto optimal search on the control parameters using an improved NSGA-II multi-objective evolutionary algorithm, combined with dynamic weight adjustment and congestion assessment mechanisms, to generate compensation current commands suitable for APF or SVG devices, driving the devices to inject compensation current to cancel harmonics.
[0066] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein the computer program, when executed by the processor, implements any step of the power grid harmonic fine compensation method as described in the first aspect of the present invention.
[0067] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein, when the computer program is executed by a processor, it implements any step of the power grid harmonic fine compensation method as described in the first aspect of the present invention.
[0068] The beneficial effects of this invention are as follows: By improving the Sparse Fourier Transform (MSFT) to perform initial spectrum estimation on the mixed signal of the power grid, a preliminary set of harmonic frequencies and corresponding amplitudes is obtained. While maintaining computational efficiency, the MSFT algorithm can effectively identify the main frequency components in the signal, reducing the spectral leakage problem that may occur in the traditional FFT algorithm and improving the accuracy of harmonic frequency identification. The impedance matching model can simulate the propagation characteristics of each harmonic in different load paths, which helps to identify which loads are the main harmonic sources, and then take targeted suppression measures to achieve the effect of precise harmonic pollution control. The reference virtual impedance function provides a basis for subsequent frequency correction, enabling the compensator to exhibit optimal performance at different frequencies, improving the flexibility and adaptability of compensation. The frequency correction strategy can dynamically adjust the operating parameters of the compensator according to the actual harmonic situation in the power grid, ensuring that it can also play a good suppression role in the high-frequency band, thereby comprehensively improving the power quality of the power grid. Attached Figure Description
[0069] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0070] Figure 1 This is a flowchart of the power grid harmonic fine compensation method in Example 1.
[0071] Figure 2 This is a schematic diagram of the power grid harmonic fine compensation system in Example 1. Detailed Implementation
[0072] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0073] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0074] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0075] Example 1, referring to Figure 1 and Figure 2 This is the first embodiment of the present invention, which provides a method for fine compensation of power grid harmonics, including the following steps:
[0076] S1. Synchronously collect three-phase voltage and current signals at the power grid common coupling point (PCC) and label them as power grid mixed signals;
[0077] Furthermore, a high-precision digital acquisition device (DAQ) is used to sample the three-phase voltage signal at the power grid common coupling point (PCC) in real time to obtain the three-phase voltage signal sequence.
[0078] Similarly, the three-phase current signals at PCC are synchronously sampled to obtain a three-phase current signal sequence;
[0079] Based on a preset voltage reference value With current reference value The three-phase voltage signal sequence and the three-phase current signal sequence data are normalized, and the expression is: ; in, and They represent the first Phase at sampling time The original sampled values of voltage and current, and This is the corresponding set of normalized signals;
[0080] The normalized three-phase voltage and current signals are weighted and fused based on the energy fusion function to obtain the power grid hybrid signal, expressed as follows: ; in, express The mixed signals of the power grid at any given time, , , These are the normalized phase A, B, and C voltage signals, respectively. , , These are the normalized phase A, B, and C current signals, respectively. This is a voltage and current energy ratio adjustment factor;
[0081] A sliding window Fourier transform is used to perform local spectral analysis on the mixed power grid signal to extract its time-domain and frequency-domain features;
[0082] The mixed power grid signals after time-frequency analysis are classified and labeled to generate a labeled mixed power grid signal dataset.
[0083] It should be noted that by deploying a high-precision DAQ device at the power grid's point of common coupling (PCC) for synchronous acquisition of three-phase signals, the time consistency between voltage and current signals is ensured, avoiding harmonic phase errors caused by asynchrony. Simultaneously, the original signal is standardized using a normalization function, effectively eliminating interference caused by amplitude differences between channels and improving the accuracy of subsequent spectrum analysis. Based on this, an energy fusion function is introduced to construct a hybrid power grid signal, which not only simplifies the multi-channel signal processing flow but also enhances the overall observability of the power grid status, providing a high-quality data foundation for subsequent harmonic separation and source identification.
[0084] S2. The improved sparse Fourier transform (SFT) and time-frequency joint analysis method are used to separate harmonics in the power grid mixed signal to obtain the harmonic components of each order.
[0085] Furthermore, the improved Sparse Fourier Transform (MSFT) is used to analyze the mixed signals of the power grid. Initial spectrum estimation is performed to obtain a preliminary set of harmonic frequencies. and the corresponding amplitude set ;
[0086] The MSFT expression is as follows: ; in, Represents frequency MSFT coefficients at the location, Indicates the first The mixed power grid signal at each sampling point For window functions, choose the Kaiser window;
[0087] The Kaiser window takes the following form: ; in, It is a zero-order modified Bessel function of the first kind. The shape factor of the window function. This is the length of the sampling window;
[0088] For power grid mixed signals Local frequency tracking is performed, and the time-frequency evolution path of each harmonic component is identified by combining adaptive time-frequency joint analysis plots to obtain a set of dynamic harmonic frequency trajectories. and its rate of change ;
[0089] ATFJA is constructed based on the fusion of Short-Time Fourier Transform (STFT) and the Chirp model, and its expression is as follows: ;
[0090] in, Indicates time ,frequency Time-frequency energy density at that location It is a Gaussian window function. For frequency modulation slope, For integration variables;
[0091] For power grid mixed signals Perform an improved sparse Fourier transform to extract the dominant sparse spectral components in the signal and obtain the MSFT spectral results;
[0092] The MSFT spectrum results and the adaptive time-frequency joint analysis plot are input into a multi-scale peak detection algorithm. Through cross-scale energy accumulation analysis, the center frequencies of each harmonic are extracted. and its amplitude ;
[0093] The formula for cross-scale energy accumulation analysis is as follows: ; in, Indicates the intensity of the fused spectrum. As a weighting factor, This represents the magnitude of the MSFT. This indicates the maximum energy value of ATFJA at this frequency;
[0094] Employing a multi-scale peak detection algorithm from The frequency peaks are extracted and marked as candidate harmonic frequencies;
[0095] The center frequency of each harmonic With the preset integer harmonic frequency set ,in, The fundamental frequency, A positive integer, representing the first... The subharmonics, and the matching conditions are as follows: ; in, This is the frequency tolerance threshold;
[0096] If the condition is met, the frequency is determined to be an integer harmonic; otherwise, it is considered an interharmonic or noise.
[0097] The least squares fitting method is used to analyze the mixed signals of the power grid. At each harmonic frequency The components of each harmonic are then reconstructed to obtain the harmonic components.
[0098] The refactored expression is: ; in, For the first The amplitude of the second harmonic. For the first The initial phase angle of the second harmonic;
[0099] The amplitude, phase, and frequency parameters of each harmonic component were obtained directly from the original signal using the least squares method.
[0100] The final output harmonic components include: fundamental frequency. 3rd harmonic 5th harmonic 7th harmonic and interharmonic components;
[0101] It should be noted that the combination of the improved Sparse Fourier Transform (MSFT) and the time-frequency joint analysis method ATFJA significantly improves the ability to identify non-stationary harmonic signals. Compared with the traditional FFT method, MSFT can achieve high-frequency resolution with fewer sampling points, making it particularly suitable for sparse signal scenarios. ATFJA, on the other hand, achieves accurate tracking of the dynamic frequency change process by fusing STFT and the Chirp model. After the two are combined, the harmonic components are reconstructed through multi-scale peak detection and least squares fitting. It shows good robustness and identification accuracy, especially in dealing with common interharmonics and noise interference in power grids, and has strong engineering application value.
[0102] S3. Decouple the harmonic components of each harmonic by combining the pre-constructed load harmonic fingerprint library to obtain the contribution of independent harmonic sources.
[0103] Furthermore, a harmonic impedance matching model is used to analyze each harmonic component. Frequency domain mapping is performed to obtain the equivalent admittance response of each harmonic component under different loads;
[0104] The expression for the harmonic impedance matching model is: ; in, Indicates the first Equivalent admittance at subharmonic frequencies Indicates the first A load at frequency The equivalent impedance is below. Indicates the line at frequency The equivalent impedance is below. Indicates the total load of the connected system;
[0105] All parameters are complex data, obtained through online measurement;
[0106] Harmonic impedance matching models are used to simulate the propagation characteristics of each harmonic in different load paths;
[0107] The energy distribution of each harmonic is calculated to obtain the harmonic power proportion of each load node, expressed as follows: ; in, Indicates the first The load pair of the first The power contribution ratio of subharmonics. Indicates the first Second harmonic voltage amplitude Indicates the first The load in the first Admittance at subharmonic frequencies This indicates taking the real part of a complex number;
[0108] The harmonic fingerprint database LHFD is used to match and retrieve the harmonic features of each load, and the typical harmonic fingerprint vector corresponding to each load is extracted. ;
[0109] The similarity coefficients of each harmonic component and the typical harmonic fingerprint vector corresponding to each load are obtained by performing similarity matching. ;
[0110] The proportion of harmonic power at each load node and load matching coefficient Combining, we obtain the first The contribution of independent harmonic sources to each load;
[0111] The expression for the fusion weight function is as follows: ; in, Indicates the first The overall harmonic contribution of each load, This indicates the total number of harmonic orders involved in the assessment. For the first Weighting factor for subharmonics Used to ensure that only positively correlated matching results are retained;
[0112] It should be noted that by constructing a harmonic impedance matching model based on admittance response, and combining the load harmonic fingerprint database LHFD with power proportion analysis, a two-dimensional source tracing mechanism from physical propagation path to load characteristic identification is realized. The method not only considers the actual transmission path of harmonics in the system, but also introduces a fingerprint database for pattern matching, thereby accurately identifying the main harmonic sources and their contribution. By using a weighted filtering function to weight the positive correlation results, the reliability of the identification is further improved. This solves the problem that traditional methods have difficulty distinguishing the harmonic characteristics of multiple similar loads, and has high practicality and scalability.
[0113] S4. Based on the contribution of independent harmonic sources, the target impedance parameters of the compensator are generated using the virtual impedance synthesis method.
[0114] Furthermore, for a collection Each node and For a power grid system with multiple loads, define the load-node connection matrix. ;
[0115] in: ;
[0116] Based on known load contribution Load-node connection matrix Calculate the comprehensive harmonic weight for each node. ,in, Indicates the first The degree of total harmonic impact of a node due to all the loads connected to it;
[0117] Define a reference virtual impedance function, set the equivalent impedance under the standard frequency of the power grid, and obtain the reference impedance frequency response curve;
[0118] The frequency correction of the reference virtual impedance is performed using the harmonic frequency response factor to obtain the first... Corrected impedance at subharmonic frequencies;
[0119] Harmonic weights of combined nodes And the corrected virtual impedance, calculate the virtual impedance parameter of each node at a specific frequency. The expression is: ;
[0120] The virtual impedance parameters of all nodes at various frequencies obtained in the above process are summarized into a complete set;
[0121] It should be noted that the virtual impedance synthesis method proposed in this invention comprehensively considers the influence of load distribution structure and harmonic propagation path. By defining the load-node connection relationship matrix and node harmonic weights, a compensation parameter generation mechanism for node-level control is established. The method can adaptively adjust the virtual impedance characteristics of each node under complex topology, making the compensator response more accurate at different frequencies, thereby improving the stability and compensation effect of the overall system. In addition, by setting the reference impedance and introducing the frequency correction factor, the virtual impedance design becomes more flexible, meeting the dynamic adjustment requirements under different operating conditions.
[0122] S5. Combine the Actor network with deep reinforcement learning DDPG to optimize the target impedance parameters of the compensator and output control parameters;
[0123] Furthermore, a state observation function is used to model the current operating state of the power grid, resulting in the state input vector for the DDPG algorithm, expressed as: ;
[0124] in, Indicates at time step The system status, This indicates the current total voltage distortion rate. This indicates the total distortion rate of the current. This indicates the current power loss of the system. This indicates the currently set virtual impedance value;
[0125] Using the Actor network in DDPG For status input Perform mapping and output the current optimal control action. ;
[0126] Using Critic network For the current control action The value is evaluated, and then output. value The expression is: ;
[0127] in, This indicates the estimated value of the current action. For the parameter set of the Critic network, , , These are the mapping weights from state and action to the hidden layer, and from the hidden layer to the output, respectively. For bias terms;
[0128] Store historical state-action-reward data to build an experience pool;
[0129] Iterative optimization of the Actor-Critic dual network parameters was performed, and the network parameters were updated.
[0130] The control action is ultimately output using the Actor network. As control parameters, control commands suitable for the compensation device are generated, with the following expression: ; in, This indicates the reference value for active power compensation current. This indicates the reference value for reactive power compensation current. Indicates the virtual impedance adjustment coefficient;
[0131] The parameters are output from the Actor network and sent to the controller after being limited, which are used to drive the APF or SVG device for real-time compensation.
[0132] It should be noted that this invention introduces the deep reinforcement learning (DDPG) algorithm into the optimization stage of power grid harmonic compensation control parameters, fully leveraging its ability to learn and make decisions online in a continuous action space. By outputting control actions through an Actor network and evaluating the value of actions through a Critic network, real-time dynamic optimization of the target impedance parameters is achieved. The application of the experience playback mechanism and soft update strategy effectively improves the convergence speed and stability of the algorithm, enabling it to maintain good control performance even when facing frequent changes in the power grid's operating state. This method breaks through the limitations of traditional fixed-rule control and provides a new approach for adaptive compensation control in a smart grid environment.
[0133] S6. The improved NSGA-II algorithm is used to perform multi-objective optimization of the control parameters to generate the final compensation current;
[0134] Furthermore, the population is initialized using the improved NSGA-II algorithm to obtain an initial feasible solution set;
[0135] The individuals in the current population are sorted into hierarchical levels to obtain the Pareto front level to which each individual belongs;
[0136] A dynamic adaptive weight allocation mechanism is used to weight different objective functions to obtain the individual fitness function, which is expressed as follows: ; in, , , The weighting factor varies with the number of iterations;
[0137] The weight update strategy is as follows: ;
[0138] in, Indicates the first Step-by-step objective function The average degree of improvement The attenuation coefficient;
[0139] Assess the distribution density of individuals within the same tier to determine their selection priority. ;
[0140] The next generation population is generated using binary tournament selection, simulated binary crossover (SBX), and polynomial mutation operations. And complete the evolutionary iteration;
[0141] The stopping condition is defined as the maximum number of iterations. The current algebraic and convergence state are evaluated, and the optimal solution set is output when the stopping condition is met.
[0142] Select the optimal control parameters from the optimal solution set to generate the final compensation current command. The expression is: ; in, , These are the reference values for active and reactive compensation currents selected from the optimal solution set, respectively. The fundamental angular frequency;
[0143] Output It will serve as the reference current for active power filters (APF) or SVG, and will be used to track and inject compensation current in real time to cancel harmonics.
[0144] It should be noted that this invention employs an improved NSGA-II multi-objective evolutionary algorithm to search for Pareto optimal solutions for control parameters. Combined with a dynamic adaptive weight allocation mechanism and a congestion assessment strategy, it effectively resolves the conflict between multiple objectives such as power quality, system efficiency, and equipment safety. Through binary tournament selection, SBX crossover, and polynomial mutation operations, it enhances population diversity and search efficiency, ensuring that the algorithm rapidly approaches the optimal solution set within a finite number of iterations. Finally, it selects the optimal control parameters from the solution set to generate compensation current commands, driving APF or SVG devices to inject compensation current, thereby achieving efficient suppression of grid harmonics. This demonstrates excellent multi-objective coordinated optimization capabilities and engineering feasibility.
[0145] This embodiment also provides a power grid harmonic fine compensation system, including:
[0146] Signal acquisition module, harmonic separation module, source contribution analysis module, impedance synthesis module, parameter optimization module, and current generation module;
[0147] The signal acquisition module is used to synchronously acquire three-phase voltage and current signals at the power grid point of common coupling (PCC), and obtain a power grid mixed signal dataset through normalization processing and time-frequency fusion modeling.
[0148] The harmonic separation module is used to perform spectrum estimation and frequency tracking of the mixed power grid signal by using the improved sparse Fourier transform (MSFT) and adaptive time-frequency joint analysis (ATFJA). It combines multi-scale peak detection and least squares fitting to output the harmonic components of each order, including the fundamental, 3rd, 5th, 7th and interharmonic components.
[0149] The source contribution analysis module is used to model the decoupled propagation path of each harmonic based on the harmonic impedance matching model and the load harmonic fingerprint library LHFD. Combined with the power ratio and similarity matching algorithm, it outputs the independent harmonic source contribution of each load node.
[0150] The impedance synthesis module is used to construct a virtual impedance mapping function based on the load topology and harmonic weight distribution, and combine it with a frequency response correction strategy to generate a set of target impedance parameters for each node at different harmonic frequencies.
[0151] The parameter optimization module is used to optimize the target impedance parameters online using the Deep Deterministic Strategy Gradient (DDPG) algorithm, and generate active, reactive, and impedance regulation control commands by combining the output control actions of the Actor network.
[0152] The current generation module is used to perform Pareto optimal search on the control parameters using the improved NSGA-II multi-objective evolutionary algorithm, combined with dynamic weight adjustment and congestion assessment mechanism, to generate compensation current commands suitable for APF or SVG equipment, driving the equipment to inject compensation current to cancel harmonics.
[0153] This embodiment also provides a computer device applicable to the fine-grained power grid harmonic compensation method, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the fine-grained power grid harmonic compensation method proposed in the above embodiment.
[0154] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0155] This embodiment also provides a storage medium on which a computer program is stored. When executed by a processor, the program implements the fine-grained harmonic compensation method for power grids as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0156] In summary, this invention uses the improved Sparse Fourier Transform (MSFT) to perform initial spectrum estimation of the mixed power grid signal, obtaining a preliminary set of harmonic frequencies and corresponding amplitudes. While maintaining computational efficiency, the MSFT algorithm effectively identifies the main frequency components in the signal, reducing the spectral leakage problem that may occur in the traditional FFT algorithm and improving the accuracy of harmonic frequency identification. The impedance matching model can simulate the propagation characteristics of each harmonic in different load paths, helping to identify which loads are the main harmonic sources, and thus enabling targeted suppression measures to achieve precise harmonic pollution control. The reference virtual impedance function provides a basis for subsequent frequency correction, allowing the compensator to exhibit optimal performance at different frequencies, improving the flexibility and adaptability of compensation. The frequency correction strategy can dynamically adjust the operating parameters of the compensator according to the actual harmonic situation in the power grid, ensuring that it can also play a good suppression role in the high-frequency band, thereby comprehensively improving the power quality of the power grid.
[0157] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for fine-grained compensation of power grid harmonics, characterized in that: include: Three-phase voltage and current signals are synchronously acquired at the point of common coupling (PCC) of the power grid and labeled as a mixed power grid signal. An improved sparse Fourier transform (SFT) combined with time-frequency analysis method is used to separate harmonics in the mixed power grid signal and obtain the harmonic components of each order. By combining a pre-constructed load harmonic fingerprint database, decoupling analysis is performed on each harmonic component to obtain the contribution of independent harmonic sources. Based on the contribution of independent harmonic sources, the target impedance parameters of the compensator are generated using a virtual impedance synthesis method. The target impedance parameters of the compensator are optimized by combining the Actor network with deep reinforcement learning DDPG, and the output control parameters are generated. An improved NSGA-II algorithm is used to perform multi-objective optimization of the control parameters and generate a compensation current.
2. The method for fine compensation of power grid harmonics as described in claim 1, characterized in that: The specific steps for synchronously acquiring three-phase voltage and current signals at the power grid point of common coupling (PCC) and labeling them as mixed power grid signals are as follows: A high-precision digital acquisition device (DAQ) is used to sample the three-phase voltage and three-phase current signals at the power grid's point of common coupling (PCC) in real time, resulting in a three-phase voltage signal sequence and a three-phase current signal sequence. Based on a preset voltage reference value With current reference value The three-phase voltage signal sequence and the three-phase current signal sequence data are normalized, and the expression is: ; in, and They represent the first Phase at sampling time The original sampled values of voltage and current, and This is the corresponding normalized signal; The normalized three-phase voltage and current signals are weighted and fused based on the energy fusion function to obtain the power grid hybrid signal; A sliding window Fourier transform is used to perform local spectral analysis on the mixed power grid signal to extract its time-domain and frequency-domain features; Based on time-domain and frequency-domain features, the mixed signals of the power grid are classified and labeled to generate a labeled mixed signal dataset of the power grid.
3. The method for fine compensation of power grid harmonics as described in claim 2, characterized in that: The method of using an improved sparse Fourier transform (SFT) and time-frequency joint analysis to separate harmonics in the mixed power grid signal and obtain each harmonic component is as follows: Using the Improved Sparse Fourier Transform (MSFT) for mixed signals of the power grid Initial spectrum estimation is performed to obtain a preliminary set of harmonic frequencies. and the corresponding amplitude set ; An adaptive time-frequency joint analysis graph is constructed by fusing short-time Fourier transform and Chirp model to enhance the time-frequency resolution of non-stationary harmonic components; For power grid mixed signals Local frequency tracking is performed, and the time-frequency evolution path of each harmonic component is identified by combining adaptive time-frequency joint analysis plots to obtain a set of dynamic harmonic frequency trajectories. and its rate of change ; For power grid mixed signals Perform an improved sparse Fourier transform to extract the dominant sparse spectral components in the signal and obtain the MSFT spectral results; The MSFT spectrum results and the adaptive time-frequency joint analysis plot are input into a multi-scale peak detection algorithm. Through cross-scale energy accumulation analysis, the center frequencies of each harmonic are extracted. and its amplitude ; A multi-scale peak detection algorithm is used to analyze the fused spectral intensity. The frequency peaks are extracted and marked as candidate harmonic frequencies; The center frequency of each harmonic With the preset integer harmonic frequency set Comparison was performed; among them, The fundamental frequency, A positive integer, representing the first... Second harmonics; Set preset frequency tolerance If satisfied Then the frequency is determined to be the first. The first integer harmonics are classified as harmonics; otherwise, they are classified as interharmonics or noise. The least squares fitting method is used to analyze the mixed signals of the power grid. At the center frequency of each harmonic The components of each harmonic are then reconstructed to obtain the harmonic components. The amplitude, phase, and frequency parameters of each harmonic component were obtained directly from the original signal using the least squares method.
4. The power grid harmonic fine compensation method as described in claim 3, characterized in that: The decoupling analysis of each harmonic component, combined with a pre-constructed load harmonic fingerprint database, yields the contribution of independent harmonic sources. The specific steps are as follows: Harmonic impedance matching model is used to analyze each harmonic component. Frequency domain mapping was performed to obtain the equivalent admittance response of each harmonic component under different loads; all parameters are complex data and were obtained through online measurement. The energy distribution of each harmonic is calculated to obtain the harmonic power proportion of each load node; The harmonic fingerprint database LHFD is used to match and retrieve the harmonic features of each load, and the typical harmonic fingerprint vector corresponding to each load is extracted. The load matching coefficient is obtained by matching each harmonic component with the typical harmonic fingerprint vector corresponding to each load. The contribution of each harmonic source is obtained by combining the harmonic power proportion of each load node with the load matching coefficient.
5. The power grid harmonic fine compensation method as described in claim 4, characterized in that: The specific steps for generating the target impedance parameters of the compensator based on the contribution of independent harmonic sources using a virtual impedance synthesis method are as follows: For a containing Each node and For a power grid system with multiple loads, define the load-node connection matrix. ; Define a reference virtual impedance function, set the equivalent impedance under the standard frequency of the power grid, and obtain the reference impedance frequency response curve; The frequency correction of the reference virtual impedance is performed using the harmonic frequency response factor to obtain the first... Corrected impedance at subharmonic frequencies; Harmonic weights of combined nodes And the corrected virtual impedance, calculate the virtual impedance parameter of each node at a specific frequency. .
6. The method for fine compensation of power grid harmonics as described in claim 5, characterized in that: The method combines an Actor network with deep reinforcement learning (DDPG) to optimize the target impedance parameters of the compensator and output control parameters. The specific steps are as follows: The current operating state of the power grid is modeled using a state observation function to obtain the state input vector for the DDPG algorithm; The Actor network in DDPG is used to map the state input and output the current optimal control action; A Critic network is used to evaluate the value of the current optimal control action, and then outputs the result. value; Store historical state-action-reward data to build an experience pool; Iterative optimization of the Actor-Critic dual network parameters was performed, and the network parameters were updated. The control action output by the Actor network is used as the control parameter to generate control commands suitable for the compensation device. The control parameters are output from the Actor network and sent to the controller after being limited, so as to drive the APF or SVG device for real-time compensation.
7. The method for fine compensation of power grid harmonics as described in claim 6, characterized in that: The improved NSGA-II algorithm is used to perform multi-objective optimization of the control parameters to generate the final compensation current. The specific steps are as follows: The population is initialized using the improved NSGA-II algorithm to obtain an initial feasible solution set; The individuals in the current population are sorted into hierarchical levels to obtain the Pareto front level to which each individual belongs; A dynamic adaptive weight allocation mechanism is used to weight different objective functions to obtain the individual fitness function; Assess the distribution density of individuals within the same tier to determine their selection priority. ; The next generation population is generated using binary tournament selection, simulated binary crossover (SBX), and polynomial mutation operations. to complete the evolutionary iteration; The stopping condition is defined as the maximum number of iterations. The current algebraic and convergence state are evaluated, and the optimal solution set is output when the stopping condition is met. Select the optimal control parameters from the optimal solution set and generate the compensation current command. .
8. A power grid harmonic fine compensation system, based on the power grid harmonic fine compensation method according to any one of claims 1 to 7, characterized in that: include: Signal acquisition module, harmonic separation module, source contribution analysis module, impedance synthesis module, parameter optimization module, and current generation module; The signal acquisition module is used to synchronously acquire three-phase voltage and current signals at the power grid common coupling point (PCC), and obtain a power grid mixed signal dataset through normalization processing and time-frequency fusion modeling. The harmonic separation module is used to perform spectrum estimation and frequency tracking of the mixed power grid signal by using the improved sparse Fourier transform (MSFT) and adaptive time-frequency joint analysis (ATFJA). Combined with multi-scale peak detection and least squares fitting, it outputs each harmonic component, including the fundamental, 3rd, 5th, 7th and interharmonic components. The source contribution analysis module is used to model the decoupled propagation path of each harmonic based on the harmonic impedance matching model and the load harmonic fingerprint library LHFD, and output the independent harmonic source contribution of each load node by combining the power ratio and similarity matching algorithm. The impedance synthesis module is used to construct a virtual impedance mapping function based on the load topology and harmonic weight distribution, and combine it with a frequency response correction strategy to generate a set of target impedance parameters for each node at different harmonic frequencies. The parameter optimization module is used to optimize the target impedance parameters online using the Deep Deterministic Strategy Gradient (DDPG) algorithm, and generate active, reactive, and impedance regulation control commands by combining the output control actions of the Actor network. The current generation module is used to perform Pareto optimal search on the control parameters using an improved NSGA-II multi-objective evolutionary algorithm, combined with dynamic weight adjustment and congestion assessment mechanisms, to generate compensation current commands suitable for APF or SVG devices, driving the devices to inject compensation current to cancel harmonics.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the power grid harmonic fine compensation method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the power grid harmonic fine compensation method according to any one of claims 1 to 7.