Plc parameter setting method and system based on online identification of power grid impedance

By constructing a key frequency adaptive selection mechanism and multi-frequency composite disturbance injection technology, the problem of incomplete grid impedance identification in the existing technology is solved, and the stability optimization and robust control of the inverter system in a weak grid environment are realized.

CN122172708APending Publication Date: 2026-06-09HUANENG WEINING WIND POWER GENERATION CO LTD +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUANENG WEINING WIND POWER GENERATION CO LTD
Filing Date
2026-01-22
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing grid impedance identification and parameter tuning technologies cannot accurately obtain the full-frequency variation trend of grid impedance in weak grid environments. This makes the inverter control system prone to oscillation when the resonant point shifts or the grid structure changes. Furthermore, it lacks the ability to automatically adjust the grid status, affecting the robustness and stability of the system.

Method used

By constructing a key frequency adaptive selection mechanism, combining the characteristics of LCL filters with real-time grid conditions, sensitive frequency bands are dynamically locked. Discrete complex impedance data is obtained using multi-frequency composite disturbance injection and the Goertzel algorithm, and the impedance spectrum of the entire frequency band is reconstructed. The phase margin and gain margin are accurately calculated by combining the known inverter model, and the PLC parameters are adaptively tuned.

Benefits of technology

Robust control and stability optimization of PLC parameters were achieved in complex power grid environments, ensuring that the system has sufficient stability margin in dynamically changing power grids and avoiding resonance risks and oscillations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122172708A_ABST
    Figure CN122172708A_ABST
Patent Text Reader

Abstract

This application discloses a PLC parameter tuning method and system based on online grid impedance identification. It dynamically locks sensitive frequency bands such as LCL resonance and crossover frequency through a key frequency adaptive selection mechanism and tracks grid resonance drift using historical data. Multi-frequency composite disturbance injection and Goertzel parallel demodulation technology are employed to efficiently extract discrete complex impedances at key frequency points. Based on this, the grid model parameters are identified using the least squares method, thereby reconstructing a continuous impedance spectrum across the entire frequency band, effectively overcoming the information loss problem caused by discrete measurements. Combining the reconstructed impedance spectrum with the inverter model, the system open-loop transfer function is constructed to accurately calculate the stability margin, and the proportional and integral gains of the PLC controller are adaptively tuned accordingly. This achieves accurate matching and robust control of complex grid characteristics under limited computing power.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of wind power generation control technology, and more specifically, to a PLC parameter tuning method and system based on online identification of grid impedance. Background Technology

[0002] With the deep integration of distributed generation technology and industrial automation control, grid-connected inverters, as the key interface connecting new energy equipment and the power grid, directly affect power quality due to their operational stability. In practical applications, especially in weak grid environments, grid impedance is non-negligible and exhibits significant time-varying and nonlinear characteristics. This changing grid impedance can easily couple with the LCL filter at the inverter output, altering the system's loop gain and phase characteristics, thereby inducing resonance or causing control system instability. To address this challenge, using a Programmable Logic Controller (PLC) for online adaptive tuning of the inverter's control parameters has become an important technical approach.

[0003] However, existing grid impedance identification and parameter tuning techniques have certain limitations. To accommodate the computational resource constraints of industrial controllers, some existing solutions tend to employ simplified identification strategies, such as injecting disturbance signals only at the grid fundamental frequency or a few fixed discrete frequency points to measure impedance. While this method reduces computational load, it results in incomplete impedance information, ignoring the variation trend of grid impedance over a wide frequency band. In particular, system stability is highly dependent on the characteristics of the open-loop transfer function near the crossover frequency and the resonant peak of the LCL filter. Single-point or sparse discrete impedance data cannot accurately reconstruct the amplitude and phase frequency curves of these critical frequency bands, thus making it impossible to accurately calculate the system's phase margin and gain margin. Controller parameter tuning based on such incomplete information often fails to cover all potential risk frequency bands, resulting in a tuned system that is only stable under specific operating conditions and prone to oscillations when the resonant point shifts or the grid structure changes. Furthermore, the frequency points used for detection in existing technologies are usually statically preset and lack the ability to automatically adjust according to grid conditions. When the resonant frequency of the power grid drifts due to load changes, the fixed detection frequency cannot capture the new resonant peak position in time, causing the identification model to become disconnected from the actual physical object, further weakening the effectiveness of parameter tuning and the robustness of the system.

[0004] Therefore, an optimized PLC parameter tuning scheme based on online identification of grid impedance is desired. Summary of the Invention

[0005] To address the aforementioned technical problems, this application is proposed. Embodiments of this application provide a PLC parameter tuning method and system based on online identification of power grid impedance.

[0006] According to one aspect of this application, a PLC parameter tuning method based on online identification of power grid impedance is provided, comprising: Obtain the nominal resonant frequency, target crossover frequency, and fundamental frequency of the power grid for the LCL filter; A set of key frequencies is obtained by adaptively selecting the nominal resonant frequency, target crossover frequency, and fundamental frequency of the power grid for the LCL filter. Target frequency injection and response synchronization extraction are performed based on a set of key frequencies to obtain a set of discrete complex impedance measurements; The power grid model parameters are obtained by least-squares-based identification of a set of discrete complex impedance measurements. Based on the known models of grid model parameters, inverter LCL filter and control delay, full-band impedance spectrum reconstruction and accurate calculation of system stability margin are performed to obtain phase margin and gain margin. Based on phase margin and gain margin, the proportional gain and integral gain are adaptively tuned to obtain the tuned PLC parameters.

[0007] According to another aspect of this application, a PLC parameter tuning system based on online identification of power grid impedance is provided, comprising: The frequency acquisition module is used to acquire the nominal resonant frequency of the LCL filter, the target crossover frequency, and the fundamental frequency of the power grid. The critical frequency adaptive selection module is used to adaptively select the critical frequencies from the nominal resonant frequency of the LCL filter, the target crossover frequency, and the fundamental frequency of the power grid to obtain a set of critical frequencies. The target frequency injection and response synchronization extraction module is used to perform target frequency injection and response synchronization extraction based on a set of key frequencies to obtain a set of discrete complex impedance measurements. The power grid model parameter identification module is used to perform least squares-based power grid model parameter identification on a set of discrete complex impedance measurements to obtain the power grid model parameters. The impedance spectrum reconstruction and system stability margin calculation module is used to perform full-band impedance spectrum reconstruction and accurate calculation of system stability margin based on the known model of grid model parameters and inverter LCL filter and control delay to obtain phase margin and gain margin. The adaptive tuning module is used to adaptively tune the proportional gain and integral gain based on the phase margin and gain margin to obtain the tuned PLC parameters.

[0008] Compared with existing technologies, this scheme constructs a key frequency adaptive selection mechanism, combining LCL filter characteristics and real-time grid conditions to dynamically lock sensitive frequency bands, including the fundamental frequency, crossover frequency, and potential resonant points. It also uses historical identification results to predict and track grid resonance drift. Based on this, it utilizes multi-frequency composite disturbance injection and parallel demodulation with the Goertzel algorithm to efficiently acquire discrete complex impedance data at key frequencies. Furthermore, it uses this discrete data to identify parameters of the grid physical model and reconstructs the continuous impedance spectrum across the entire frequency band, thus overcoming the information blind spot caused by sparse measurements. Based on the reconstructed full-band information and the known inverter model, it constructs the system open-loop transfer function and accurately calculates the phase margin and gain margin. Finally, based on this precise margin, it adaptively tunes the proportional and integral gains of the PLC controller, achieving robust control and stability optimization in complex grid environments under computationally limited conditions. Attached Figure Description

