Transient energy demand minimization control method for virtual synchronous generator

CN122931855APending Publication Date: 2026-10-16SHANGHAI JIAOTONG UNIV +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611274552.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-21
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0005]本发明针对现有技术中频率恢复阶段持续输出支撑功率导致能量消耗过大、暂态能量需求未纳入在线约束,以及缺乏兼顾频率安全与能量消耗协调机制的技术问题,提供用于虚拟同步发电机的暂态能量需求最小化控制方法

Benefits of technology

相较于现有技术,本发明首先通过采集并网点频率和VSG输出功率,在线计算频率偏差和频率变化率,为扰动状态的实时识别提供了基础。其次,在扰动窗口内对VSG支撑功率相对于基准功率的偏差进行累计,得到暂态能量需求,将支撑能量消耗从离线评价指标转化为在线可感知的控制变量,使控制器能够实时掌握当前已消耗的支撑能量水平。再次,通过频率偏差计算频率安全裕度,通过暂态能量需求与预设能量预算的比值计算暂态能量裕度,并基于频率安全裕度和暂态能量裕度联合生成支撑强度修正系数,实现了频率安全约束与能量消耗约束的协同决策。最后,根据支撑强度修正系数调节VSG的下垂系数、阻尼系数和功率限幅等控制参数,生成经修正的有功支撑指令,在频率安全裕度充裕时主动降低非必要支撑功率以减少能量消耗,在频率安全裕度不足时优先保障频率支撑,在连续扰动场景下根据剩余能量预算动态调整支撑策略。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122931855A_ABST
    Figure CN122931855A_ABST
Patent Text Reader

Abstract

The application discloses a transient energy demand minimization control method for a virtual synchronous generator and relates to the technical field of power electronic inverter grid-connected control. The method comprises the following steps: collecting the frequency of a grid-connected point and the output power of the virtual synchronous generator, calculating the frequency deviation and the frequency change rate; identifying the disturbance state and cumulating the support power of the virtual synchronous generator in a disturbance window to obtain the transient energy demand; calculating the frequency safety margin according to the frequency deviation, calculating the transient energy margin according to the ratio of the transient energy demand to the preset energy budget, and jointly generating the support strength correction coefficient according to the frequency safety margin and the transient energy margin; adjusting the control parameters of the virtual synchronous generator according to the support strength correction coefficient to generate the corrected virtual synchronous generator support instruction. The application reduces the transient energy consumption under the premise of guaranteeing the frequency safety and improves the sustainable support capability of the energy storage type virtual synchronous generator in the continuous disturbance scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of grid-connected control technology for power electronic inverters, and more specifically to a transient energy demand minimization control method for virtual synchronous generators. Background Technology

[0002] Virtual synchronous generator (VSG) control simulates the inertia, damping, and droop characteristics of a synchronous generator, enabling the grid-connected converter to actively provide active power support when the grid frequency deviates from its rated value. In energy storage-type VSG grid-connected systems, when frequency disturbances occur in the grid, the VSG generates active power support commands based on the frequency deviation at the grid connection point and the rate of frequency change. It releases the energy stored in the energy storage device to suppress frequency drops or rises, and its support effect directly determines the system's frequency dynamic response performance. Typical VSG control methods simulate the rotor motion characteristics of a synchronous generator based on virtual oscillation equations, while introducing a droop control loop to achieve primary frequency regulation, giving the grid-connected converter a frequency response capability similar to that of a synchronous generator.

[0003] However, existing VSG control methods have the following shortcomings. First, existing controls typically use the lowest or highest frequency point as the primary optimization target, failing to adequately consider the energy consumption of the support system throughout the entire disturbance process. With limited energy storage capacity, if a large support power is continuously output during the frequency recovery phase, it will lead to increased transient energy demand, potentially resulting in the loss of subsequent support capability due to premature depletion of stored energy in continuous disturbance scenarios. Second, while phased adaptive control can reduce support strength during the recovery phase, the control criterion is still based on frequency phase identification, and transient energy demand has not yet been incorporated as an online constraint variable into command generation. The controller cannot perceive the relative relationship between consumed energy and available budget. Third, prematurely weakening support simply to reduce energy consumption may lead to deterioration of frequency extrema or secondary deviations; existing methods lack a coordination mechanism that balances frequency safety and energy consumption. Fourth, transient energy demand is mostly used as an offline evaluation indicator, failing to form a complete closed-loop control chain encompassing online calculation, margin judgment, strength correction, and command generation.

[0004] Therefore, there is an urgent need for a VSG support control method that can minimize transient energy demand under frequency security constraints. Summary of the Invention

[0005] This invention addresses the technical problems in existing technologies, such as excessive energy consumption due to continuous output of supporting power during the frequency recovery phase, lack of online constraints on transient energy demand, and lack of a mechanism to coordinate frequency safety and energy consumption. It provides a transient energy demand minimization control method for virtual synchronous generators.

[0006] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: This invention provides a transient energy demand minimization control method for a virtual synchronous generator, comprising: Collect the grid connection point frequency and the output power of the virtual synchronous generator, and calculate the frequency deviation and frequency change rate; The disturbance state is identified based on the frequency deviation and the rate of frequency change, and the support power of the virtual synchronous generator is accumulated within the disturbance window to obtain the transient energy demand. The frequency safety margin is calculated based on the frequency deviation, the transient energy margin is calculated based on the ratio of transient energy demand to preset energy budget, and the support strength correction coefficient is generated by combining the frequency safety margin and the transient energy margin. The control parameters of the virtual synchronous generator are adjusted according to the support strength correction coefficient to generate the corrected virtual synchronous generator support command.

[0007] The beneficial effects of this invention are: Compared to existing technologies, this invention firstly collects the grid connection point frequency and VSG output power, and calculates the frequency deviation and frequency change rate online, providing a foundation for real-time identification of disturbance states. Secondly, it accumulates the deviation of the VSG support power relative to the reference power within the disturbance window to obtain the transient energy demand, transforming support energy consumption from an offline evaluation indicator into an online, perceptible control variable, enabling the controller to monitor the current level of consumed support energy in real time. Thirdly, it calculates the frequency safety margin through the frequency deviation and the transient energy margin through the ratio of the transient energy demand to the preset energy budget, and generates a support strength correction coefficient based on the frequency safety margin and the transient energy margin, achieving coordinated decision-making between frequency safety constraints and energy consumption constraints. Finally, it adjusts the VSG's droop coefficient, damping coefficient, and power limiting control parameters according to the support strength correction coefficient, generating a corrected active power support command. When the frequency safety margin is sufficient, it proactively reduces unnecessary support power to reduce energy consumption; when the frequency safety margin is insufficient, it prioritizes frequency support; and in continuous disturbance scenarios, it dynamically adjusts the support strategy based on the remaining energy budget.

[0008] This invention solves the technical problems in the prior art, such as excessive energy consumption due to continuous output of support power during the frequency recovery phase, failure to include transient energy demand in online constraints, and lack of a mechanism to coordinate frequency security and energy consumption. Attached Figure Description

[0009] Figure 1 A flowchart illustrating the transient energy demand minimization control method for a virtual synchronous generator provided by the present invention; Figure 2 A schematic diagram of the transient energy demand minimization control method for a virtual synchronous generator provided by the present invention; Figure 3This is a schematic diagram of the system provided by the present invention. Detailed Implementation

