Power distribution network stability optimization method based on distributed photovoltaic inverter cooperative control
By using distributed photovoltaic inverters for collaborative control, real-time grid data is collected, an optimization model is established, and adaptive collaborative control of voltage and frequency is achieved. This solves the grid stability problem caused by high-proportion photovoltaic grid integration and improves the grid's response speed and control accuracy.
Patent Information
- Application Number
- CN202511403166.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2045-09-29
AI Technical Summary
High proportions of distributed photovoltaic power grids are connected to distribution networks, which leads to problems with grid voltage and frequency stability. Existing technologies have high investment costs, slow response speed, and poor flexibility, making it difficult to effectively solve the bidirectional random fluctuations in power flow.
By using distributed photovoltaic inverters for collaborative control, real-time grid data is collected, an optimization model is established, and adaptive collaborative control of voltage and frequency is achieved. The existing inverter capacity is used for reactive and active power regulation, forming a closed-loop feedback control system.
It achieves fast, economical, and flexible grid stability control, reduces costs, enhances the absorption capacity of high-proportion photovoltaic power, and improves the grid's response speed and control accuracy.
Smart Images

Figure CN120892659B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power system control technology, and in particular relates to a method for improving the stability of distribution networks, especially the voltage and frequency stability of the grid under high-proportion renewable energy access, by utilizing the collaborative control of distributed photovoltaic inverters. Background Technology
[0002] With the utilization and development of new energy sources, the penetration rate of distributed energy, represented by photovoltaics, in power distribution networks has increased dramatically. Traditional power distribution networks flow unidirectionally from substations to users. However, the integration of a high proportion of distributed photovoltaics makes the power flow bidirectional and subject to random fluctuations, posing serious challenges to the stable operation of the system. These challenges mainly manifest as voltage limit exceedance issues, frequency stability problems, and insufficient control capabilities. Voltage limit exceedance issues are reflected in the intermittent and uncertain nature of photovoltaic output. For example, a large amount of photovoltaic power injected into the distribution network may lead to severe voltage exceedances on lines, damaging user equipment. Traditional power grids rely on the large inertia of synchronous generators to maintain frequency stability. Photovoltaics, connected to the grid through inverters, do not possess inertial response capabilities. When there is a large power deficit or surplus in the system, the lack of frequency support from photovoltaic participation leads to an increased system frequency change rate, excessive frequency deviation, and even cascading grid disconnection. Most existing distributed photovoltaic inverters only operate in maximum power point tracking mode, aiming to maximize power generation revenue, and lack the ability to actively adjust active and reactive power according to grid conditions, resulting in insufficient control capabilities. Currently, the main technical solutions to these problems include upgrading the power grid architecture and installing traditional reactive power compensation devices or energy storage systems. However, these methods either involve huge investment costs, slow response times, or are limited by geographical location, resulting in poor economic efficiency and flexibility. Therefore, there is an urgent need for an economical, efficient, and rapid technical solution that fully utilizes existing resources to address the stability issues arising from high-proportion photovoltaic (PV) grid integration. Summary of the Invention
[0003] The technical problem to be solved by this invention is to provide a distribution network stability optimization method based on the collaborative control of distributed photovoltaic inverters to solve the problems of existing methods for dealing with bidirectional random fluctuations in power flow, such as high investment cost, slow response speed, and poor economy and flexibility due to geographical limitations.
[0004] The distribution network stability optimization method based on distributed photovoltaic inverter collaborative control includes the following steps, which are performed sequentially:
[0005] Step 1: System hardware deployment, initialization, and configuration;
[0006] Step 2: Real-time data acquisition and monitoring;
[0007] Step 3: Establish and solve the optimization model to achieve voltage stability control;
[0008] The objective function F of the optimization model is to minimize the sum of the deviations between the total grid voltage and the rated voltage. The solution of the optimization model is the reactive power reference value Q_ref_i for each i-th photovoltaic inverter that needs to participate in regulation.
[0009] Triggering condition: If the central controller detects that the voltage of one or more nodes exceeds the set threshold range, it will solve the optimization model.
[0010] Command issuance and execution:
[0011] Based on the Q_ref_i value, the photovoltaic inverter i changes its output reactive power to a new set value, thereby affecting the grid connection point voltage;
[0012] Step 4: Power Grid Frequency Stability Control
[0013] Triggering conditions: The cluster controller continuously monitors the grid frequency f obtained from the line terminal unit (DTU) or the smart distribution transformer terminal (TTU) itself; sets the dead zone range of the grid frequency f, and triggers the system when the grid frequency f is lower or higher than the dead zone range.
[0014] Determine and calculate whether the power grid frequency f is in the dead zone;
[0015] Step 5: System runs in a loop
[0016] Repeat steps two through four above to form a closed-loop feedback control system, which continuously circulates in the centralized controller and cluster controller to achieve real-time, adaptive, and coordinated control of the distribution network voltage and frequency.
[0017] The system hardware deployment, initialization, and configuration in step one are specifically as follows:
[0018] A centralized optimization controller is set up in the computer room of the distribution network control center, and a network connection is established with all cluster controllers through the power dispatch data network. The cluster controller is embedded with line terminal units (DTUs) and intelligent distribution transformer terminals (TTUs). Each cluster controller is connected to all photovoltaic inverters in its jurisdiction. The distribution network is also equipped with a distribution automation system (SCADA).
[0019] The real-time data acquisition and monitoring in step two specifically includes:
[0020] The data acquisition module of the SCADA distribution automation system periodically reads data from selected key nodes, including voltage V, frequency f, active power P, and reactive power Q, from substations, feeder terminal units (FTUs) along feeders, and intelligent distribution transformer terminals (TTUs), and writes them into the real-time database.
[0021] The centralized optimization controller obtains data from key nodes in the real-time database through queries or message subscriptions. The cluster controller periodically polls the real-time operating data of all photovoltaic inverters within its jurisdiction, including: the output active power P_inv, output reactive power Q_inv, current operating status, and the maximum reactive power Q_max that the photovoltaic inverter can provide in the current operating state.
[0022] The maximum reactive power Q_max that can be provided is related to the current active power:
[0023] ;
[0024] Wherein, Q_max represents the maximum reactive power that the photovoltaic inverter can provide under the current operating state. This is a real-time changing value, ranging from [0, S_rated], and the unit is kVar or Var; S_rated is the rated apparent power of the photovoltaic inverter, which is the maximum capacity marked on the inverter's nameplate. It is a fixed value, and the unit is kVA; P_inv is the output active power of the photovoltaic inverter under the current operating state. This is a real-time measured value, ranging from [0, S_rated], and the unit is kW or W.
[0025] The objective function F of the optimization model in step three is formulated as follows:
[0026] ;
[0027] Where V_i is the actual voltage measurement value of the i-th critical measurement node, which is a per-unit value; V_ref is the voltage reference value set by the system, i.e. the target voltage to be achieved, which is a per-unit value; n is the total number of critical nodes;
[0028] Solve the optimization model:
[0029] The centralized controller transforms the objective function F into a nonlinear programming or quadratic programming problem and calls the optimization solver to solve it. The solution result is the reactive power output reference value Q_ref_i for each i-th photovoltaic inverter that needs to participate in regulation.
[0030] The optimization model in step three has the following constraints:
[0031] Including inverter reactive power output constraints, as detailed below:
[0032] The reactive power output of each inverter i cannot exceed its current capacity, as shown below:
[0033] -Q_max_i ≤ Q_i ≤+Q_max_i;
[0034] In the formula, Q_i is the reference value of the reactive power that the i-th photovoltaic inverter needs to generate; Q_max_i is the maximum reactive power that the i-th photovoltaic inverter can generate at present.
[0035] The issuance and execution of instructions in step three are as follows:
[0036] The centralized controller sends the calculated Q_ref_i instruction to the corresponding cluster controller according to the region. The cluster controller writes the Q_ref_i value into the reactive power setpoint register of the corresponding inverter i. After receiving the new setpoint, the photovoltaic inverter i adjusts the switching timing of the insulated gate bipolar transistor IGBT in its internal control loop to change the output reactive power to the new setpoint.
[0037] Step four involves determining and calculating whether the power grid frequency f is in the dead zone, specifically including:
[0038] If the grid frequency f is within the dead zone, no action is taken. If the grid frequency f is lower than the lower limit of the dead zone, it indicates insufficient power generation, and load reduction is implemented. If the grid frequency f is higher than the upper limit of the dead zone, it indicates excessive power generation, and active power is reduced. The cluster controller calculates and obtains the total active power ΔP_total that needs to be reduced by all photovoltaic inverters in the jurisdiction based on the preset droop coefficient k and the formula for the total active power to be reduced.
[0039] The cluster controller allocates the total active power reduction ΔP_total required by all photovoltaic inverters in the jurisdiction to all photovoltaic inverters in the jurisdiction according to the proportion or the adjustable capacity ratio, and obtains the amount of active power reduction that each photovoltaic inverter needs to bear.
[0040] The photovoltaic inverters obtain new active power setpoints based on their current actual active power output and the amount of active power reduction they need to bear.
[0041] The cluster controller writes the new active power setpoint of each photovoltaic inverter into the active power setpoint register connected to each photovoltaic inverter in real time. After receiving the setpoint instruction, the inverter reduces its active power output to the new active power setpoint, discarding more photovoltaic energy, thereby helping the grid frequency to recover and achieving grid frequency stability control.
[0042] The formula for the total active power reduction ΔP_total required by all photovoltaic inverters within the jurisdiction is:
[0043] ΔP_total = k * (f_measured - f_setpoint);
[0044] In the formula, k is the droop coefficient, k > 0; f_measured is the system frequency value measured in real time by the cluster controller; f_setpoint is the rated frequency of the system, which is taken as 50.0 Hz here;
[0045] The formula for allocating the adjustable capacity ratio is as follows:
[0046] ;
[0047] ΔP_i is the amount of active power reduction that the i-th photovoltaic inverter needs to bear; P_inv_i is the current actual active power generated by the i-th photovoltaic inverter; m is the total number of photovoltaic inverters in the jurisdiction;
[0048] The calculation formulas for the new active power setpoints of each photovoltaic inverter are as follows:
[0049] P_new_i = P_inv_i - ΔP_i;
[0050] In the formula, P_new_i is the new active power setting value of the i-th photovoltaic inverter, and its value range is [0, P_inv_i].
[0051] The distribution network stability optimization method based on distributed photovoltaic inverter collaborative control also uses the APScheduler task scheduler in Python programming language to automatically start the optimization calculation process (step three) at fixed intervals. The specific steps of the optimization calculation process are as follows:
[0052] Event triggering: Set up a voltage over-limit listener to monitor in real time during the state cyclic update process from step two to step four. If the voltage of a node exceeds the set severe over-limit threshold, the voltage over-limit listener will immediately send an interrupt signal, the cyclic update process will be paused, and the optimization calculation process will be triggered in advance, that is, jump to step three without waiting for the next 5-minute cycle, thus achieving a fast response.
[0053] Execution: After the optimization calculation in step three is completed, the result instruction Q_ref_i is placed into an instruction message queue. Another dedicated communication delivery process retrieves the instruction from the queue and sends it to the corresponding cluster controller, and then continues to step four.
[0054] Through the above design scheme, the present invention can bring the following beneficial effects:
[0055] This invention utilizes a distribution automation system to collect real-time data on voltage, frequency, active power, and reactive power at key nodes across the entire power grid. Control zones are divided according to distribution lines or transformer areas, with a cluster controller deployed in each zone. This controller can be embedded in existing smart distribution transformer terminals (TTUs) or line terminals (DTUs), adding or activating advanced control functions for each photovoltaic inverter. The photovoltaic inverters are configured as execution units to receive and execute specific control commands from the cluster controller. The centralized controller uses minimizing the overall grid voltage deviation as its objective function to establish an optimal power flow model, determining the total reactive power compensation required to restore the system voltage to a acceptable range and the optimal reactive power output reference value for each inverter. The controller continuously monitors the system frequency; when the frequency exceeds the normal dead zone, it automatically reduces the active power output of all photovoltaic inverters within its jurisdiction proportionally according to a preset droop curve, simulating the primary frequency regulation function of a traditional generator to improve the stability of the distribution network.
[0056] This invention makes full use of the existing inverter capacity of distributed photovoltaic power generation, requiring little or no additional investment, thus achieving the "maximization of resources" and reducing costs.
[0057] In this invention, the response time of the photovoltaic inverter is in the millisecond range, which is much faster than that of traditional mechanical switching equipment (second range) and synchronous condensers (minute range). The fast response speed can effectively suppress rapid disturbances to the power grid.
[0058] This invention combines centralized optimization with distributed autonomy, achieving high control precision while ensuring both global optimization and the reliability and speed of local control.
[0059] The system hardware architecture of this invention adopts a layered distributed approach, offering strong scalability and allowing for flexible integration with numerous new photovoltaic power plants, facilitating large-scale application. Furthermore, by actively controlling voltage and frequency, it can effectively alleviate photovoltaic grid disconnection issues caused by excessively high voltage or abnormal frequency, thereby improving the distribution network's capacity to absorb high proportions of photovoltaic power. Attached Figure Description
[0060] The present invention will be further described below with reference to the accompanying drawings and specific embodiments:
[0061] Figure 1 This is a schematic diagram of the system hardware deployment architecture in the distribution network stability optimization method based on distributed photovoltaic inverter collaborative control of the present invention. Detailed Implementation
[0062] This invention relates to a distribution network stability optimization method based on the collaborative control of distributed photovoltaic inverters, comprising the following steps:
[0063] Step 1: System Initialization and Configuration
[0064] Hardware deployment and networking:
[0065] like Figure 1 As shown, a centralized optimization controller server is deployed in the distribution network control center's computer room, and a secure and reliable network connection is established with all cluster controllers (DTUs / TTUs) through the power dispatch data network. It is confirmed that the hardware version of the TTUs in each distribution area or the DTUs on the lines supports software upgrades and has sufficient processing power and memory to run new cluster control programs. It is confirmed that all photovoltaic inverter models within the jurisdiction support remote communication (e.g., via 4G / 5G DTUs or Ethernet) and advanced control functions (e.g., reactive power regulation Q control, active power derating P curtailment). Optimization commands are issued from the centralized controller, distributed by the cluster controller, and finally executed by each inverter controller. Local status data is aggregated from the inverters to the cluster controller and then uploaded to the centralized controller for global optimization calculations.
[0066] Software function activation and configuration:
[0067] Central controller: This module includes an optimized computing engine, communication drivers (for interfacing with the power distribution automation system), and a database. It is configured to interface with the SCADA system and subscribe to measurement data from key nodes across the network.
[0068] Cluster Controller: Burns or activates cluster control firmware into existing DTU / TTU devices. Configures a list of communication addresses (such as IP addresses, Modbus slave addresses) for all photovoltaic inverters under its jurisdiction.
[0069] Photovoltaic inverters: Activate their remote control command receiving function (e.g., set the Modbus register to writable) through the commissioning software or web interface provided by the inverter manufacturer, and configure their communication parameters to ensure communication with the upstream TTU / DTU.
[0070] Step Two: Real-time Data Acquisition and Monitoring
[0071] Implementation method:
[0072] The data acquisition module of the distribution automation system (SCADA) periodically (e.g., every 2-5 seconds) reads data from key nodes such as FTUs and TTUs along the substation and feeder line using power protocols such as IEC 104, and writes it into the real-time database.
[0073] The centralized optimization controller acquires this panoramic data in real time via database APIs (such as SQL queries) or message subscriptions (such as MQTT topic subscriptions). The cluster controller periodically (e.g., every 1-2 seconds) polls the real-time operating data of all photovoltaic inverters within its jurisdiction via protocols such as Modbus TCP or RTU over 4G. This data includes: output active power P_inv, output reactive power Q_inv, current operating status, and maximum renewable energy capacity Q_max, which is related to the current active power output.
[0074] ;
[0075] Q_max: The maximum reactive power (capacitive or inductive) that the photovoltaic inverter can provide under the current operating conditions. This is a real-time changing value, ranging from [0, S_rated], and the unit is kVar or Var.
[0076] Importance: This is the most important constraint when performing reactive power optimization in step three. The central controller must know the maximum reactive power each inverter can currently generate; otherwise, optimization commands may fail to execute or even cause equipment overload.
[0077] S_rated: Rated apparent power of the photovoltaic inverter. This is the maximum capacity marked on the inverter's nameplate. It is a fixed value, and its range is determined by the equipment itself (e.g., 50kW, 100kW), and the unit is kVA.
[0078] P_inv: The actual active power currently generated by the photovoltaic inverter. This is a real-time measured value, ranging from [0, S_rated], and the unit is kW or W.
[0079] # Implementation Code
[0080] while True:
[0081] # Query the latest data from the SCADA database
[0082] grid_data = query_database("SELECT node_id, V, f, P, Q, timestampFROM real_time_data WHERE timestamp > last_query_time")
[0083] # Process and update internal state
[0084] for data in grid_data:
[0085] update_grid_status(data.node_id, data.V, data.f, data.P,data.Q)
[0086] sleep(collection_interval) # Wait for the next collection cycle
[0087] # Cluster controller side - Inverter data acquisition (using pymodbus library)
[0088] from pymodbus.client import ModbusTcpClient
[0089] inverter_ips = ['192.168.1.101', '192.168.1.102', ...] # List of inverters under management
[0090] for IP address in inverter_ips:
[0091] client = ModbusTcpClient(ip)
[0092] if client.connect():
[0093] # Read holding registers (SunSpec standard)
[0094] P_inv = client.read_holding_registers(40000, 1).registers[0] # 40000 is the address of the active power register
[0095] Q_inv = client.read_holding_registers(40002, 1).registers[0]
[0096] # ... Read other data
[0097] client.close()
[0098] update_inverter_status(ip, P_inv, Q_inv) .
[0099] Step 3: Voltage stability control
[0100] Triggering condition: When the central controller detects that the voltage of one or more nodes exceeds the set threshold range, it will solve the optimization model. For example, if the threshold range is set to 0.95 pu ≤ V ≤ 1.05 pu, then the optimization model will be solved when V > 1.05 pu or V < 0.95 pu.
[0101] Optimization model establishment and solution:
[0102] Objective function F: Minimize the sum of deviations between the total network voltage and the rated voltage, that is, minimize the sum of the squares of the voltage deviations of all n monitored key nodes in the system.
[0103] The formula is as follows:
[0104] ;
[0105] V_i is the actual voltage measurement value of the i-th critical measurement node, which is usually a per-unit value. The normal range in the actual power grid is usually between 0.95 and 1.05 pu. Exceeding the limit (such as <0.95 or >1.05) is the condition for triggering this optimization calculation; V_ref: the voltage reference value set by the system, that is, the target voltage to be achieved, which is usually a per-unit value. The value range is usually 1.0 pu.
[0106] The smaller the value of the objective function F, the closer the voltage of the entire system is to the rated value, and the better the optimization effect.
[0107] Constraints:
[0108] The main constraint is the reactive power output of the inverter:
[0109] The reactive power output of each inverter i cannot exceed its current capacity, as shown below:
[0110] -Q_max_i ≤Q_i ≤ +Q_max_i;
[0111] Q_i: The reference value of reactive power to be generated by the i-th photovoltaic inverter. Its value range is limited by Q_max_i, i.e. [-Q_max_i, +Q_max_i], and the unit is usually kVar or Var.
[0112] Q_max_i: The maximum reactive power that the i-th photovoltaic inverter can currently generate. This value is not fixed and depends on the current active power output of the inverter. The value range is [0, S_rated], and the unit is the same as Q_i.
[0113] The formula for calculating Q_max_i is as follows:
[0114] ;
[0115] S_rated: Rated apparent power of the photovoltaic inverter. This is the maximum capacity marked on the inverter's nameplate. Its value is a fixed value determined by the equipment itself, and the unit is kVA.
[0116] P_inv_i: The actual active power currently generated by the i-th photovoltaic inverter, with a value range of [0, S_rated], and the unit is kW or W. The larger this value is, the smaller the remaining reactive power capacity Q_max_i will be.
[0117] Other constraints, such as power flow equation constraints and node voltage upper and lower limit constraints, can be added as needed.
[0118] Solution: The centralized controller constructs the above problem as a nonlinear programming or quadratic programming problem and calls the optimization solver to solve it. The solution result is the reactive power reference value Q_ref_i for each inverter i that needs to participate in regulation.
[0119] Command issuance and execution:
[0120] The centralized controller distributes the calculated Q_ref_i command to the corresponding cluster controller according to its region. The cluster controller writes the Q_ref_i value into the reactive power setpoint register of the corresponding inverter via the Modbus TCP protocol. After receiving the new setpoint, the inverter's internal control loop immediately adjusts the switching timing of the IGBTs, changing the output reactive power and thus affecting the grid connection point voltage.
[0121] #Implementation code:
[0122] import cvxpy as cp
[0123] import numpy as np
[0124] The system has n nodes and m inverters.
[0125] n = 10 # Number of nodes
[0126] m = 5 # Number of inverters
[0127] # Define optimization variables: reactive power output of each inverter
[0128] Q_inv = cp.Variable(m)
[0129] # Known quantities (obtained from system state)
[0130] V_meas = np.array([...]) # Measured voltages of n nodes
[0131] V_ref = 1.0 # Rated voltage
[0132] sensitivity_matrix = np.load('sensitivity_matrix.npy') # Pre-calculated sensitivity matrix dV / dQ (n x m)
[0133] Q_max_available = np.array([...]) # Maximum reactive power that each inverter can currently generate
[0134] # Build optimization problem
[0135] # Objective function: Minimize voltage deviation
[0136] objective = cp.Minimize(cp.sum_squares(V_meas + sensitivity_matrix @Q_inv - V_ref))
[0137] # Constraint: The inverter's reactive power output shall not exceed its capacity.
[0138] constraints = [Q_inv <= Q_max_available, Q_inv >= -Q_max_available]
[0139] # You can also add other constraints, such as line power constraints, etc.
[0140] prob = cp.Problem(objective, constraints)
[0141] # Solve the problem
[0142] result = prob.solve(solver=cp.ECOS)
[0143] if prob.status == cp.OPTIMAL:
[0144] Q_ref_values = Q_inv.value # This is the optimal reactive power reference value obtained from the solution.
[0145] # Next, these values will be sent to the corresponding cluster controller.
[0146] else:
[0147] print("Optimization failed, alternative strategy adopted").
[0148] Step 4: Frequency stability control, i.e., active power droop control
[0149] Triggering condition: The cluster controller continuously monitors the power grid frequency f obtained from the TTU / DTU itself locally.
[0150] Judgment and Calculation:
[0151] A frequency dead zone f is set, such as 49.8 Hz < f < 50.2 Hz, within which no action is taken. When the frequency f is below the lower limit, such as f < 49.8 Hz, it indicates insufficient power generation, requiring load reduction. However, since photovoltaics are power generation units, they typically do not increase power generation under this condition (they may already be operating at full capacity), so this scenario mainly addresses excessively high frequencies. When the frequency is above the upper limit, such as f > 50.2 Hz, it indicates excessive power generation, requiring reduction of active power. The cluster controller calculates the total active power ΔP_total that needs to be reduced from all photovoltaic inverters in the area based on the preset droop coefficient k.
[0152] ΔP_total = k * (f_measured - f_setpoint)
[0153] The value range of ΔP_total is [0, ΣP_inv] (when the frequency is too high), and the unit is MW or kW.
[0154] k: Droop coefficient, which determines the proportional relationship between frequency deviation and power adjustment. Its value range is: k > 0. The specific value needs to be adjusted according to the frequency regulation requirements of the power grid area and the total photovoltaic capacity in the area. The unit is MW / Hz.
[0155] f_measured: The system frequency value measured in real time by the cluster controller. Its value range is between 49.8 Hz and 50.2 Hz under normal operating conditions. Control will only be triggered if the frequency exceeds this "dead zone".
[0156] f_setpoint: The system's rated frequency, with a value range of 50.0 Hz in the Chinese power grid.
[0157] The cluster controller allocates the total reduction to all inverters within its jurisdiction either proportionally or according to an adjustable capacity ratio. The formula for allocating the adjustable capacity ratio is as follows:
[0158] ;
[0159] ΔP_i: The amount of active power reduction that the i-th photovoltaic inverter needs to bear. Its value range is [0, P_inv_i], which means it cannot exceed its current actual output. The unit is kW or W.
[0160] P_inv_i: The actual active power currently generated by the i-th photovoltaic inverter, with a value range of [0, S_rated], and the unit is kW.
[0161] This represents the sum of the current active power output of all photovoltaic inverters within the jurisdiction, i.e., P_inv_1 + P_inv_2 + ... + P_inv_m, with a value range of [0, total photovoltaic capacity within the jurisdiction], and the unit is kW.
[0162] Command execution:
[0163] The new active power setpoint P_new_i for the i-th photovoltaic inverter is obtained. The formula for calculating P_new_i is as follows:
[0164] P_new_i = P_inv_i - ΔP_i
[0165] The value range of P_new_i is [0, P_inv_i]. Because it is an active power reduction, the new set value will not be greater than its current output.
[0166] The cluster controller writes the value of P_new_i to the active power setpoint register of each inverter in real time via the Modbus TCP protocol. After receiving the command, the inverter quickly reduces its active power output, discarding more photovoltaic energy and thus helping the grid frequency recover.
[0167] # In the cluster controller's inner loop
[0168] f_measured = get_frequency_from_dtu() # Get the current frequency from the DTU hardware
[0169] f_setpoint = 50.0 # Hz
[0170] deadband_low = 49.8
[0171] deadband_high = 50.2
[0172] k_droop = 0.4 # MW / Hz, droop factor, needs to be tuned according to system conditions.
[0173] if f_measured > deadband_high:
[0174] # Calculate the total power reduction
[0175] delta_f = f_measured - f_setpoint
[0176] P_total_curtail = k_droop * delta_f # The unit may be MW
[0177] # Convert to watts and distribute to each inverter (proportional example)
[0178] total_current_p = sum(inv['P_inv'] for inv in inverter_list) # Total current active power
[0179] P_total_curtail_watts = P_total_curtail * 1e6
[0180] for inv in inverter_list:
[0181] # Calculate the proportion that the inverter should bear.
[0182] proportion = inv['P_inv'] / total_current_p
[0183] P_curtail_i = P_total_curtail_watts * proportion
[0184] new_setpoint = max(0, inv['P_inv'] - P_curtail_i) # The new setpoint cannot be negative
[0185] # Issue active power setpoint command
[0186] client = ModbusTcpClient(inv['ip'])
[0187] client.write_register(address=40001, value=int(new_setpoint)) # Assuming 40001 is the active power setpoint register
[0188] client.close()
[0189] elif f_measured < deadband_low:
[0190] # If the frequency is too low, additional photovoltaic power generation is usually not required (it may already be operating at full capacity), but previously reduced power can be released.
[0191] # The implementation logic is similar, but in the opposite direction, so it is omitted here.
[0192] pass
[0193] else:
[0194] # Frequency is normal, no action required.
[0195] Pass.
[0196] Step 5: System runs in a loop
[0197] Steps two through four above form a closed-loop feedback control system, which continuously circulates within the centralized controller and cluster controller to achieve real-time, adaptive, and coordinated control of the distribution network voltage and frequency.
[0198] Using Python's APScheduler task scheduler, the optimization calculation process (i.e., step three) is automatically initiated at fixed intervals (e.g., every 5 minutes). Event triggering: A voltage over-limit listener is set. If the status update process detects that the voltage of a node suddenly exceeds the set critical over-limit threshold (e.g., V > 1.07 pu), it can immediately issue an interrupt signal, pausing the loop update process and prematurely triggering the optimization calculation process to jump to step three, without waiting for the next 5-minute cycle, thus achieving rapid response. After the optimization calculation is completed, the result instruction Q_ref_i is placed in an instruction message queue. Another dedicated communication delivery process retrieves the instruction from the queue and reliably sends it to the corresponding cluster controller via protocols such as IEC 104 or MQTT.
[0199] #Centralized Controller - Main Application Structure (using APScheduler and Redis message queues)
[0200] from apscheduler.schedulers.background import BackgroundScheduler
[0201] import redis
[0202] # 1. Initialize the scheduler and state
[0203] scheduler = BackgroundScheduler()
[0204] r = redis.Redis(host='localhost', port=6379, db=0) # Used for in-memory state and message queue
[0205] # 2. Define the scheduled task: Optimize the computation process
[0206] def optimization_job():
[0207] if not check_data_freshness(): # Check if the data is fresh and available.
[0208] return
[0209] try:
[0210] # Perform optimization calculations in step three
[0211] Q_ref_values = run_opf_optimization()
[0212] # Add the command to the message queue with the cluster controller ID as the subject.
[0213] for cluster_id, q_value in Q_ref_values.items():
[0214] r.publish(f'command:{cluster_id}', q_value)
[0215] except Exception as e:
[0216] log_error(f"Optimization job failed: {e}")
[0217] # Send alert emails / SMS
[0218] # 3. Scheduled Trigger: Execute every 5 minutes
[0219] scheduler.add_job(optimization_job, 'interval', minutes=5)
[0220] # 4. Event Triggering: Listen for voltage over-limit events
[0221] def on_voltage_alert(node_id, value):
[0222] if value > 1.07:
[0223] # Trigger an optimization immediately
[0224] optimization_job()
[0225] # 5. Start the scheduler and all listening processes.
[0226] scheduler.start()
[0227] start_scada_listening_daemon(on_voltage_alert) # Start the SCADA listening daemon process
[0228] start_command_sender_daemon() # Start the daemon process that sends the command.
[0229] # Main thread blocked, keeping program running
[0230] try:
[0231] while True:
[0232] time.sleep(2)
[0233] except KeyboardInterrupt:
[0234] scheduler.shutdown()
[0235] #Cluster Controller
[0236] / / Cluster Controller - Simplified Main Loop Concept (Based on Embedded C)
[0237] void main() {
[0238] hardware_init(); / / Initialize hardware
[0239] watchdog_enable(); / / Enable hardware watchdog
[0240] network_connect(); / / Connect the network and the center
[0241] while (1) {
[0242] watchdog_feed(); / / Main loop begins, feed the dog first.
[0243] / / 1. High-frequency data acquisition task (every 1 second)
[0244] if (timer_1s_elapsed()) {
[0245] poll_all_inverters(); / / Poll all inverter data
[0246] read_local_frequency(); / / Read local frequency
[0247] }
[0248] / / 2. Listen for network commands (non-blocking check)
[0249] check_for_central_commands(); / / Check and process commands from the central command.
[0250] / / 3. High-frequency control task (every 100 milliseconds)
[0251] if (timer_100ms_elapsed()) {
[0252] if (frequency > 50.2) {
[0253] execute_freq_droop_control(); / / Execute droop control
[0254] }
[0255] }
[0256] / / 4. System idle tasks, status reporting, etc.
[0257] send_heartbeat_to_central();
[0258] sleep_idle(); / / Enter low-power sleep mode, waiting for the next timer interrupt.
[0259] }
[0260] }
[0261] This invention uses distributed photovoltaic inverters as the grid connection interface for photovoltaic power generation, which are deployed throughout the power grid and possess powerful power electronic control capabilities. Exploring their collaborative control potential represents the most promising development direction for solving current distribution network stability problems.
Claims
1. A method for optimizing distribution network stability based on distributed photovoltaic inverter collaborative control, characterized in that: Includes the following steps, And the following steps are performed in sequence: Step 1: System hardware deployment, initialization, and configuration; Step 2: Real-time data acquisition and monitoring; Step 3: Establish and solve the optimization model to achieve voltage stability control; The objective function F of the optimization model is to minimize the sum of the deviations between the total grid voltage and the rated voltage. The solution of the optimization model is the reactive power reference value Q_ref_i for each i-th photovoltaic inverter that needs to participate in regulation. Triggering condition: If the central controller detects that the voltage of one or more nodes exceeds the set threshold range, it will solve the optimization model. Command issuance and execution: Based on the Q_ref_i value, the photovoltaic inverter i changes its output reactive power to a new set value, thereby affecting the grid connection point voltage; Step 4: Power Grid Frequency Stability Control Triggering conditions: The cluster controller continuously monitors the grid frequency f obtained from the line terminal unit (DTU) or the smart distribution transformer terminal (TTU) itself; sets the dead zone range of the grid frequency f, and triggers the system when the grid frequency f is lower or higher than the dead zone range. Determine and calculate whether the power grid frequency f is in the dead zone; Step 5: System runs in a loop Repeat steps two through four above to form a closed-loop feedback control system, which continuously circulates within the centralized controller and cluster controller to achieve real-time, adaptive, and coordinated control of the distribution network voltage and frequency; The system hardware deployment, initialization, and configuration in step one are specifically as follows: A centralized optimization controller is installed in the computer room of the distribution network control center, and a network connection is established with all cluster controllers through the power dispatch data network. The cluster controller is embedded with line terminal units (DTUs) and intelligent distribution transformer terminals (TTUs). Each cluster controller is connected to all photovoltaic inverters in its jurisdiction. The distribution network is also equipped with a distribution automation system (SCADA). The real-time data acquisition and monitoring in step two specifically includes: The data acquisition module of the SCADA distribution automation system periodically reads data from selected key nodes, including voltage V, frequency f, active power P, and reactive power Q, from substations, feeder terminal units (FTUs) along feeders, and intelligent distribution transformer terminals (TTUs), and writes them into the real-time database. The centralized optimization controller obtains data from key nodes in the real-time database through queries or message subscriptions. The cluster controller periodically polls the real-time operating data of all photovoltaic inverters within its jurisdiction, including: the output active power P_inv, output reactive power Q_inv, current operating status, and maximum reactive power Q_max that the photovoltaic inverter can provide in the current operating state. The maximum reactive power Q_max that can be provided is related to the current active power: ; Where Q_max represents the maximum reactive power that the photovoltaic inverter can provide under the current operating conditions. This is a real-time changing value, ranging from [0, S_rated], and the unit is kVar or Var; S_rated is the rated apparent power of the photovoltaic inverter, which is the maximum capacity marked on the inverter's nameplate. It is a fixed value, and the unit is kVA; P_inv is the output active power of the photovoltaic inverter under the current operating conditions. This is a real-time measured value, ranging from [0, S_rated], and the unit is kW or W; The objective function F of the optimization model in step three is formulated as follows: ; Where V_i is the actual voltage measurement value of the i-th critical measurement node, which is a per-unit value; V_ref is the voltage reference value set by the system, i.e. the target voltage to be achieved, which is a per-unit value; n is the total number of critical nodes; Solve the optimization model: The centralized controller transforms the objective function F into a nonlinear programming or quadratic programming problem and calls the optimization solver to solve it. The solution result is the reactive power reference value Q_ref_i for each i-th photovoltaic inverter that needs to participate in regulation. The optimization model in step three has the following constraints: Including inverter reactive power output constraints, as detailed below: The reactive power output of each inverter i cannot exceed its current capacity, as shown below: -Q_max_i ≤ Q_i ≤+Q_max_i; In the formula, Q_i is the reference value of the reactive power that the i-th photovoltaic inverter needs to generate; Q_max_i is the maximum reactive power that the i-th photovoltaic inverter can currently generate. The issuance and execution of instructions in step three are as follows: The centralized controller sends the calculated Q_ref_i command to the corresponding cluster controller according to its region. The cluster controller writes the Q_ref_i value into the reactive power setpoint register of the corresponding inverter i. After receiving the new setpoint, the photovoltaic inverter i adjusts the switching timing of the insulated gate bipolar transistor (IGBT) in its internal control loop to change the output reactive power to the new setpoint. Step four involves determining and calculating whether the power grid frequency f is in the dead zone, specifically including: If the grid frequency f is within the dead zone, no action is taken. If the grid frequency f is lower than the lower limit of the dead zone, it indicates insufficient power generation, and load reduction is implemented. If the grid frequency f is higher than the upper limit of the dead zone, it indicates excessive power generation, and active power is reduced. The cluster controller calculates and obtains the total active power ΔP_total that needs to be reduced by all photovoltaic inverters in the jurisdiction based on the preset droop coefficient k and the formula for the total active power to be reduced. The cluster controller allocates the total active power reduction ΔP_total required by all photovoltaic inverters in the jurisdiction to all photovoltaic inverters in the jurisdiction according to the proportion or the adjustable capacity ratio, and obtains the amount of active power reduction that each photovoltaic inverter needs to bear. The photovoltaic inverters obtain new active power setpoints based on their current actual active power output and the amount of active power reduction they need to bear. The cluster controller writes the new active power setpoint of each photovoltaic inverter into the active power setpoint register connected to each photovoltaic inverter in real time. After receiving the setpoint command, the inverter reduces its active power output to the new active power setpoint, discarding more photovoltaic energy, thereby helping the grid frequency to recover and achieving grid frequency stability control. The formula for the total active power reduction ΔP_total required by all photovoltaic inverters within the jurisdiction is: ΔP_total = k * (f_measured - f_setpoint); In the formula, k is the droop coefficient, k > 0; f_measured is the system frequency value measured in real time by the cluster controller; f_setpoint is the rated frequency of the system, which is taken as 50.0 Hz here; The formula for allocating the adjustable capacity ratio is as follows: ; ΔP_i is the amount of active power reduction that the i-th photovoltaic inverter needs to bear; P_inv_i is the current actual active power generated by the i-th photovoltaic inverter; m is the total number of photovoltaic inverters in the jurisdiction; The calculation formulas for the new active power setpoints of each photovoltaic inverter are as follows: P_new_i = P_inv_i - ΔP_i; In the formula, P_new_i is the new active power setting value of the i-th photovoltaic inverter, and its value range is [0, P_inv_i]; The aforementioned distribution network stability optimization method based on distributed photovoltaic inverter collaborative control also uses the APScheduler task scheduler in Python programming language to automatically start the optimization calculation process (step three) at fixed intervals. The specific steps of the optimization calculation process are as follows: Event triggering: Set up a voltage over-limit listener to monitor in real time during the state cyclic update process from step two to step four. If the voltage of a node exceeds the set severe over-limit threshold, the voltage over-limit listener will immediately send an interrupt signal, the cyclic update process will be paused, and the optimization calculation process will be triggered in advance, that is, jump to step three without waiting for the next 5-minute cycle, thus achieving a fast response. Execution: After the optimization calculation in step three is completed, the result instruction Q_ref_i is placed into an instruction message queue. Another dedicated communication delivery process retrieves the instruction from the queue and sends it to the corresponding cluster controller, and then continues to step four.
Citation Information
Patent Citations
Distributed optical storage cooperative power distribution network two-stage voltage control method and device
CN118713107A
Distributed photovoltaic cluster intelligent control device, method, equipment and medium
CN120566393A