[0009] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0010] Figure 1 This is a flowchart of a PLC parameter tuning method based on online identification of power grid impedance according to an embodiment of this application; Figure 2 This is a schematic diagram of the data flow of the PLC parameter tuning method based on online identification of power grid impedance according to an embodiment of this application; Figure 3 This is a flowchart illustrating the process of adaptively selecting key frequencies from the nominal resonant frequency, target crossover frequency, and fundamental frequency of the LCL filter to obtain a set of key frequencies according to the PLC parameter tuning method based on online identification of grid impedance according to an embodiment of this application. Figure 4 This is a flowchart illustrating the PLC parameter tuning method based on online identification of power grid impedance according to an embodiment of this application, which involves injecting target frequency and synchronously extracting response based on a key frequency set to obtain a set of discrete complex impedance measurement values. Figure 5 This is a flowchart illustrating the process of reconstructing the full-band impedance spectrum and accurately calculating the system stability margin based on the known model of the inverter LCL filter and control delay, according to the PLC parameter tuning method based on online identification of grid impedance in this application, to obtain the phase margin and gain margin. Figure 6This is a block diagram of a PLC parameter tuning system based on online identification of power grid impedance according to an embodiment of this application. Detailed Implementation

[0011] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.

[0012] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not specifically singular and may include plural forms. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0013] While this application makes various references to certain modules of the systems according to embodiments of this application, any number of different modules can be used and run on user terminals and / or servers. The modules described are merely illustrative, and different aspects of the systems and methods may use different modules.

[0014] Flowcharts are used in this application to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, various steps can be processed in reverse order or simultaneously as needed. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

[0015] Current PLC parameter tuning techniques often rely on single-point or sparse discrete frequency impedance measurements. This simplified approach ignores the complex characteristics of the power grid impedance across the entire frequency band, particularly failing to accurately capture impedance abrupt changes near the LCL filter resonance peak and crossover frequency. This results in the controller being unable to obtain the true system phase margin and gain margin, making it difficult for the tuned PI parameters to guarantee system stability across the entire frequency band in complex power grid environments, and even potentially leading to resonance risks. Therefore, this application proposes a PLC parameter tuning method based on online identification of power grid impedance, aiming to restore the complete system characteristics through sparse and effective measurements. First, a key frequency adaptive selection mechanism is constructed, dynamically locking sensitive frequency bands including the fundamental frequency, crossover frequency, and drift resonance point by combining inherent LCL parameters with historical identification results. Subsequently, multi-frequency composite disturbance injection technology and the Goertzel algorithm are used for parallel demodulation to efficiently acquire discrete complex impedance data at these key frequency points with low computational power consumption. Based on this, the scheme uses the least squares method to identify the parameters of the equivalent physical model of the power grid, and then analytically reconstructs the continuous impedance spectrum across the entire frequency band, filling the information blind spots of discrete measurements. Finally, the reconstructed grid impedance is combined with the known inverter model to construct a complete system open-loop transfer function to accurately calculate the stability margin. Based on this, the proportional gain and integral gain of the PLC controller are adaptively optimized to ensure that the system always has sufficient stability margin in a dynamically changing grid.

[0016] Figure 1 This is a flowchart of a PLC parameter tuning method based on online identification of power grid impedance according to an embodiment of this application. Figure 2 This is a schematic diagram of the data flow in the PLC parameter tuning method based on online identification of power grid impedance according to an embodiment of this application. Figure 1 and Figure 2 As shown, the PLC parameter tuning method based on online grid impedance identification according to an embodiment of this application includes the following steps: S100, obtaining the nominal resonant frequency, target crossover frequency, and grid fundamental frequency of the LCL filter; S200, performing key frequency adaptive selection on the nominal resonant frequency, target crossover frequency, and grid fundamental frequency of the LCL filter to obtain a key frequency set; S300, performing target frequency injection and response synchronization extraction based on the key frequency set to obtain a set of discrete complex impedance measurements; S400, performing grid model parameter identification based on least squares on the set of discrete complex impedance measurements to obtain grid model parameters; S500, performing full-band impedance spectrum reconstruction and accurate calculation of system stability margin based on the grid model parameters and known models of inverter LCL filter and control delay to obtain phase margin and gain margin; S600, performing adaptive tuning on proportional gain and integral gain based on phase margin and gain margin to obtain tuned PLC parameters.

[0017] Specifically, in step S100, the nominal resonant frequency, target crossover frequency, and grid fundamental frequency of the LCL filter are obtained. It is understood that the stability margin of the grid-connected inverter system is physically limited by the inherent resonant characteristics of the LCL filter, and at the control level, it depends on the phase behavior of the open-loop transfer function near the cutoff frequency. These two frequency bands are high-risk areas for system oscillation. Without prior knowledge of these key characteristic frequencies, subsequent impedance identification will fall into blind searching, making it difficult to capture the local features that truly affect stability. Therefore, in the technical solution of this application, the nominal resonant frequency, target crossover frequency, and grid fundamental frequency of the LCL filter are obtained to establish key monitoring anchor points and frequency search ranges for the subsequent impedance identification process. This ensures that subsequent disturbance injection and signal analysis are highly focused on the core frequency bands affecting system robustness, avoiding the waste of computing power caused by blind full-band scanning, and laying an accurate data foundation for achieving efficient online parameter adaptive tuning.

[0018] More specifically, in a particular example of this application, the acquisition of these fundamental frequency parameters constitutes the initialization reference for the parameter tuning process. For the grid fundamental frequency, it is determined by reading the real-time output register value of the phase-locked loop synchronized with the grid voltage, or by directly calling a preset grid standard frequency constant, such as 50 Hz, stored in the memory. For the target crossover frequency, it is obtained by retrieving preset control loop design parameters from the digital controller; this frequency characterizes the open-loop gain bandwidth of the current loop or voltage loop design. For the nominal resonant frequency of the LCL filter, it is calculated by reading the hardware configuration parameters stored in the non-volatile memory, including the filter-side inductance value, the grid-side inductance value, and the filter capacitor value, using the inductor-capacitor series-parallel resonance formula, or by directly loading the theoretical resonant frequency value calibrated at the time of device delivery.

[0019] Specifically, in step S200, a key frequency set is obtained by adaptively selecting the nominal resonant frequency of the LCL filter, the target crossover frequency, and the fundamental frequency of the power grid. It is understood that the coupling effect between the power grid impedance and the LCL filter causes the actual resonant frequency to drift with the power grid state, and the stability margin of the control system is extremely sensitive to the impedance characteristics near the crossover frequency. A statically fixed detection frequency often cannot effectively cover these dynamically changing key feature points, resulting in distortion of the model identification results in the critical region of stability assessment. Therefore, in the technical solution of this application, a key frequency set is further obtained by adaptively selecting the nominal resonant frequency of the LCL filter, the target crossover frequency, and the fundamental frequency of the power grid. This allows for dynamic planning of the optimal detection frequency layout based on the inherent characteristics of the system and its real-time operating state, ensuring that the measurement frequency points can accurately lock the fundamental impedance reference, the control bandwidth boundary, and potential high-frequency resonance peaks. This significantly improves the fitting accuracy of the power grid model in the key frequency band while ensuring real-time data acquisition and low computational consumption, providing reliable data support for subsequent accurate stability analysis.