[0010] Examples, such as Figure 1 , Figure 2 As shown, this embodiment of the invention provides a transient energy demand minimization control method for a virtual synchronous generator, including: S10: Collect the grid connection point frequency and the output power of the virtual synchronous generator, and calculate the frequency deviation and frequency change rate; During the grid-connected operation of a virtual synchronous generator (VSR), various frequency disturbance events may occur on the grid side, such as conventional load switching, large-capacity unit tripping, or fluctuations in renewable energy power. These disturbance events disrupt the supply and demand balance of active power in the grid, causing the grid connection point frequency to deviate from its rated value. One of the core functions of a VSR is to proactively provide active power support when the frequency deviates, in order to suppress excessive frequency drops or rises. The generation of its support commands requires accurate frequency status information.

[0011] This step involves acquiring the grid connection point frequency and the virtual synchronous generator output power. The grid connection point frequency refers to the actual grid frequency at the connection point between the virtual synchronous generator and the grid, which can be obtained through a frequency measurement device or phase-locked loop at the grid connection point. The virtual synchronous generator output power refers to the actual active power injected into the grid by the converter at the current moment, which can be obtained from the power calculation module of the converter control system. These two physical quantities are the fundamental inputs for subsequent calculations of frequency deviation, frequency change rate, and transient energy demand.

[0012] Specifically, in this embodiment, the grid connection point frequency and the output power of the virtual synchronous generator are collected, and the frequency deviation and frequency change rate are calculated, including: Obtain the rated frequency at the grid connection point, and use the difference between the grid connection point frequency and the rated frequency as the frequency deviation; The frequency deviation at multiple consecutive sampling times is obtained, the frequency deviation is differentially calculated, and the ratio of the differential result to the sampling period is used as the frequency change rate.

[0013] First, obtain the rated frequency at the grid connection point. The difference between the grid connection point frequency and the rated frequency is taken as the frequency deviation. The rated frequency at the grid connection point refers to the standard frequency value specified by the power system, which is usually 50 Hz in the power system. The formula for calculating the frequency deviation is: Frequency Deviation = Grid Connection Point Frequency - Rated Frequency. When the frequency deviation is positive, it indicates that the grid connection point frequency is higher than the rated frequency, and the system has an active power surplus; when the frequency deviation is negative, it indicates that the grid connection point frequency is lower than the rated frequency, and the system has an active power deficit. The larger the absolute value of the frequency deviation, the more severe the power imbalance.

[0014] Secondly, the frequency deviation at multiple consecutive sampling times is obtained, and the frequency deviation is differentially calculated. The ratio of the differential result to the sampling period is used as the frequency change rate. The sampling period refers to the time interval between two adjacent samples from the control system. It is set comprehensively based on the hardware sampling capability of the control system, the processing speed of the digital signal processor, and the time scale requirements of the VSG control for frequency dynamic response; for example, it can be set to 10 milliseconds or 20 milliseconds.

[0015] For example, let the current sampling time be k, the previous sampling time be k-1, the frequency deviation at the current time be Δf(k), and the frequency deviation at the previous time be Δf(k-1). Then, the formula for calculating the frequency change rate is: Frequency change rate = (Current time frequency deviation - Previous time frequency deviation) / Sampling period, that is, frequency change rate df / dt = [Δf(k) - Δf(k-1)] / Ts. The unit of this frequency change rate is Hertz per second. A positive value indicates that the frequency is increasing, and a negative value indicates that the frequency is decreasing. The larger the absolute value, the more drastic the frequency change.

[0016] The combination of frequency deviation and frequency change rate can comprehensively describe the instantaneous dynamic state of the grid connection point frequency, providing a basis for subsequent disturbance state identification. Specifically, frequency deviation refers to the degree of deviation of the grid connection point frequency from the rated frequency, reflecting the magnitude of the current system's active power deficit or surplus. Frequency change rate refers to the rate of change of frequency deviation over time, reflecting the speed of the frequency dynamic process and used to determine whether the frequency is in a deteriorating or recovering trend.

[0017] When the absolute value of the frequency deviation is large and the rate of frequency change is large, it indicates that the system is experiencing a severe active power disturbance; when the absolute value of the frequency deviation gradually decreases and the rate of frequency change gradually approaches zero, it indicates that the system is recovering to a steady state. Using the calculated frequency deviation and rate of frequency change as inputs for subsequent disturbance state identification can help determine the current disturbance stage, thus providing a basis for online accumulation of transient energy demand and decision-making regarding support strength.

[0018] S20: Identify the disturbance state based on the frequency deviation and frequency change rate, and accumulate the virtual synchronous generator support power within the disturbance window to obtain the transient energy demand; Secondly, after obtaining the frequency deviation and frequency change rate, it is necessary to identify the current disturbance state of the power grid in real time, and accumulate the supporting power deviation of the virtual synchronous generator within the disturbance window based on the identification results, so as to obtain the transient energy demand.

[0019] Power grid frequency disturbances are a dynamic process that evolves over time, with varying requirements for VSG support at different stages. During the frequency deterioration stage, the absolute value of the frequency deviation continues to increase, exacerbating the imbalance of active power in the system. At this time, strong active power support from the VSG is needed to suppress excessive frequency deviation. During the frequency recovery stage, the absolute value of the frequency deviation begins to decrease, and the system begins to recover on its own. Maintaining the same support strength as during the deterioration stage would lead to unnecessary energy consumption and could potentially cause frequency overshoot. Furthermore, when the frequency recovers to near its rated value and then deviates again, a secondary deviation occurs, requiring the system to re-engage support. Therefore, based on the sign and magnitude of the frequency deviation and the rate of frequency change, the disturbance process needs to be divided into a steady-state stage, a frequency deterioration stage, a frequency recovery stage, and a secondary deviation stage to implement differentiated support strategies.

[0020] Specifically, in this embodiment, identifying the disturbance state based on frequency deviation and frequency change rate includes: When the absolute value of the frequency deviation is greater than the preset dead zone threshold and the product of the frequency deviation and the frequency change rate is less than zero, it is determined to be the frequency recovery stage. When the absolute value of the frequency deviation is greater than the preset dead zone threshold and the product of the frequency deviation and the frequency change rate is greater than zero, it is determined to be in the frequency deterioration stage. When the absolute value of the frequency deviation is less than or equal to the preset dead zone threshold, it is determined to be in a steady state. When the absolute value of the frequency deviation increases again after the recovery phase and exceeds the preset second deviation threshold, it is determined to be the second deviation phase.

[0021] Specifically, the disturbance state is identified based on frequency deviation and frequency change rate, and the stage division rules are explained in detail below: The preset dead zone threshold is a critical value used to distinguish whether a significant frequency deviation has occurred. It can be set comprehensively based on the grid's tolerance for frequency deviation and the accuracy of the frequency measurement device; for example, it can be set to 0.03 Hz. When the absolute value of the frequency deviation is less than or equal to the preset dead zone threshold, it is determined to be in a steady state. At this time, the frequency is within the allowable fluctuation range near the rated value, the system's active power supply and demand are basically balanced, and the VSG does not need to provide additional active power support. In the steady state stage, the cumulative transient energy demand is suspended, and the support strength correction coefficient remains at the baseline value or gradually recovers to the baseline value.