[0020] Figure 3 This is a flowchart illustrating the process of adaptively selecting key frequencies—the nominal resonant frequency, target crossover frequency, and fundamental frequency of the LCL filter—to obtain a set of key frequencies according to the PLC parameter tuning method based on online identification of grid impedance, as described in an embodiment of this application. Figure 3 As shown, step S200 includes: S210, determining a set of reference frequencies based on the nominal resonant frequency of the LCL filter, the target crossover frequency, and the fundamental frequency of the power grid; S220, dynamically tracking and predicting the power grid resonant points of the power grid model parameters identified in the previous cycle to obtain the predicted high-frequency detection points; S230, synthesizing and verifying the set of reference frequencies and the predicted high-frequency detection points to obtain a set of key frequencies.

[0021] In step S210, a set of reference frequencies is determined based on the nominal resonant frequency of the LCL filter, the target crossover frequency, and the fundamental frequency of the power grid. It is understood that because the power grid impedance characteristics exhibit significant segmented differences in the frequency domain, the low-frequency band mainly reflects inductive and resistive characteristics, the mid-frequency band determines the dynamic response bandwidth of the control system, and the high-frequency band contains the inherent resonant poles of the LCL filter. Without initial probing planning for these three key physical intervals, subsequent parameter identification will face problems such as fitting divergence or local minima due to insufficient boundary conditions. Therefore, in the technical solution of this application, a set of reference frequencies is further determined based on the nominal resonant frequency of the LCL filter, the target crossover frequency, and the fundamental frequency of the power grid. This constructs an initial probing framework covering the full-frequency domain characteristics of the physical model, providing frequency constraint anchors with clear physical meaning for subsequent accurate identification. This ensures that the model identification algorithm has complete frequency domain feature input at the initial stage, thereby quickly locking the baseline model parameters of the power grid impedance without full-frequency scanning.

[0022] More specifically, in a concrete example of this application, the determination process of the reference frequency set follows the principle of piecewise mapping of physical features. First, for the low-frequency probe point, the acquired fundamental frequency of the power grid is multiplied by a preset low-frequency multiplier coefficient. This multiplier coefficient is set to avoid fundamental interference and effectively reflect the DC resistance and inductance characteristics of the power grid, thereby determining the low-frequency point used to constrain the low-frequency asymptote of the model. Second, for the mid-frequency probe point, the target crossover frequency that determines the phase margin of the control system is directly mapped to the mid-frequency point. This point is located in the cutoff region of the control bandwidth and is used to capture key phase transition features affecting system stability. Finally, for the high-frequency initial probe point, the nominal resonant frequency of the LCL filter is directly selected as the high-frequency reference. This frequency point characterizes the inherent resonant properties of the hardware filter circuit. Subsequently, the above calculations and the selected low-frequency point, mid-frequency point, and high-frequency initial point are combined to synthesize a reference frequency set containing three key frequency domain feature values, which serves as the initial frequency sequence for subsequent adaptive adjustment and probe signal injection.

[0023] In step S220, the grid model parameters identified in the previous cycle are dynamically tracked and predicted for the grid resonance point to obtain the predicted high-frequency detection point. It is understood that due to the complexity of the grid connection environment, the grid impedance exhibits significant time-varying characteristics. Especially when the inductive impedance fluctuates under weak grid conditions, it couples with the filter capacitor of the inverter's LCL filter, causing the actual parallel resonant frequency of the system to deviate from the hardware nominal value, resulting in dynamic drift. If the detection frequency cannot follow this drift, the model identification process will struggle to accurately capture the amplitude gain and phase abrupt changes of the resonance peak, thus affecting the accuracy of stability assessment. Therefore, in the technical solution of this application, the grid model parameters identified in the previous cycle are further dynamically tracked and predicted for the grid resonance point to obtain the predicted high-frequency detection point. This utilizes the physical laws of historical identification data to proactively lock the resonance risk location at the current moment. In this way, the detection frequency can actively follow the dynamic characteristics of the grid, ensuring that even when changes in grid impedance cause the resonance point to shift, the system can still maintain a keen perception of high-frequency resonance characteristics.

[0024] More specifically, in a concrete example of this application, the dynamic tracking and prediction process is implemented based on iteratively updated physical model parameters. First, at the start of the current identification cycle, the parameters of the equivalent circuit model of the power grid, identified and converged using the least squares algorithm in the previous control cycle, are invoked. These parameters characterize the physical impedance state of the power grid at the previous moment. Then, the key physical quantities determining the location of the high-frequency resonant poles are analyzed from this set of model parameters: the equivalent inductance component at the grid connection point and the filter capacitor component in the LCL filter circuit. Next, based on the principle of LC parallel resonance, the characteristic frequency value at which the aforementioned inductance and capacitance components resonate in parallel is calculated through mathematical operations. Finally, this calculated characteristic frequency is established as the predicted high-frequency detection point for the current cycle, used to replace or correct the static high-frequency point set based on nominal parameters, thereby achieving real-time approximation and capture of the actual physical resonant point by the detection frequency.

[0025] In step S230, the reference frequency set and the predicted high-frequency detection points are synthesized and verified to obtain the key frequency set. It is understandable that simply superimposing the predicted dynamic frequency points with the static reference frequency points can easily lead to the detection frequency points being too close or even overlapping in the spectrum. This excessively high spectral density can cause ill-conditioned characteristics in the observation matrix during the subsequent least-squares parameter identification process, thereby leading to instability in the numerical solution and divergence in the identification results. Therefore, in the technical solution of this application, the reference frequency set and the predicted high-frequency detection points are further synthesized and verified to obtain the key frequency set. This allows for the integration of the latest power grid characteristic prediction information while forcibly constraining the minimum spectral distance between each detection frequency point, ensuring that the final generated frequency sequence has good linear independence mathematically. This effectively avoids the risk of algorithm failure caused by the coupling of sampling frequency points, ensuring that high-confidence model parameter solutions can still be obtained with a limited number of detection points.

[0026] More specifically, in a specific example of this application, the synthesis and verification process follows the logic of prioritizing the acceptance of dynamic information and enforcing numerical constraints. First, an adaptive synthesis operation of frequency points is performed, extracting low-frequency and mid-frequency detection points from a defined set of reference frequencies as the basic framework, and determining the validity of the input predicted high-frequency detection points. When the predicted high-frequency detection point is valid, it directly replaces the initial high-frequency point in the reference set, thereby embedding a dynamic frequency value reflecting the current grid resonance drift trend into the detection sequence, forming a temporary frequency combination. Subsequently, a rigorous numerical stability check is performed on this temporary frequency combination, calculating the absolute difference between any two frequency points within the combination and comparing this difference with a preset minimum frequency interval threshold. If the interval between two frequency points is detected to be less than the threshold, it indicates that the current frequency distribution may lead to ill-conditioned identification equations. The system then triggers a conflict adjustment mechanism, forcibly increasing the frequency interval until the minimum interval requirement is met by superimposing a predetermined frequency offset onto the high-frequency point or performing a small spectral shift. For example, when two frequency points are detected... and The difference When the frequency is below a preset threshold (e.g., 50Hz), maintain Unchanged, will Shift towards higher frequencies Finally, the frequency sequence after the above synthesis, update, and verification correction is established as the final set of key frequencies to guide subsequent signal injection and acquisition.

[0027] Specifically, in step S300, target frequency injection and response synchronous extraction are performed based on a key frequency set to obtain a set of discrete complex impedance measurements. It is understood that industrial power grid environments typically have complex background harmonic interference, and the real-time computing resources of industrial controllers are insufficient to support the high-order Fast Fourier Transform operations required for traditional broadband identification. If weak disturbance responses cannot be accurately extracted from strong noise with low computational cost, it will directly lead to distortion of impedance measurement data. Therefore, in the technical solution of this application, target frequency injection and response synchronous extraction are further performed based on a key frequency set to obtain a set of discrete complex impedance measurements. This allows for targeted concentrated excitation of the power grid using the superposition of multi-frequency sinusoidal signals, and the voltage and current responses of the target frequency points are accurately extracted from the mixed sampled signals using demodulation methods with excellent frequency selectivity. This significantly improves the signal-to-noise ratio and accuracy of impedance measurements at key frequencies while completely avoiding the computational overhead of the entire spectrum, ensuring that the discrete data points used for subsequent model identification accurately and faithfully reflect the physical characteristics of the power grid at the current moment.

[0028] Figure 4 This is a flowchart illustrating the process of injecting target frequency and synchronously extracting response based on a key frequency set to obtain a set of discrete complex impedance measurements, according to an embodiment of this application's PLC parameter tuning method based on online identification of power grid impedance. Figure 4 As shown, step S300 includes: S310, performing digital synthesis and injection of multi-frequency composite disturbance current based on disturbance injection specifications, fundamental current reference, and sampling time to obtain grid-connected voltage timing data and inverter output current timing data; S320, based on the key frequency set and data block length, performing parallel demodulation of frequency domain response vectors based on the Goertzel algorithm on the grid-connected voltage timing data and inverter output current timing data to obtain a set of complex vectors for disturbance voltage and a set of complex vectors for disturbance current; S330, performing discrete complex impedance calculation on the set of complex vectors for disturbance voltage and the set of complex vectors for disturbance current to obtain a set of discrete complex impedance measurements.

[0029] In step S310, the disturbance injection specifications, fundamental current reference, and sampling time are digitally synthesized and injected with multi-frequency composite disturbance current to obtain grid-connected voltage timing data and inverter output current timing data. It is understood that serial probing at each frequency point significantly prolongs the identification period, making it difficult for the system to capture transient changes in grid impedance. While simple broadband noise injection has a wide coverage, the dispersed spectral energy is easily overwhelmed by strong background noise in industrial environments, resulting in excessively low signal-to-noise ratios at key frequencies. Therefore, in the technical solution of this application, the disturbance injection specifications, fundamental current reference, and sampling time are further digitally synthesized and injected with multi-frequency composite disturbance current to obtain grid-connected voltage timing data and inverter output current timing data. This allows for parallel centralized excitation of the grid using high-energy-density discrete multi-frequency signals while maintaining normal fundamental power transmission of the inverter. This ensures that the responses of all key frequencies are simultaneously excited within a short injection window, achieving strict time-domain alignment of voltage and current signals with a high signal-to-noise ratio.

[0030] More specifically, in a specific example of this application, the digital synthesis and injection process of the multi-frequency composite disturbance current is implemented based on the real-time operation cycle of the digital controller. First, based on the discrete-time reference of the current control cycle, each target frequency point in the key frequency set is traversed, and the instantaneous sine value of each frequency component at the current sampling moment is calculated according to the preset amplitude and phase specifications. Subsequently, a digital superposition operation is performed to arithmetically sum all the calculated single-frequency sine components to synthesize a total disturbance signal containing all target spectral characteristics. This total disturbance signal is then directly superimposed onto the fundamental current reference command generated by the power control loop to form the final modulation command driving the inverter power stage operation. Simultaneously, under the same clock cycle of the disturbance signal application, the analog-to-digital converter is triggered to synchronously sample the grid connection point voltage and the inverter output current, thereby acquiring the original voltage timing data stream and current timing data stream containing the disturbance response information.

[0031] In step S320, based on the key frequency set and data block length, the grid-connected point voltage time-series data and inverter output current time-series data are demodulated in parallel using the frequency domain response vector based on the Goertzel algorithm to obtain a set of complex vectors for disturbance voltage and a set of complex vectors for disturbance current. It is understandable that traditional fast Fourier transform algorithms involve redundant calculations across the entire frequency band when processing spectrum analysis tasks and require a huge amount of storage space to establish a data buffer. This high computational and storage overhead is difficult to adapt to resource-constrained industrial control environments with extremely high real-time requirements. Therefore, in the technical solution of this application, the grid-connected point voltage time-series data and inverter output current time-series data are further demodulated in parallel using the frequency domain response vector based on the Goertzel algorithm, based on the key frequency set and data block length, to obtain a set of complex vectors for disturbance voltage and a set of complex vectors for disturbance current. This utilizes the extremely efficient frequency selection filtering characteristics of the Goertzel algorithm to selectively perform parallel recursive demodulation calculations only on the target frequency points. In this way, the amplitude and phase information of key frequency points can be accurately extracted from mixed signals containing a large amount of background noise with extremely low time and space complexity, realizing high-precision online spectrum sensing without affecting the core control task.

[0032] More specifically, in a concrete example of this application, the parallel demodulation process of the frequency domain response vector is implemented using a multi-instance parallel recursive architecture. First, the controller instantiates a corresponding number of Goertzel algorithm computation units in parallel in memory based on the number of frequencies in the key frequency set. Each unit is configured to lock and track only one specific target frequency component. Then, the collected grid-connected point voltage timing data and inverter output current timing data are fed point-by-point into these parallel computation units. Each unit performs real-time iterative calculations according to the preset data block length and the Goertzel recursive formula. This calculation process directly updates intermediate state variables on the data stream without repeatedly storing historical data. When the number of processed data points reaches the preset data block length, each computation unit performs a complex number operation using the final internal state variables to parse the real and imaginary parts of the corresponding frequency point, thereby synthesizing a complex vector characterizing the response characteristics of that frequency point. Finally, the voltage response vectors and current response vectors output by all computation units are collected to construct a set of perturbation voltage complex vectors and a set of perturbation current complex vectors for subsequent impedance calculations.

[0033] In step S330, discrete complex impedance calculations are performed on the set of complex vectors of disturbance voltage and the set of complex vectors of disturbance current to obtain a set of discrete complex impedance measurements. It is understood that since the voltage and current complex vectors obtained after demodulation only characterize the signal response state of the system under specific frequency excitation, the core indicator that truly determines the system's stability boundary and physical characteristics is the equivalent impedance attribute of the power grid at the grid connection point. If these independent signal responses are not mapped to impedance parameters, the subsequent model identification module will be unable to establish a mathematical relationship between signal characteristics and physical circuit topology. Therefore, in the technical solution of this application, discrete complex impedance calculations are further performed on the set of complex vectors of disturbance voltage and the set of complex vectors of disturbance current to obtain a set of discrete complex impedance measurements. This allows the phasor relationship between voltage and current to be transformed into quantitative complex impedance values ​​based on Ohm's law in the frequency domain. In this way, physical impedance data containing amplitude attenuation and phase shift information can be directly obtained, providing the most direct observation samples for constructing a high-precision power grid equivalent circuit model.