[0022] When the absolute value of the frequency deviation exceeds the preset dead zone threshold, and the product of the frequency deviation and the rate of frequency change is greater than zero, it is determined to be in the frequency degradation stage. A product of frequency deviation and the rate of frequency change greater than zero means that the sign of the frequency deviation is the same as the sign of the rate of frequency change, that is, the frequency is further deviating from the rated value. When the frequency deviation is negative and the rate of frequency change is negative, the frequency is continuing to decrease, and the system's active power deficit is still increasing; when the frequency deviation is positive and the rate of frequency change is positive, the frequency is continuing to increase, and the system's active power surplus is still increasing. In the frequency degradation stage, the system's active power imbalance has not yet reached its peak, and the frequency deviation trend continues. At this time, the VSG should maintain strong active power support to suppress excessive frequency deviation.

[0023] Furthermore, when the absolute value of the frequency deviation is greater than the preset dead zone threshold, and the product of the frequency deviation and the frequency change rate is less than zero, it is determined to be in the frequency recovery phase. A product of frequency deviation and frequency change rate less than zero means that the sign of the frequency deviation is opposite to the sign of the frequency change rate, that is, the frequency is returning to its rated value. When the frequency deviation is negative and the frequency change rate is positive, the frequency is recovering upwards; when the frequency deviation is positive and the frequency change rate is negative, the frequency is recovering downwards. In the frequency recovery phase, the imbalance of the system's active power has begun to decrease, the frequency extreme point has passed, and the system has a certain self-recovery capability. The VSG can appropriately reduce its support strength to reduce unnecessary energy consumption and avoid frequency overshoot caused by continuous strong support.

[0024] Furthermore, a secondary deviation phase is defined as when the absolute value of the frequency deviation increases again after the recovery phase and exceeds the preset secondary deviation threshold. During frequency recovery, if the system is subjected to new disturbances or the effects of existing disturbances have not been fully mitigated, the absolute value of the frequency deviation may increase again after a brief decrease, forming a secondary deviation. The preset secondary deviation threshold can be set according to the system's sensitivity to secondary disturbances; for example, it can be set to a value slightly higher than the preset dead zone threshold, such as 0.05 Hz. The secondary deviation phase indicates that the system has encountered a new power imbalance or premature support withdrawal during the recovery process. In this case, the VSG should be re-engaged to prevent the frequency from deteriorating again.

[0025] It is important to note that the recovery phase refers to the entire period from the peak value of the frequency deviation continuously decreasing until it enters a steady state or a second deviation occurs. Its starting point is the moment when the product of the frequency deviation and the rate of change of frequency changes from positive to negative, i.e., the frequency extreme point. The ending point is the moment when the absolute value of the frequency deviation increases again and exceeds the preset second deviation threshold, or the moment when the absolute value of the frequency deviation first enters the dead zone. The determination of the recovery phase can be updated in real time based on the change in the sign of the product of the frequency deviation and the rate of change of frequency. When the sign of the product changes from positive to negative, it signifies the end of the frequency deterioration phase and the beginning of the recovery phase; when the sign of the product changes from negative to positive and the absolute value of the frequency deviation exceeds the preset second deviation threshold, it signifies the end of the recovery phase and the beginning of the second deviation phase.

[0026] In summary, by using the above-mentioned phase division rules, the controller can adaptively adjust the support strategy according to the characteristics of different phases throughout the disturbance process, maintain necessary support during the frequency deterioration and secondary deviation phases, and appropriately reduce the support strength during the frequency recovery phase, thereby achieving a balance between frequency security and energy consumption.

[0027] Furthermore, while identifying the disturbance state, it is necessary to accumulate the VSG support power within the disturbance window to obtain the transient energy demand. Specifically, the active power output by the VSG during a disturbance consists of two parts: one part is the baseline power required to maintain steady-state operation before the disturbance, and the other part is the additional support power output under frequency deviation. The transient energy demand characterizes the total amount of energy consumed by the VSG to provide frequency support from the start of the disturbance to the current moment. By accumulating the transient energy demand online, the controller can perceive the current level of consumed support energy in real time, providing a basis for subsequent comparison with the preset energy budget, and thus participating in the decision-making of support strength.

[0028] Specifically, in this embodiment, the supporting power of the virtual synchronous generator is accumulated within the disturbance window to obtain the transient energy demand, including: The output power of the virtual synchronous generator at the steady state before the disturbance is obtained as the reference power. The moment when the absolute value of the frequency deviation first exceeds the preset dead zone threshold is taken as the disturbance start time. Starting from the disturbance start time and ending at the current time, the absolute value of the difference between the output power of the virtual synchronous generator and the reference power is accumulated to obtain the transient energy demand.

[0029] The first step is to obtain the output power of the virtual synchronous generator (VSG) at the steady-state moment before the disturbance as the reference power. When the grid frequency is in a steady-state phase, the supply and demand of active power in the system are basically balanced, and the output power of the VSG is at a relatively stable level. This steady-state power value reflects the active power output required by the VSG to maintain normal operation before the disturbance occurs. The deviation of the active power output by the VSG during the subsequent disturbance from this reference value is the additional power component released or absorbed by the VSG to provide frequency support. The reference power is selected by performing a moving average of the VSG output power over a preset period of time before the disturbance occurs, and using the average value as the reference power to eliminate the influence of measurement noise and small power fluctuations on the reference value. For example, the average power value within 2 seconds before the disturbance can be selected as the reference power.

[0030] The second step is to define the moment when the absolute value of the frequency deviation first exceeds the preset dead-zone threshold as the disturbance initiation moment. During the steady-state phase, the absolute value of the frequency deviation is less than or equal to the preset dead-zone threshold, and the VSG does not provide additional support. When an external disturbance causes an imbalance between the system's active power supply and demand, the frequency begins to deviate from its rated value. When the absolute value of the frequency deviation first exceeds the preset dead-zone threshold, it indicates that a disturbance has occurred and is significant enough to require VSG support. This moment is marked as the disturbance initiation moment, serving as the starting point for the accumulation of transient energy demand.

[0031] The third step involves accumulating the absolute value of the difference between the virtual synchronous generator's output power and the reference power, starting from the beginning of the disturbance and ending at the current time, to obtain the transient energy demand. During the disturbance, the difference between the VSG output power and the reference power at each sampling moment reflects the additional support power output by the VSG to cope with the disturbance at that moment. Accumulating the absolute value of this difference from the beginning of the disturbance to the current time yields the transient energy demand. The unit of transient energy demand is watt-seconds or joules. When the VSG output power is higher than the reference power, it indicates that the VSG is releasing energy to support the frequency; when the VSG output power is lower than the reference power, it indicates that the VSG is absorbing energy to suppress frequency rise. Using the absolute value accumulation method can simultaneously cover energy consumption under both frequency drop and frequency rise disturbance directions.

[0032] Through the above online accumulation, transient energy demand can reflect in real time the total amount of support energy consumed by the VSG during the current disturbance. When the disturbance ends and the frequency returns to the steady state, the accumulation of transient energy demand is paused, and will resume from zero or continue to accumulate based on the remaining energy budget of the previous round when the next disturbance occurs.