[0034] More specifically, in a concrete example of this application, the calculation of the discrete complex impedance is performed in the complex domain by point-by-point traversal. The controller first extracts the complex voltage response and complex current response at the same frequency point from the sets of complex disturbance voltage vectors and complex disturbance current vectors, based on the frequency index in the key frequency set. Then, a complex division operation is performed, using the complex voltage as the dividend and the complex current as the divisor, to calculate the complex impedance value corresponding to that frequency point. This complex impedance value contains both the real part of the resistivity and the imaginary part of the reactance. Finally, the calculated complex impedance value is associated and packaged with its corresponding frequency identifier to construct a standardized impedance measurement data pair, which is then stored in the discrete complex impedance measurement value set and passed as input data to the subsequent least-squares parameter identification module.

[0035] Specifically, in step S400, a set of discrete complex impedance measurements is subjected to least-squares-based grid model parameter identification to obtain grid model parameters. It is understood that since discrete complex impedance measurements only reflect grid characteristics at finite frequency points and lack a continuous description across the entire frequency band, they cannot be directly used to construct a complete Bode plot for accurate phase margin and gain margin calculations. Furthermore, simple numerical interpolation is insufficient to reflect the true physical resonance characteristics of the grid. Therefore, in the technical solution of this application, a set of discrete complex impedance measurements is further subjected to least-squares-based grid model parameter identification to obtain grid model parameters. This allows the discrete measurement data to be fitted and mapped to an equivalent circuit model with clear physical meaning, achieving a reverse solution from data points to physical parameters. In this way, the analytical characteristics of the mathematical model can be used to fill the spectral gaps between sampling points, thereby accurately reconstructing the full-band impedance characteristics, including the resonance peak and cutoff frequency, with a very small number of data points, providing a continuous and physically consistent model foundation for subsequent stability analysis.

[0036] More specifically, in a concrete example of this application, the parameter identification process follows a logical path from model building to numerical optimization. First, based on the typical physical structure of a weak grid, an analytical expression for the equivalent circuit model of the power grid, containing the parameters to be identified, is established. This analytical expression defines the theoretical functional relationship between impedance and frequency, where the resistance, inductance, and capacitance values ​​constitute the parameter vector to be solved. In a preferred embodiment of this application, considering the characteristics of long-distance transmission cables commonly found in weak grid environments, the equivalent impedance model of the power grid is... It is constructed as a second-order complex frequency domain structure with an inductor-resistor series branch and a parasitic capacitance branch connected in parallel.

[0037] To illustrate the above process more intuitively, let's take a real-world scenario where a wind turbine is connected to the grid via a 5km long cable as an example: When the external power grid undergoes structural adjustments (e.g., a parallel high-voltage line trips), the equivalent inductance on the grid side... Possibly from Sudden increase to At this point, the identification module of this system first converges and outputs the updated parameters within approximately 2-3 power frequency cycles through iterative calculations using the aforementioned iterative formula. Subsequently, the system was reconstructed using this parameter, revealing that the crossover frequency of the total loop gain increased from [previous frequency] due to the increase in inductance. Reduce to And the phase margin is from Deteriorated into Based on this precise quantization result, the adaptive tuning module immediately calculates the required proportional gain of the PI controller. Reduce by 30%, thereby restoring the phase margin to The above safety range effectively avoids subsynchronous oscillations caused by sudden changes in the characteristics of a weak power grid. Finally, the optimal parameter set corresponding to the algorithm's convergence is determined as the current power grid model parameters, thus completing the transformation from a discrete data space to a continuous physical parameter space.

[0038] Specifically, in step S500, based on the grid model parameters and the known models of the inverter LCL filter and control delay, a full-band impedance spectrum reconstruction and precise calculation of system stability margin are performed to obtain phase margin and gain margin. It is understandable that, because discrete impedance measurement data is discontinuous in the frequency domain, it is impossible to directly provide the precise locations of the gain crossover frequency and phase crossover frequency, which determine system stability. Furthermore, simple grid impedance information lacks the combined superposition effect of the inverter-side LCL filter resonance characteristics and the control delay phase lag on the loop gain, resulting in a significant blind spot when relying solely on measurement points for stability assessment. Therefore, in the technical solution of this application, a full-band impedance spectrum reconstruction and precise calculation of system stability margin are further performed based on the grid model parameters and the known models of the inverter LCL filter and control delay to obtain phase margin and gain margin. This allows for the analytical cascading of the identified grid physical model with the known hardware and control models of the inverter, constructing a continuous open-loop system transfer function across the entire frequency band. In this way, the amplitude and phase frequency details of the system in the full frequency domain can be accurately captured through mathematical analytical methods, thereby calculating the phase margin and gain margin that reflect the robustness of the real system without error, and eliminating the evaluation uncertainty caused by sparse sampling.

[0039] Figure 5 This document describes a flowchart illustrating the process of reconstructing the full-band impedance spectrum and accurately calculating the system stability margin using a known model based on grid model parameters, inverter LCL filter, and control delay, according to an embodiment of the PLC parameter tuning method based on online grid impedance identification in this application. The flowchart aims to obtain the phase margin and gain margin. Figure 5 As shown, step S500 further includes: S510, constructing a Laplace expression for the open-loop transfer function of the system based on the known models of the grid model parameters and the inverter LCL filter and control delay; S520, performing a numerical search for key frequency points on the Laplace expression of the open-loop transfer function of the system based on the frequency scanning specifications to obtain the gain crossover frequency and phase crossover frequency; S530, determining the phase margin and gain margin based on the gain crossover frequency and phase crossover frequency.

[0040] In step S510, a Laplace expression for the system's open-loop transfer function is constructed based on the grid model parameters and the known models of the inverter's LCL filter and control delay. It is understood that the dynamic stability of a grid-connected inverter system is not determined solely by the grid impedance, but rather by the combined interaction of the closed-loop system comprised of the controller, digital delay, LCL filter network, and grid impedance. The grid model parameters alone are insufficient to directly quantify the stability margin of the entire control loop. Therefore, in this application's technical solution, a Laplace expression for the system's open-loop transfer function is further constructed based on the grid model parameters and the known models of the inverter's LCL filter and control delay. This allows for the mathematical concatenation of the identified grid characteristics with the inherent hardware and control characteristics of the inverter in the complex frequency domain. This establishes a complete analytical model describing the system's dynamic behavior across the entire frequency domain, enabling precise capture of the LCL resonant peak shift and the cumulative effect of control delay on phase lag, providing a rigorous mathematical foundation for subsequent stability quantification assessment.

[0041] More specifically, in a particular example of this application, the construction process first decomposes the inverter current control loop into a controller part, a delay element, an inverter output impedance part, and a grid impedance part based on the system block diagram transformation rule in control theory. Then, it uses the Laplace transform to map them uniformly to the complex frequency domain space, and finally synthesizes the Laplace expression of the system open-loop transfer function as shown below:

[0042] In the formula, The Laplace expression representing the open-loop transfer function of the system. The equivalent output impedance of the LCL filter on the inverter side is derived from the known hardware parameters of the filter inductor, grid-side inductor, and filter capacitor. The grid impedance model obtained through online identification characterizes the dynamic characteristics of the external power grid at the grid connection point. The equivalent delay transfer function introduced for PWM modulation and digital computation is typically expressed as an exponential function containing the sampling period or its Padre approximation form. This is the transfer function of the current PI controller, including the proportional and integral coefficients. Under this mathematical model, taking the scenario of long-distance transmission line access in a weak power grid as an example, when the grid impedance... When the inductive component in the circuit increases significantly due to line switching, the magnitude and phase angle of the fractional terms (i.e., the grid coupling coefficient) in the above expression will change drastically, directly affecting the open-loop transfer function. The amplitude-frequency response curve rises at the crossover frequency and causes the phase-frequency response curve to lag further. This quantitative mathematical correlation enables the control system to accurately calculate the phase margin loss caused by the weakening of the power grid, thus providing a solid theoretical basis for the targeted adjustment of subsequent controller parameters.

[0043] In step S520, based on the frequency scanning specifications, a numerical search is performed on the Laplace expression of the system's open-loop transfer function to obtain the gain crossover frequency and phase crossover frequency. It is understandable that, since the constructed system open-loop transfer function is a high-order complex function containing multiple poles and zeros, directly solving for the precise frequency solutions with zero gain or negative 180 degrees phase using algebraic analytical methods is computationally extremely cumbersome and easily consumes excessive controller computation cycles. Therefore, in the technical solution of this application, a numerical search is further performed on the Laplace expression of the system's open-loop transfer function based on the frequency scanning specifications to obtain the gain crossover frequency and phase crossover frequency. This utilizes a discretized numerical approximation strategy to replace complex analytical solutions, quickly locking the boundary frequency points that determine system stability within the preset frequency band of interest. This ensures that the controller, with limited computing resources, can still locate key feature points on the Bode plot with extremely high numerical accuracy, thereby providing accurate frequency coordinates for subsequent calculations of the system's phase margin and gain margin.

[0044] More specifically, in a concrete example of this application, the numerical search process is strictly executed according to the logic of the frequency sweep algorithm. First, the controller sets the start frequency, end frequency, and scan step size of the search according to the frequency scan specifications, and replaces the Laplace operator with an imaginary frequency variable, thereby converting the transfer function into a frequency domain complex expression. Subsequently, the logarithm of the amplitude and the phase angle of the open-loop transfer function are calculated point by point within the scan range, and the relative positional relationship between the amplitude and the zero dB reference line and the phase and the -180 degree reference line between adjacent frequency points is monitored in real time. When the amplitude sign of two adjacent frequency points is detected to be flipped or the phase crosses the critical threshold, it is determined that there is a target characteristic frequency in the interval, and the linear interpolation calculation program is immediately started. Using the exact values ​​of the two endpoints of the interval and their slope relationship, the gain crossover frequency when the amplitude is exactly equal to zero dB and the phase crossover frequency when the phase is exactly equal to -180 degrees are calculated. For example, in scenarios where a sudden increase in grid impedance causes the system crossover frequency to shift to a lower frequency, this search mechanism can quickly capture the specific value of the crossover frequency point dropping from 2 kHz to 1,500 Hz through high-density numerical scanning, thereby providing a quantitative basis for subsequent judgment on whether the phase margin has deteriorated.

[0045] In step S530, the phase margin and gain margin are determined based on the gain crossover frequency and phase crossover frequency. It is understandable that simply knowing the specific values ​​of the gain crossover frequency and phase crossover frequency only marks the critical boundary position of system stability, but cannot directly quantify the safety margin of the system from instability. Furthermore, the adaptive controller needs to accurately calculate the adjustment step size of the proportional and integral coefficients based on a quantitative margin deviation. The lack of specific margin indicators will cause parameter tuning to lose its clear objective function. Therefore, in the technical solution of this application, the phase margin and gain margin are further determined based on the gain crossover frequency and phase crossover frequency. This transforms frequency domain characteristic points into standardized phase and gain reserve indicators that measure system robustness through rigorous mathematical definitions. This provides error feedback signals with clear physical meaning for subsequent control parameter optimization, ensuring that the system can maintain a sufficient stability safety zone based on accurate quantitative data when facing sudden changes in grid impedance.

[0046] More specifically, in a concrete example of this application, the determination process strictly follows the stability criterion formula in control theory to perform numerical calculations. First, for the calculation of the phase margin, the gain crossover frequency obtained through numerical search is substituted into the phase frequency response expression of the system's open-loop transfer function to calculate the actual phase lag angle at that frequency point, and the phase margin is calculated using the phase margin definition formula:

[0047] In the formula, For phase margin, For gain crossover frequency, The system's open-loop transfer function at frequency The phase angle at that time. This indicator directly reflects the maximum additional phase lag that the system can withstand when the gain is unity gain. Secondly, regarding the calculation of the gain margin, the phase crossover frequency is substituted into the amplitude-frequency response expression of the system's open-loop transfer function to calculate the amplitude gain at that frequency point, and the gain margin is calculated using the gain margin definition formula:

[0048] In the formula, For gain margin, The phase crossover frequency, The system's open-loop transfer function at frequency The amplitude modulus at that time This corresponds to a decibel value. This indicator quantifies the degree of gain attenuation from the critical oscillation point when the system phase lag reaches -180 degrees. In actual weak power grid scenarios, such as when a large load starts up at a remote location causing a sudden increase in the grid's equivalent inductive reactance, this calculation logic can capture in real time the phase angle at the gain crossover frequency deteriorating from -130° to -160°. Then, using the above formula, it calculates that the phase margin sharply decreases from 50° to 20°. This specific numerical decrease will serve as a key trigger signal, driving subsequent algorithms to immediately reduce the controller gain to restore sufficient phase reserve.

[0049] Specifically, in step S600, the proportional gain and integral gain are adaptively tuned based on the phase margin and gain margin to obtain the tuned PLC parameters. It is understood that due to the time-varying nature of the grid impedance, fixed control parameters cannot maintain the required stability margin of the system under all operating conditions. Especially under weak grid high impedance conditions, the phase lag of the open-loop transfer function will increase significantly. If the controller gain is not adjusted accordingly, the sharply decreasing phase margin will directly trigger resonance or instability of the grid-connected inverter. Therefore, in the technical solution of this application, the proportional gain and integral gain are further adaptively tuned based on the phase margin and gain margin to obtain the tuned PLC parameters. This allows the calculated accurate margin index to be compared with the preset ideal stability target, and the proportional and integral coefficients of the PI controller are dynamically adjusted according to the magnitude of the deviation, thereby actively reshaping the open-loop frequency characteristics of the system to offset the adverse effects of grid impedance changes. In this way, real-time closed-loop adaptive control of the controller parameters to changes in the grid environment can be achieved, ensuring that the system always operates in an optimal stable state with sufficient phase and gain reserves under complex scenarios such as grid strength switching or load fluctuations.

[0050] More specifically, in a specific example of this application, adaptive tuning of the proportional gain and integral gain based on phase margin and gain margin to obtain tuned PLC parameters includes: calculating target values ​​of the proportional gain and integral gain for the controller parameters based on the phase margin, gain margin, and margin specification target to obtain target controller parameters; and performing parameter smoothing transition between the target controller parameters and the controller parameters applied in the previous cycle to obtain tuned PLC parameters.