[0033] Furthermore, the supporting power of the virtual synchronous generator is accumulated within the disturbance window to obtain the transient energy demand, which then includes: A transient energy demand forecasting model is established. The transient energy demand forecasting model takes the frequency deviation, frequency change rate and virtual synchronous generator output power at the current moment as inputs and the estimated transient energy demand within the forecast time window as output. The length of the prediction time window is determined based on the rate of change of frequency, and the length of the prediction time window is negatively correlated with the absolute value of the rate of change of frequency. The frequency deviation, frequency change rate, and virtual synchronous generator output power at the current moment are input into the transient energy demand prediction model. Forward extrapolation is performed within the prediction time window to obtain the estimated transient energy demand. When the estimated transient energy demand exceeds the preset energy budget, the support strength correction coefficient is reduced in advance during the frequency deterioration phase.

[0034] In addition, after accumulating the virtual synchronous generator support power within the disturbance window to obtain the transient energy demand, this embodiment also includes the steps of transient energy demand prediction and early intervention, which are explained in detail below: First, a transient energy demand forecasting model is established. This model takes the current frequency deviation, frequency change rate, and virtual synchronous generator output power as inputs, and outputs the estimated transient energy demand within the forecast time window. Since the transient energy demand is the cumulative value of the VSG support power deviation over time, its future trend is jointly influenced by the current frequency deviation magnitude, the rate of frequency change, and the current output power level.

[0035] Optionally, the transient energy demand forecasting model can employ a simplified physical model or a data-driven model. Taking the simplified physical model as an example, assuming that the rate of frequency change remains constant within the forecast time window, the frequency deviation at each future moment can be estimated based on the current frequency deviation and the rate of frequency change, thereby estimating the supporting power response of the VSG. Finally, the transient energy demand forecast is obtained by integrating the supporting power deviation.

[0036] Secondly, the length of the forecast time window is determined based on the frequency change rate, which is negatively correlated with the absolute value of the frequency change rate. When the absolute value of the frequency change rate is large, it indicates that the frequency is changing rapidly, future uncertainty is high, and the reliability of long-distance forecasts is low. In this case, the forecast time window should be shortened accordingly to focus on an accurate estimate of energy demand in the near term. Conversely, when the absolute value of the frequency change rate is small, it indicates that the frequency change is relatively gradual and the future trend is relatively stable. In this case, the forecast time window can be appropriately extended to cover energy demand over a longer period.

[0037] Preferably, the mapping relationship between the length of the prediction time window and the absolute value of the frequency change rate can be determined using an inverse proportional function, i.e., prediction time window length = preset time constant / absolute value of frequency change rate, where the preset time constant is set according to the inertial response time scale of the VSG, for example, it can be set to 0.2 Hz. When the absolute value of the frequency change rate is 0.5 Hz per second, the prediction time window length = 0.2 / 0.5 = 0.4 seconds; when the absolute value of the frequency change rate is 0.1 Hz per second, the prediction time window length = 0.2 / 0.1 = 2 seconds. To prevent the prediction time window from being too long or too short, a lower limit and an upper limit can be set, for example, the lower limit can be set to 0.1 seconds and the upper limit can be set to 3 seconds.

[0038] The length of the final prediction time window can be adaptively adjusted according to the drasticness of frequency changes. The faster the frequency changes, the shorter the prediction window should be to ensure prediction reliability, and the slower the frequency changes, the longer the prediction window should be to cover a more complete energy demand trend.

[0039] Next, the current frequency deviation, frequency change rate, and virtual synchronous generator output power are input into the transient energy demand prediction model. Forward extrapolation is then performed within the prediction time window to obtain the estimated transient energy demand. Forward extrapolation refers to simulating the power response and energy accumulation process of the VSG over a future period, starting from the current moment and proceeding step-by-step according to a set time step, until the end of the prediction time window is reached.

[0040] Specifically, when the estimated transient energy demand exceeds the preset energy budget, the support strength correction factor is reduced in advance during the frequency deterioration phase. The preset energy budget is set comprehensively based on the available capacity of the energy storage equipment, the rated power of the converter, and the expected requirements of the system for the duration of frequency support. For example, it can be set to 30% to 50% of the rated capacity of the energy storage equipment.

[0041] Specifically, if the virtual synchronous generator's energy consumption to suppress frequency degradation is expected to exceed the available budget within the predicted time window, continuing to operate at the current support strength will cause the energy storage device to run out of available energy before the frequency degradation phase ends. This will render the device unable to maintain any active power support during the subsequent frequency recovery phase, potentially leading to frequency runaway or secondary degradation. Therefore, when energy depletion is predicted, even if the frequency degradation phase is still ongoing, the support strength correction factor must be reduced in advance to slow the energy consumption rate and ensure that some support capacity is retained during the frequency recovery phase. Through this prediction and early intervention mechanism, the controller can adopt a conservative strategy in advance when the energy budget is insufficient, avoiding secondary frequency degradation caused by premature energy depletion.

[0042] S30: Calculate the frequency safety margin based on the frequency deviation, calculate the transient energy margin based on the ratio of transient energy demand to preset energy budget, and generate the support strength correction coefficient based on the frequency safety margin and transient energy margin. Furthermore, after calculating the transient energy demand, information from both frequency safety and energy consumption dimensions needs to be integrated to generate support strength correction coefficients for adjusting VSG control parameters. The frequency safety margin reflects the degree to which the current frequency deviates from the safety boundary. A smaller frequency safety margin indicates that the frequency is closer to the upper limit of the allowable deviation, requiring the VSG to maintain a stronger support output to prevent frequency overshoot; a larger frequency safety margin indicates a smaller frequency deviation, allowing the VSG to appropriately reduce its support strength. The transient energy margin reflects the remaining proportion of currently consumed transient energy relative to the preset energy budget. A smaller transient energy margin indicates that the consumed support energy is close to the budget limit, requiring a reduction in support strength to avoid energy depletion; a larger transient energy margin indicates sufficient energy reserves to maintain the current support strength.

[0043] Making decisions based solely on frequency safety margin or transient energy margin has limitations. Specifically, relying solely on frequency safety margin leads to unnecessary energy consumption during the frequency recovery phase by maintaining strong support; relying solely on transient energy margin may result in prematurely weakening support during the frequency deterioration phase by exceeding frequency limits. Therefore, this step jointly assesses frequency safety margin and transient energy margin. When the frequency safety margin is low, priority is given to ensuring frequency safety; when the transient energy margin is low, priority is given to reducing unnecessary energy consumption. This ensures that the generation of the support strength correction coefficient simultaneously satisfies both frequency safety constraints and energy consumption constraints.

[0044] Specifically, in this embodiment, the frequency safety margin is calculated based on the frequency deviation, and the transient energy margin is calculated based on the ratio of transient energy demand to a preset energy budget, including: Obtain the preset upper limit of allowable frequency deviation, calculate the difference between the upper limit of allowable frequency deviation and the absolute value of frequency deviation, divide the difference by the upper limit of allowable frequency deviation, and obtain the frequency safety margin. Calculate the difference between the preset energy budget and the transient energy demand, and divide the difference by the preset energy budget to obtain the transient energy margin.

[0045] The first step is to obtain the preset upper limit of allowable frequency deviation, calculate the difference between the upper limit and the absolute value of the frequency deviation, and divide the difference by the upper limit to obtain the frequency safety margin. The upper limit of allowable frequency deviation is the permissible frequency fluctuation range specified in the power system dispatching regulations. For example, in a power grid, the permissible frequency deviation for a large power grid is ±0.2 Hz. This upper limit represents the boundary constraint for safe frequency operation. When the absolute value of the frequency deviation reaches or exceeds this upper limit, it indicates that the frequency has reached the safety boundary, and mandatory control measures are needed to prevent further frequency deterioration.

[0046] Specifically, the formula for calculating the frequency safety margin is: Frequency Safety Margin = (Upper Limit of Allowable Frequency Deviation - |Frequency Deviation|) / Upper Limit of Allowable Frequency Deviation. When the absolute value of the frequency deviation is closer to the upper limit of the allowable frequency deviation, the frequency safety margin approaches 0, indicating that the frequency is close to the safety boundary and a strong support output is needed to prevent the frequency from exceeding the limit. When the absolute value of the frequency deviation is smaller, the frequency safety margin approaches 1, indicating that the frequency deviation is smaller and the support strength can be appropriately reduced. For example, if the upper limit of the allowable frequency deviation is 0.2 Hz and the current frequency deviation is 0.05 Hz, then the frequency safety margin = (0.2 - 0.05) / 0.2 = 0.75.

[0047] The second step is to calculate the difference between the preset energy budget and the transient energy demand, and then divide the difference by the preset energy budget to obtain the transient energy margin. The preset energy budget is the maximum supporting energy that can be consumed during a disturbance. This preset energy budget can be set according to the available capacity of the energy storage system, the thermal capacity of the converter, or the energy limit given by the dispatch, for example, 100 kilowatt-seconds.

[0048] Specifically, the formula for calculating transient energy margin is: Transient Energy Margin = (Preset Energy Budget - Transient Energy Demand) / Preset Energy Budget. A large transient energy margin indicates that the currently consumed support energy is far below the budget limit, and the energy reserves are sufficient to maintain the current support strength. A small transient energy margin indicates that the consumed support energy is close to the budget limit, and the support strength needs to be reduced to avoid energy depletion. For example, if the preset energy budget is 1000 kWh / s and the current accumulated transient energy demand is 300 kWh / s, then the transient energy margin = (1000 - 300) / 1000 = 0.7.

[0049] Through the above calculations, the frequency safety margin and transient energy margin are unified into dimensionless values ​​between 0 and 1, facilitating the subsequent joint generation of support strength correction coefficients. Specifically, a smaller final frequency safety margin indicates that the frequency is closer to the safety boundary, and a smaller transient energy margin indicates that the energy consumption is closer to the budget limit. These two margins quantify the safety boundary margin of the current control state from the two dimensions of frequency safety and energy consumption, respectively, providing a numerical basis for subsequent joint determination.

[0050] It should be noted that in extreme cases, if the absolute value of the frequency deviation exceeds the upper limit of the allowable frequency deviation, the frequency safety margin may be negative. In this case, the frequency safety margin should be set to zero to ensure that the basic support capacity is maintained under the risk of frequency exceeding the limit. If the transient energy demand exceeds the preset energy budget, the transient energy margin may be negative. In this case, the transient energy margin should be set to zero and an alarm for exceeding the energy budget should be triggered.

[0051] Furthermore, such as Figure 3 As shown, in this embodiment, the support strength correction coefficient is generated jointly based on the frequency safety margin and the transient energy margin, including: Obtain the current disturbance state and determine the particle swarm initialization strategy based on the disturbance state. When the disturbance state is in the frequency deterioration stage, the particle swarm is initialized in the high value region of the support strength correction coefficient. When the disturbance state is in the frequency recovery phase, the particle swarm is initialized in the low value region of the support strength correction coefficient. An optimization function for the support strength correction coefficient is constructed with minimizing transient energy demand as the optimization objective and frequency safety margin as the constraint. The support strength correction coefficient is encoded as the position vector of the particle. The reciprocal of the estimated transient energy demand is used as the fitness value of the particle. A particle swarm containing a preset number of particles is initialized. The position vector of each particle is randomly initialized within the preset range of correction coefficient values. In each iteration, the position of the particles is checked according to the frequency safety margin, and particles that do not meet the frequency safety constraints are removed. Update the individual optimal position of each particle and the global optimal position of the entire particle swarm based on the particle's fitness value. When the number of iterations reaches the preset maximum number of iterations or the fitness value converges, the particle position corresponding to the global optimal position is decoded and used as the support strength correction coefficient.

[0052] In this process, an inertial weight is introduced into the velocity update formula of the particle swarm optimization algorithm. The inertial weight decreases with the increase of the number of iterations according to a linear decay strategy, and the decay rate of the inertial weight is dynamically determined based on the transient energy margin. When the transient energy margin is lower than the preset energy threshold, the decay rate is increased to accelerate convergence; When the transient energy margin is higher than the preset energy threshold, the decay rate is reduced to maintain search diversity.

[0053] First, the current perturbation state is obtained, and the particle swarm initialization strategy is determined based on this state. The perturbation state is identified through the aforementioned sign relationship between frequency deviation and frequency change rate. When the perturbation state is in the frequency deterioration stage, i.e., the absolute value of the frequency deviation is greater than the dead zone threshold and the product of the frequency deviation and the frequency change rate is greater than zero, it indicates that the frequency is further deviating from the rated value. At this time, stronger support is needed to prevent frequency deterioration. Therefore, during particle swarm initialization, the position vectors of each particle are concentrated in the high-value region of the support strength correction coefficient, for example, randomly initialized within the range of 0.7 to 1.0. This allows the optimization algorithm to focus on the high support strength region in the early stages of the search, accelerating the finding of a feasible solution that satisfies the frequency safety constraint.

[0054] When the perturbation state is in the frequency recovery phase, i.e., the absolute value of the frequency deviation is greater than the dead zone threshold and the product of the frequency deviation and the rate of frequency change is less than zero, it indicates that the frequency is returning to its rated value. At this time, the support strength can be appropriately reduced to save energy. Therefore, during particle swarm initialization, the position vectors of each particle are concentrated in the low-value region of the support strength correction coefficient, for example, randomly initialized in the range of 0.2 to 0.6, so that the optimization algorithm focuses on the low support strength region in the early stage of the search, accelerating the finding of the energy-optimal solution.

[0055] Secondly, an optimization function for the support strength correction coefficient is constructed with minimizing transient energy demand as the optimization objective and frequency safety margin as the constraint. Specifically, the optimization objective is to minimize transient energy demand, that is, to find the correction coefficient value that minimizes the cumulative support energy within the disturbance window. The constraint is that the frequency safety margin is greater than or equal to zero, that is, the absolute value of the frequency deviation does not exceed the upper limit of the allowable frequency deviation, ensuring that the frequency does not exceed the limit during the support process. The physical meaning of the optimization function is: to minimize the transient energy consumption of the VSG while ensuring that the frequency does not exceed the limit.

[0056] Next, the support strength correction coefficient is encoded as a particle position vector. Each particle corresponds to a candidate support strength correction coefficient value, which falls within a preset range. This preset range is determined based on the physical upper and lower limits of the VSG control parameters and the system's minimum support strength requirements; for example, it can be set from 0.2 to 1.0. A lower limit of 0.2 indicates that, within the allowable frequency safety margin, the minimum support strength of the VSG should not be less than 20% of the baseline strength, preventing frequency runaway due to excessively low support strength. An upper limit of 1.0 indicates that the support strength should not exceed the baseline strength, avoiding energy waste due to over-support. It is important to note that this preset range of correction coefficient values ​​can be adaptively adjusted according to different grid frequency safety standards and energy storage capacities.