[0051] Accordingly, based on the phase margin, gain margin, and margin specification target, target values ​​for the proportional gain and integral gain are calculated to obtain the target controller parameters. It is understandable that, since the phase margin and gain margin are directly controlled by the open-loop gain characteristics of the PI controller, and there is a nonlinear coupling relationship between them, simple qualitative adjustments are insufficient to accurately eliminate stability deviations. Without quantitative calculations based on sensitivity analysis, the parameter tuning process is prone to oscillations of repeated trial and error, failing to converge quickly to the optimal operating point. Therefore, in the technical solution of this application, target values ​​for the proportional gain and integral gain are further calculated based on the phase margin, gain margin, and margin specification target to obtain the target controller parameters. This establishes a mathematical mapping relationship between stability index deviation and controller parameter adjustment, and the ideal parameter values ​​that meet the preset margin specification are directly derived through analytical calculation. This transforms the complex frequency domain stability problem into a deterministic algebraic solution problem, ensuring that each parameter update has a clear direction and quantification accuracy, thereby pulling the system back to a safe and stable operating region within the shortest control cycle.

[0052] More specifically, in a specific example of this application, the calculation process of the target parameter value is performed according to the sensitivity rule in automatic control theory. First, the controller reads the margin specification targets from the preset memory, such as a 45-degree lower limit for phase margin and a 6-dB lower limit for gain margin, and performs a difference operation with the currently calculated actual phase margin and gain margin to obtain the phase margin deviation and gain margin deviation. Then, based on the slope of the amplitude-phase characteristic of the system's open-loop transfer function near the cutoff frequency, a proportional gain adjustment factor is determined. This factor is inversely proportional to the phase margin deviation; that is, when the actual phase margin is lower than the target value, an attenuation factor less than 1 is generated to reduce the system bandwidth and thus improve the phase reserve. Next, the current proportional gain is multiplied and corrected using this adjustment factor to calculate the target proportional gain that can move the cutoff frequency to the target phase safety region. Finally, in order to maintain the inherent zero frequency of the PI controller and avoid introducing additional transient response distortion due to parameter adjustment, the target integral gain is calculated synchronously according to the principle of a constant ratio of the current integral gain to the proportional gain, thereby obtaining the target controller parameter set containing this pair of optimized parameters.

[0053] Accordingly, a parameter smoothing transition is performed on the target controller parameters and the controller parameters applied in the previous cycle to obtain the tuned PLC parameters. It is understandable that since a step-like change in the control loop gain directly leads to a sudden and drastic jump in the pulse width modulation duty cycle command, if the calculated target parameters are immediately applied in full to the operating inverter control system, it will inevitably cause severe current surges and voltage transient oscillations at the output, and may even trigger overcurrent protection shutdown. Therefore, in the technical solution of this application, a parameter smoothing transition is further performed on the target controller parameters and the controller parameters applied in the previous cycle to obtain the tuned PLC parameters. This dampens the rate of change of the parameters in the time domain, transforming the algebraic jump of the parameters into a smooth, gradual transition process. This enables disturbance-free switching of control parameters, ensuring that the inverter's output waveform remains smooth and continuous without additional transient distortion throughout the entire process of dynamic optimization of the system stability margin.

[0054] More specifically, in a concrete example of this application, the parameter smoothing transition process is implemented based on digital first-order low-pass filter logic. First, the controller invokes a preset smoothing factor, whose value is between zero and one, to define the step size weight of parameter updates within a single control cycle. Then, using the currently calculated target proportional gain and target integral gain as inputs to the filter, and the proportional gain and integral gain actually written to the hardware register in the previous control cycle as state feedback, the parameter values ​​to be applied in the next control cycle are calculated using a weighted average algorithm. Immediately afterwards, the smoothed parameter values ​​are written into the PLC controller's execution register to take effect immediately, and simultaneously updated to the controller parameters applied in the previous cycle for use in the next operation cycle. This smoothing iteration process continues for several subsequent control cycles until the actual applied controller parameter values ​​asymptotically converge to the target controller parameter values, thus completing a full flexible parameter update.

[0055] In summary, the PLC parameter tuning method based on online grid impedance identification according to the embodiments of this application is explained. It dynamically locks sensitive frequency bands, including the fundamental frequency, crossover frequency, and potential resonant points, by constructing a key frequency adaptive selection mechanism and combining LCL filter characteristics with real-time grid conditions. It also predicts and tracks grid resonance drift using historical identification results. Based on this, it efficiently acquires discrete complex impedance data at key frequency points by using multi-frequency composite disturbance injection and parallel demodulation with the Goertzel algorithm. Furthermore, it uses this discrete data to identify parameters of the grid physical model and reconstructs the continuous impedance spectrum across the entire frequency band, thus overcoming the information blind spot caused by sparse measurements. Based on the reconstructed full-band information and the known inverter model, it constructs the system open-loop transfer function and accurately calculates the phase margin and gain margin. Finally, it adaptively tunes the proportional and integral gains of the PLC controller based on this precise margin, achieving robust control and stability optimization in complex grid environments under computationally limited conditions.

[0056] Furthermore, a PLC parameter tuning system based on online identification of power grid impedance is also provided.

[0057] Figure 6 This is a block diagram of a PLC parameter tuning system based on online identification of power grid impedance according to an embodiment of this application. Figure 6 As shown, the PLC parameter tuning system 100 based on online identification of grid impedance according to an embodiment of this application includes: a frequency acquisition module 110, used to acquire the nominal resonant frequency of the LCL filter, the target crossover frequency, and the fundamental frequency of the grid; a key frequency adaptive selection module 120, used to perform key frequency adaptive selection on the nominal resonant frequency of the LCL filter, the target crossover frequency, and the fundamental frequency of the grid to obtain a key frequency set; and a target frequency injection and response synchronous extraction module 130, used to perform target frequency injection and response synchronous extraction based on the key frequency set to obtain a set of discrete complex impedances. The system includes: a measured value module; a power grid model parameter identification module 140, used to identify power grid model parameters based on least squares from a set of discrete complex impedance measurements to obtain power grid model parameters; an impedance spectrum reconstruction and system stability margin calculation module 150, used to perform full-band impedance spectrum reconstruction and accurate system stability margin calculation based on the known models of the power grid model parameters, inverter LCL filter, and control delay to obtain phase margin and gain margin; and an adaptive tuning module 160, used to adaptively tune the proportional gain and integral gain based on the phase margin and gain margin to obtain tuned PLC parameters.

[0058] As described above, the PLC parameter tuning system 100 based on online grid impedance identification according to the embodiments of this application can be implemented in various types of computing devices or control units. For example, it can be deployed in a programmable logic controller (PLC) within a photovoltaic inverter or energy storage converter control cabinet, a digital signal processor (DSP) assisting the PLC in high-frequency signal processing, or a high-performance industrial computer integrated into a microgrid central controller and power quality management equipment. In one possible implementation, the PLC parameter tuning system 100 based on online grid impedance identification according to the embodiments of this application can be integrated into the computing device as a software module and / or a hardware module. For example, the PLC parameter tuning system 100 based on online grid impedance identification can be an intelligent control function block in the computing device or PLC operating environment. This software module is configured to perform adaptive selection of key frequency points and multi-frequency composite disturbance injection, parallel demodulation of voltage and current frequency domain response based on the Goertzel algorithm, parameter identification of the grid equivalent circuit model based on the least squares method, and accurate calculation of system stability margin and adaptive tuning of PI controller parameters based on full-band impedance spectrum reconstruction. Alternatively, it can be a dedicated robust control algorithm program for grid-connected inverters developed for the computing device. Of course, the PLC parameter tuning system 100 based on online grid impedance identification can also be one of many hardware modules in the computing device or control unit, or it can be embedded in a field-programmable gate array circuit to accelerate the recursive operation of the multi-channel Goertzel algorithm and the real-time analysis process of complex impedance in parallel, or it can be a grid characteristic sensing signal processing integrated circuit for a specific application.