[0057] Initialize a particle swarm containing a preset number of particles. The preset number can be set according to computational resources and optimization accuracy requirements, for example, it can be set to 20 particles. The position vector of each particle is randomly initialized within a preset range of correction coefficient values, so that the particle swarm has initial diversity in the search space.

[0058] Simultaneously, the reciprocal of the estimated transient energy demand is used as the particle's fitness value. The estimated transient energy demand is obtained through the aforementioned transient energy demand prediction model and represents the cumulative supporting energy within the estimated perturbation window under the current correction coefficient. The fitness value is equal to the reciprocal of the estimated transient energy demand, meaning the fitness value is negatively correlated with the transient energy demand; the smaller the estimated transient energy demand, the larger the fitness value. This design allows the particle swarm optimization algorithm to search in the direction of reducing transient energy demand.

[0059] Furthermore, in each iteration, the particle positions are checked based on the frequency safety margin, and particles that do not meet the frequency safety constraints are removed. For each particle, the correction coefficient represented by its position vector is substituted into the VSG control parameters, and the frequency response corresponding to this correction coefficient is calculated using the VSG oscillation equation or transient energy demand prediction model to obtain the predicted value of the frequency deviation, and then the frequency safety margin is calculated. If the frequency safety margin is less than zero, it indicates that the correction coefficient will cause the frequency to exceed the limit and not meet the frequency safety constraints, and the particle is removed from the current iteration. It is important to note that, to ensure that the algorithm can continue to run even when all particles have been removed, if all particles in the current iteration do not meet the frequency safety constraints, the global optimal position of the previous iteration is retained as the result of the current iteration, and the fitness value of that optimal position is assigned to the optimal fitness of the current iteration, ensuring that the algorithm does not crash due to the lack of feasible solutions.

[0060] Next, the individual optimal position of each particle and the global optimal position of the entire particle swarm are updated based on the particle's fitness value. For each particle, its current fitness value is compared with its historical best fitness value; if the current position is better, the particle's individual optimal position is updated. Among all particles, the position of the particle with the highest fitness value is selected as the global optimal position.

[0061] When the number of iterations reaches the preset maximum number of iterations or the fitness value converges, the particle position corresponding to the global optimal position is decoded and used as the support strength correction coefficient. The preset maximum number of iterations can be set according to computational resources and real-time requirements, for example, it can be set to 15 to 30 times. The criterion for fitness value convergence is: in a preset number of consecutive iterations, the rate of change of the global optimal fitness value is less than a preset convergence threshold. For example, if the fitness value changes by less than 2% in three consecutive iterations, then convergence is determined.

[0062] Ultimately, decoding the support strength correction coefficient involves directly outputting the particle's position vector value as the support strength correction coefficient, with a value ranging from 0.2 to 1.0.

[0063] Furthermore, this step introduces an inertia weight into the velocity update formula of the aforementioned optimization algorithm. The velocity update formula is: New velocity = Inertia weight × Original velocity + Individual learning factor × Random number 1 × (Individual optimal position - Current position) + Social learning factor × Random number 2 × (Global optimal position - Current position). Here, Random number 1 and Random number 2 are uniformly distributed random numbers between 0 and 1, used to increase the randomness of particle motion. The inertia weight controls the degree to which the particle maintains its original motion trend. The initial value can be set to 0.9, and the termination value can be set to 0.4. It decreases linearly with the number of iterations, i.e., Inertia weight = Initial inertia weight - (Initial inertia weight - Termination inertia weight) × (Current iteration number / Maximum iteration number).

[0064] For example, with a maximum number of iterations of 20 and the current iteration count of 5, the inertia weight = 0.9 - (0.9 - 0.4) × (5 / 20) = 0.775. When the current iteration count is 15, the inertia weight = 0.9 - (0.9 - 0.4) × (15 / 20) = 0.525.

[0065] When the transient energy margin is lower than the preset energy threshold, it indicates that the supporting energy is approaching the budget limit, and rapid convergence to the energy-optimal solution that satisfies frequency safety constraints is required. At this point, the decay rate is increased to accelerate convergence. The preset energy threshold is a critical value used to determine whether the current transient energy margin is strained and requires accelerated convergence. It can be set comprehensively based on the available capacity of the energy storage device, the thermal tolerance of the converter, and the system's requirement for sustained support against continuous disturbances; for example, it can be set to 0.3. When the transient energy margin is lower than 0.3, it indicates that the consumed supporting energy exceeds 70% of the preset energy budget. At this point, the search convergence speed needs to be accelerated to quickly determine the minimum supporting strength correction coefficient that satisfies frequency safety constraints, avoiding continuous consumption of limited energy during the search due to excessively long iteration processes. When the transient energy margin is higher than or equal to 0.3, it indicates that the remaining energy reserves are still relatively abundant, allowing for a slower decay rate to maintain search diversity and avoid prematurely falling into local optima.

[0066] Specifically, when the transient energy margin is lower than the preset energy threshold, the specific implementation method is to multiply the coefficient of the current iteration number divided by the maximum iteration number in the linear decay by an acceleration factor. For example, the acceleration factor can be set to 1.5, so that the inertial weight drops to the termination value more quickly.

[0067] Furthermore, when the transient energy margin exceeds a preset energy threshold, it indicates ample energy reserves, allowing for more thorough exploration of the search space. In this case, the decay rate is reduced to maintain search diversity and prevent premature entrapment in local optima. Specifically, the coefficient of the current iteration number divided by the maximum iteration number in the linear decay is multiplied by a deceleration factor, such as 0.7, to slow the decrease in inertia weight. This allows particles to maintain greater inertia in the early stages of the search, enabling them to explore a wider region.

[0068] Through the aforementioned dynamic inertia weight adjustment, the optimization algorithm can converge quickly when energy margin is tight and search fully when energy margin is ample, balancing optimization efficiency and global optimization capability.

[0069] S40: Adjust the control parameters of the virtual synchronous generator according to the support strength correction coefficient, and generate the corrected virtual synchronous generator support command.

[0070] Finally, after obtaining the support strength correction coefficient through the particle swarm optimization algorithm, this coefficient needs to be applied to the control parameters of the VSG to achieve a balance between frequency safety and energy consumption. The support strength correction coefficient is a dimensionless scaling factor, ranging from 0.2 to 1.0, reflecting the ratio of the support strength that the VSG should maintain relative to the baseline support strength under the current frequency safety margin and transient energy margin.

[0071] Specifically, in this embodiment, the control parameters of the virtual synchronous generator are adjusted according to the support strength correction coefficient to generate a corrected virtual synchronous generator support command, including: Multiply the support strength correction factor by the droop factor, damping factor and power limit of the virtual synchronous generator respectively to obtain the corrected droop factor, damping factor and power limit; Substituting the modified droop coefficient, damping coefficient, and power limit into the swing equation and power command generation equation of the virtual synchronous generator, the modified virtual synchronous generator support command is obtained.

[0072] The first step is to multiply the support strength correction factor by the droop factor, damping factor, and power limit of the virtual synchronous generator, respectively, to obtain the corrected droop factor, damping factor, and power limit. The droop factor is the proportional gain used in VSG control to convert frequency deviation into active power command. The larger the droop factor, the greater the support power output of the VSG for the same frequency deviation, and the stronger the frequency support capability. The damping factor is the proportional gain used in VSG control to convert the rate of frequency change into active power command. The larger the damping factor, the greater the additional power caused by the rate of frequency change, which is beneficial for suppressing the rate of frequency change. The power limit is the upper limit constraint on the active power output of the VSG, used to protect the converter from exceeding its capacity limit.

[0073] Multiplying all three parameters by the support strength correction factor allows for overall scaling of the VSG support strength. For example, when the support strength correction factor is 0.6, the corrected sag factor, damping factor, and power limit all become 60% of the baseline value, and the overall support strength of the VSG is reduced to 60% of the baseline.

[0074] The second step involves substituting the modified droop coefficient, damping coefficient, and power limit into the swing equation and power command generation equation of the virtual synchronous generator (VSG) to obtain the modified VSG support command. The swing equation describes the dynamic behavior of the VSG's virtual rotor mechanical characteristics, while the power command generation equation describes the relationship between the VSG and the frequency deviation to generate active power commands. The virtual angular frequency reference value, virtual phase angle reference value, and active power reference value output by the modified swing equation and power command generation equation are the modified VSG support command. This VSG support command maintains high support strength during frequency deterioration to prevent frequency exceedance, actively reduces unnecessary support to save energy during frequency recovery, and temporarily restores support during secondary deviation to prioritize frequency safety, thus minimizing transient energy demand under frequency safety constraints.

[0075] Finally, the support command is sent to the modulation module of the VSG, which drives the grid-connected converter to output active power according to the corrected command, thus completing the closed-loop control.

[0076] In addition, the execution steps of this embodiment also include: The state of charge (SOC) of the energy storage device is obtained. Based on the SOC, a correction factor for the energy budget is determined. The correction factor is positively correlated with the SOC. The preset energy budget is corrected based on the correction factor to obtain the dynamic energy budget. The transient energy margin is calculated based on the dynamic energy budget. After the disturbance ends, the preset energy budget is gradually restored according to the preset recovery rate. If a new disturbance is detected during the preset energy budget restoration process, the transient energy margin is calculated based on the current remaining budget, and the generation of the support strength correction coefficient continues.

[0077] First, the state of charge (SOC) of the energy storage device is obtained. SOC refers to the percentage of the energy storage device's current remaining capacity relative to its rated capacity, ranging from 0 to 100%, reflecting the device's current energy level. In an energy storage-based virtual synchronous generator (VSG) system, the VSG output power is provided by the energy storage device, and the remaining energy stored directly affects the sustainability of subsequent support capabilities. When the SOC is high, the energy storage capacity is sufficient to support a strong frequency response; when the SOC is low, the energy storage capacity is insufficient. If the supporting energy is still consumed according to the preset energy budget, it may accelerate the depletion of the energy storage capacity, leading to a loss of support capability for subsequent disturbances.

[0078] Secondly, a correction factor for the energy budget is determined based on the state of charge (SBC), which is positively correlated with the SBC. This correction factor is used to dynamically adjust the preset energy budget based on the current remaining charge of the energy storage. When the SBC is high, the correction factor is large, and the dynamic energy budget is close to or equal to the preset energy budget, allowing the VSG to consume more support energy during disturbances. When the SBC is low, the correction factor is small, and the dynamic energy budget is lower than the preset energy budget, tightening the energy constraint in advance and reducing the support strength to avoid over-discharge of the energy storage. Optionally, the correction factor can be determined as: Correction Factor = SBC / Preset Baseline SBC, with the calculation result limited to between 0.3 and 1.0. For example, if the preset baseline SBC is 50% and the current SBC is 40%, the correction factor is 0.8; if the current SBC is 25%, the correction factor is 0.5.

[0079] Next, the preset energy budget is corrected according to the correction factor to obtain the dynamic energy budget. Dynamic energy budget = preset energy budget × correction factor. When the energy storage state of charge decreases, the dynamic energy budget decreases accordingly, making the transient energy margin calculation more conservative; when the energy storage state of charge increases, the dynamic energy budget returns to the preset level.

[0080] Transient energy margin is calculated based on the dynamic energy budget. The formula for calculating transient energy margin is replaced with: Transient energy margin = (Dynamic energy budget - Transient energy demand) / Dynamic energy budget. Through the above dynamic correction, the transient energy margin automatically tightens when the energy storage capacity is insufficient, making the energy constraint of the VSG controller more stringent when the energy storage capacity is low, reducing the support strength in advance, and preventing further deterioration of the energy storage capacity.

[0081] After the disturbance ends, the preset energy budget is gradually restored according to the preset recovery rate. The criteria for determining the end of the disturbance are: the absolute value of the frequency deviation has been less than or equal to the dead zone threshold for a continuous preset duration, and the support state has been exited. The continuous preset duration is set based on the system's sensitivity and reliability requirements for determining the end of the disturbance; for example, it can be set to 5 seconds. After the disturbance ends, the energy storage device can be replenished through grid charging or renewable energy generation, and the preset energy budget should be gradually restored accordingly to cope with the next possible disturbance. The preset recovery rate can be set according to the charging rate of the energy storage device and the system's support requirements for continuous disturbances; for example, it can be set to restore 1% of the preset energy budget per second.

[0082] During the recovery process of the preset energy budget, if a new disturbance is detected, the transient energy margin is calculated based on the current remaining budget, and the generation of the support strength correction coefficient continues. The current remaining budget refers to the available energy amount that has not yet been restored to the preset energy budget during the recovery process after the disturbance ends. When a new disturbance occurs, the current remaining budget is used as the energy constraint, and the optimization of the support strength correction coefficient and the generation of VSG support commands continue to be executed to ensure a smooth transition of the energy budget under continuous disturbance scenarios and avoid losing energy constraints due to the budget not being fully restored.

[0083] In summary, through the aforementioned dynamic correction and recovery mechanisms, the energy constraints of the VSG controller can be adaptively adjusted according to the energy storage state of charge and the disturbance interval. When the energy storage capacity is sufficient, it can fully exert its support capacity, and when the energy storage capacity is insufficient or there is continuous disturbance, it can actively throttle the power, thereby improving the sustainable support capacity of the energy storage VSG under continuous disturbance scenarios.

[0084] In summary, the embodiments of this application have at least the following technical effects: Compared to existing technologies, this invention firstly collects the grid connection point frequency and VSG output power in real time, calculating the frequency deviation and frequency change rate. This provides an accurate data foundation for subsequent disturbance state identification and transient energy demand calculation, solving the problem of traditional methods lacking refined perception of the disturbance process. Secondly, it accumulates the VSG support power deviation online within the disturbance window, transforming the transient energy demand from an offline evaluation indicator into a real-time control constraint, enabling the controller to dynamically perceive the relative relationship between the currently consumed support energy and the available budget. Thirdly, it calculates the frequency safety margin through the frequency deviation and the transient energy margin through the ratio of transient energy demand to the preset energy budget. Based on the principle of prioritizing frequency safety margin and adjusting transient energy margin, a support strength correction coefficient is jointly generated. When the frequency safety margin is sufficient, unnecessary support output is reduced; when the frequency safety margin is insufficient, frequency support is prioritized.