[0059] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A PLC parameter tuning method based on online identification of power grid impedance, characterized in that, include: Obtain the nominal resonant frequency, target crossover frequency, and fundamental frequency of the power grid for the LCL filter; A set of key frequencies is obtained by adaptively selecting the nominal resonant frequency, target crossover frequency, and fundamental frequency of the power grid for the LCL filter. Target frequency injection and response synchronization extraction are performed based on a set of key frequencies to obtain a set of discrete complex impedance measurements; The power grid model parameters are obtained by least-squares-based identification of a set of discrete complex impedance measurements. Based on the known models of grid model parameters, inverter LCL filter and control delay, full-band impedance spectrum reconstruction and accurate calculation of system stability margin are performed to obtain phase margin and gain margin. Based on phase margin and gain margin, the proportional gain and integral gain are adaptively tuned to obtain the tuned PLC parameters.

2. The PLC parameter tuning method based on online identification of power grid impedance according to claim 1, characterized in that, A set of key frequencies is obtained by adaptively selecting the nominal resonant frequency, target crossover frequency, and fundamental frequency of the LCL filter, including: Based on the nominal resonant frequency of the LCL filter, the target crossover frequency, and the fundamental frequency of the power grid, a set of reference frequencies is determined. Dynamic tracking and prediction of the grid resonance point are performed on the grid model parameters identified in the previous cycle to obtain the predicted high-frequency detection point; The key frequency set is obtained by synthesizing and verifying the reference frequency set and the predicted high-frequency detection points.

3. The PLC parameter tuning method based on online identification of power grid impedance according to claim 1, characterized in that, Based on a set of key frequencies, target frequency injection and response synchronization extraction are performed to obtain a set of discrete complex impedance measurements, including: Digital synthesis and injection of multi-frequency composite disturbance current are performed on the disturbance injection specifications, fundamental current reference and sampling time to obtain grid connection point voltage timing data and inverter output current timing data; Based on the key frequency set and data block length, parallel demodulation of frequency domain response vectors based on the Goertzel algorithm is performed on the grid connection point voltage time series data and inverter output current time series data to obtain the set of complex vectors of disturbance voltage and the set of complex vectors of disturbance current. Discrete complex impedance calculations are performed on the set of complex vectors of disturbance voltage and the set of complex vectors of disturbance current to obtain a set of discrete complex impedance measurements.

4. The PLC parameter tuning method based on online identification of power grid impedance according to claim 1, characterized in that, Based on the known models of grid model parameters, inverter LCL filter, and control delay, a full-band impedance spectrum reconstruction and accurate system stability margin calculation are performed to obtain phase margin and gain margin, including: Based on the known model of the power grid model parameters and the inverter LCL filter and control delay, the Laplace expression of the system open-loop transfer function is constructed; Based on the frequency scanning specifications, the Laplace expression of the system's open-loop transfer function is numerically searched at key frequency points to obtain the gain crossover frequency and phase crossover frequency. The phase margin and gain margin are determined based on the gain crossover frequency and the phase crossover frequency.

5. The PLC parameter tuning method based on online identification of power grid impedance according to claim 4, characterized in that, The Laplace expression for the open-loop transfer function of the system is: in, The Laplace expression representing the open-loop transfer function of the system. The equivalent output impedance of the LCL filter on the inverter side is . To obtain the grid impedance mode obtained online, The equivalent delay transfer function introduced for PWM modulation and digital calculation. This is the transfer function of the current PI controller.

6. The PLC parameter tuning method based on online identification of power grid impedance according to claim 4, characterized in that, The phase margin and gain margin are determined based on the gain crossover frequency and phase crossover frequency, including by using the following formulas: in, For gain margin, For phase margin, For gain crossover frequency, The phase crossover frequency, The system's open-loop transfer function at frequency Phase angle at time The system's open-loop transfer function at frequency The amplitude modulus at that time This corresponds to the decibel value.

7. The PLC parameter tuning method based on online identification of power grid impedance according to claim 1, characterized in that, Based on phase margin and gain margin, adaptive tuning of proportional gain and integral gain is performed to obtain tuned PLC parameters, including: Based on the phase margin, gain margin, and margin specification target, the target values ​​of the controller parameters for the proportional gain and integral gain are calculated to obtain the target controller parameters. Perform parameter smoothing transition between the target controller parameters and the controller parameters applied in the previous cycle to obtain the tuned PLC parameters.

8. A PLC parameter tuning system based on online identification of power grid impedance, characterized in that, include: The frequency acquisition module is used to acquire the nominal resonant frequency of the LCL filter, the target crossover frequency, and the fundamental frequency of the power grid. The critical frequency adaptive selection module is used to adaptively select the critical frequencies from the nominal resonant frequency of the LCL filter, the target crossover frequency, and the fundamental frequency of the power grid to obtain a set of critical frequencies. The target frequency injection and response synchronization extraction module is used to perform target frequency injection and response synchronization extraction based on a set of key frequencies to obtain a set of discrete complex impedance measurements. The power grid model parameter identification module is used to perform least squares-based power grid model parameter identification on a set of discrete complex impedance measurements to obtain the power grid model parameters. The impedance spectrum reconstruction and system stability margin calculation module is used to perform full-band impedance spectrum reconstruction and accurate calculation of system stability margin based on the known model of grid model parameters and inverter LCL filter and control delay to obtain phase margin and gain margin. The adaptive tuning module is used to adaptively tune the proportional gain and integral gain based on the phase margin and gain margin to obtain the tuned PLC parameters.

9. The PLC parameter tuning system based on online identification of power grid impedance according to claim 8, characterized in that, The key frequency adaptive selection module includes: The reference frequency set determination unit is used to determine the reference frequency set based on the nominal resonant frequency of the LCL filter, the target crossover frequency, and the fundamental frequency of the power grid. The dynamic tracking and prediction unit is used to dynamically track and predict the grid resonance point of the grid model parameters identified in the previous cycle in order to obtain the predicted high-frequency detection point. The synthesis and verification unit is used to synthesize and verify the reference frequency set and the predicted high-frequency detection points to obtain the key frequency set.

10. The PLC parameter tuning system based on online identification of power grid impedance according to claim 8, characterized in that, The target frequency injection and response synchronization extraction module includes: The digital synthesis and injection unit is used to perform digital synthesis and injection of multi-frequency composite disturbance current based on the disturbance injection specification, fundamental current reference, and sampling time to obtain grid connection point voltage timing data and inverter output current timing data. The frequency domain response vector parallel demodulation unit is used to perform frequency domain response vector parallel demodulation on grid-connected point voltage timing data and inverter output current timing data based on the key frequency set and data block length to obtain the set of complex vectors of disturbance voltage and the set of complex vectors of disturbance current. The discrete complex impedance calculation unit is used to perform discrete complex impedance calculations on the set of complex vectors of disturbance voltage and the set of complex vectors of disturbance current to obtain a set of discrete complex impedance measurements.