[0085] Finally, the sag coefficient, damping coefficient, and power limiting are uniformly adjusted using a support strength correction coefficient to generate a corrected support command. Under continuous disturbance scenarios, the support strategy is dynamically adjusted based on the remaining energy budget. This invention achieves coordinated control of frequency security and energy consumption, improving the sustainable support capability of energy storage VSGs under continuous disturbance scenarios.

Claims

1. A transient energy demand minimization control method for a virtual synchronous generator, characterized in that, include: Collect the grid connection point frequency and the output power of the virtual synchronous generator, and calculate the frequency deviation and frequency change rate; The disturbance state is identified based on the frequency deviation and frequency change rate, and the supporting power of the virtual synchronous generator is accumulated within the disturbance window to obtain the transient energy demand. The frequency safety margin is calculated based on the frequency deviation, the transient energy margin is calculated based on the ratio of the transient energy demand to the preset energy budget, and the support strength correction coefficient is generated by combining the frequency safety margin and the transient energy margin. The control parameters of the virtual synchronous generator are adjusted according to the support strength correction coefficient to generate the corrected virtual synchronous generator support command.

2. The transient energy demand minimization control method for a virtual synchronous generator according to claim 1, characterized in that, Collect the grid connection point frequency and the output power of the virtual synchronous generator, and calculate the frequency deviation and frequency change rate, including: Obtain the grid connection point rated frequency, and use the difference between the grid connection point frequency and the rated frequency as the frequency deviation; The frequency deviation at multiple consecutive sampling times is obtained, the frequency deviation is differentially calculated, and the ratio of the differential result to the sampling period is used as the frequency change rate.

3. The transient energy demand minimization control method for a virtual synchronous generator according to claim 1, characterized in that, Identifying the disturbance state based on the frequency deviation and frequency change rate includes: When the absolute value of the frequency deviation is greater than the preset dead zone threshold and the product of the frequency deviation and the frequency change rate is less than zero, it is determined to be in the frequency recovery stage. When the absolute value of the frequency deviation is greater than a preset dead zone threshold and the product of the frequency deviation and the frequency change rate is greater than zero, it is determined to be in the frequency deterioration stage. When the absolute value of the frequency deviation is less than or equal to the preset dead zone threshold, it is determined to be in a steady state. When the absolute value of the frequency deviation increases again after the recovery phase and exceeds the preset second deviation threshold, it is determined to be a second deviation phase.

4. The transient energy demand minimization control method for a virtual synchronous generator according to claim 1, characterized in that, The transient energy demand is obtained by accumulating the virtual synchronous generator's supporting power within the disturbance window, including: The output power of the virtual synchronous generator at the steady state before the disturbance is obtained as the reference power. The moment when the absolute value of the frequency deviation first exceeds the preset dead zone threshold is taken as the disturbance start time. Starting from the disturbance start time and ending at the current time, the absolute value of the difference between the output power of the virtual synchronous generator and the reference power is accumulated to obtain the transient energy demand.

5. The transient energy demand minimization control method for a virtual synchronous generator according to claim 4, characterized in that, The transient energy demand is obtained by accumulating the virtual synchronous generator's supporting power within the disturbance window, followed by: A transient energy demand prediction model is established, which takes the frequency deviation, frequency change rate and output power of the virtual synchronous generator at the current moment as inputs and the estimated transient energy demand within the prediction time window as output. The length of the prediction time window is determined based on the frequency change rate, and the length of the prediction time window is negatively correlated with the absolute value of the frequency change rate. The current frequency deviation, frequency change rate, and virtual synchronous generator output power are input into the transient energy demand prediction model. Forward extrapolation is performed within the prediction time window to obtain the transient energy demand estimate. When the estimated transient energy demand exceeds the preset energy budget, the support strength correction coefficient is reduced in advance during the frequency deterioration phase.

6. The transient energy demand minimization control method for a virtual synchronous generator according to claim 1, characterized in that, Calculate the frequency safety margin based on the frequency deviation, and calculate the transient energy margin based on the ratio of the transient energy demand to the preset energy budget, including: Obtain a preset upper limit for allowable frequency deviation, calculate the difference between the upper limit for allowable frequency deviation and the absolute value of the frequency deviation, divide the difference by the upper limit for allowable frequency deviation, and obtain the frequency safety margin. Calculate the difference between the preset energy budget and the transient energy demand, and divide the difference by the preset energy budget to obtain the transient energy margin.

7. The transient energy demand minimization control method for a virtual synchronous generator according to claim 1, characterized in that, The support strength correction coefficient is generated jointly based on the frequency safety margin and the transient energy margin, including: Obtain the current disturbance state, determine the particle swarm initialization strategy based on the disturbance state, and when the disturbance state is in the frequency deterioration stage, the particle swarm is initialized in the high value region of the support strength correction coefficient. When the disturbance state is in the frequency recovery phase, the particle swarm is initialized in the low value region of the support strength correction coefficient; An optimization function for the support strength correction coefficient is constructed with minimizing transient energy demand as the optimization objective and frequency safety margin as the constraint. The support strength correction coefficient is encoded as the position vector of the particle. The reciprocal of the estimated transient energy demand is used as the fitness value of the particle. A particle swarm containing a preset number of particles is initialized. The position vector of each particle is randomly initialized within the preset range of correction coefficient values. In each iteration, the position of the particles is checked according to the frequency safety margin, and particles that do not meet the frequency safety constraints are removed. Update the individual optimal position of each particle and the global optimal position of the entire particle swarm based on the particle's fitness value. When the number of iterations reaches the preset maximum number of iterations or the fitness value converges, the particle position corresponding to the global optimal position is decoded and used as the support strength correction coefficient.

8. The transient energy demand minimization control method for a virtual synchronous generator according to claim 7, characterized in that, Also includes: An inertial weight is introduced into the velocity update formula of the particle swarm optimization algorithm. The inertial weight decreases according to a linear decay strategy as the number of iterations increases, and the decay rate of the inertial weight is dynamically determined based on the transient energy margin. When the transient energy margin is lower than a preset energy threshold, the decay rate is increased to accelerate convergence; When the transient energy margin is higher than the preset energy threshold, the decay rate is reduced to maintain search diversity.

9. The transient energy demand minimization control method for a virtual synchronous generator according to claim 1, characterized in that, The control parameters of the virtual synchronous generator are adjusted according to the support strength correction coefficient to generate a corrected virtual synchronous generator support command, including: The support strength correction coefficient is multiplied by the droop coefficient, damping coefficient, and power limit of the virtual synchronous generator to obtain the corrected droop coefficient, damping coefficient, and power limit. Substituting the modified droop coefficient, damping coefficient, and power limit into the swing equation and power command generation equation of the virtual synchronous generator, the modified virtual synchronous generator support command is obtained.

10. The transient energy demand minimization control method for a virtual synchronous generator according to claim 1, characterized in that, Also includes: The state of charge (SOC) of the energy storage device is obtained, and a correction factor for the energy budget is determined based on the SOC. The correction factor is positively correlated with the SOC. The preset energy budget is corrected based on the correction factor to obtain a dynamic energy budget. The transient energy margin is calculated based on the dynamic energy budget. After the disturbance ends, the preset energy budget is gradually restored according to the preset recovery rate. If a new disturbance is detected during the restoration of the preset energy budget, the transient energy margin is calculated based on the current remaining budget, and the generation of the support strength correction coefficient continues.