Direct-current micro-grid bidirectional energy router control system and method
By dynamically adjusting control parameters through real-time state perception and particle swarm optimization algorithms, the voltage stability and response speed issues of DC microgrids under rapidly changing operating conditions are solved, achieving efficient energy management.
Patent Information
- Application Number
- CN202511692142.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-02-13
AI Technical Summary
Existing DC microgrid control systems struggle to simultaneously guarantee voltage stability and response speed when faced with operating conditions that vary on the order of seconds or even milliseconds. This can lead to increased energy loss or delayed response, potentially triggering a chain reaction of failures.
The system employs a real-time state perception module, a solution space particle initialization module, an adaptive iterative optimization module, and a power command decision module. It periodically collects data through voltage and current sensors to construct a real-time system state vector and dynamically adjusts control parameters using a particle swarm optimization algorithm to achieve fast response and steady-state accuracy.
It improves the dynamic response speed and steady-state accuracy of DC microgrids, suppresses voltage overshoot and fluctuations, reduces control command jitter, and enhances the energy management efficiency of the system.
Smart Images

Figure CN121529480A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of swarm intelligence technology, and in particular to a bidirectional energy router control system and method for DC microgrids. Background Technology
[0002] The field of swarm intelligence is a computational intelligence paradigm inspired by the collective behavior of social biological groups in nature, such as ant colonies foraging, bird flocks migrating, and bee swarms collecting nectar.
[0003] Existing technologies typically use a fixed set of operating parameters to guide the group search. This static setting is difficult to adapt to the second- or even millisecond-level changes in operating conditions of DC microgrids. For example, a large search factor set to cope with sudden high-power disturbances can cause continuous oscillations in control commands during stable operation, increasing unnecessary energy loss and equipment wear. Conversely, a small search factor set to pursue steady-state accuracy may not provide a sufficiently fast response when the system experiences faults or drastic load changes, potentially leading to prolonged voltage deviations from allowable ranges and even triggering cascading failures. Therefore, improvements are needed. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the existing technology and to propose a bidirectional energy router control system and method for DC microgrids.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: A bidirectional energy router control system for a DC microgrid includes: The real-time status sensing module uses voltage sensors and multiple current sensors to periodically collect DC bus voltage values, photovoltaic output current values, energy storage unit current values, load current values, and grid interaction current values. It calculates the difference between the DC bus voltage value and the reference voltage value and performs time-domain accumulation. It also summarizes the power values of multiple ports to calculate the system power imbalance. At the same time, it calculates the charge and discharge rate based on the energy storage unit current value and rated capacity value to establish a real-time system status vector. The space particle initialization module generates multiple power allocation schemes as position vectors within the preset upper and lower power limits of each port based on the real-time system state vector. It also matches a set of random velocity vectors within a preset velocity range for each position vector and combines the position vectors and velocity vectors into multiple particles to construct an initial power allocation particle swarm.
[0006] Preferably, the system includes: The adaptive iterative optimization module calculates the DC bus voltage deviation integral value, the estimated system network loss value, and the energy storage unit charging and discharging rate for the position vector of each particle in the swarm based on the initial power allocation particle swarm and the real-time system state vector. It also inputs the instantaneous change rate of the DC bus voltage and the power imbalance into a preset mapping function to obtain dynamic inertia weights and learning factors. The updated weights and learning factors are used to update the velocity vector and position vector of each particle, filter non-dominated solutions, and obtain the Pareto optimal power instruction set. The power command decision module, based on the Pareto optimal power command set, matches a preset weight coefficient set according to the current system operating conditions, and uses the weight coefficient set to perform a weighted summation of the voltage deviation target value, network loss target value, and energy storage lifetime target value of each solution in the command set to obtain a comprehensive evaluation value. The module then selects the solution with the best comprehensive evaluation value and generates a power scheduling command for the selected port.
[0007] Preferably, the real-time state awareness module includes: The port data acquisition submodule uses voltage sensors and multiple current sensors to convert port analog signals into digital quantities at a preset sampling frequency through an analog-to-digital converter, and timestamps continuous digital quantities to form synchronous data frames including voltage and multiple currents, thereby acquiring a set of electrical parameters for multiple ports. The key indicator calculation submodule calculates the difference between the DC bus voltage value and the reference voltage based on the multi-port electrical parameter set, sums them up within a preset time window, compares the power values of each port with the preset total power target value to obtain the imbalance, and divides the energy storage unit current value by the rated capacity value to obtain the system operating status indicator set. The state vector construction submodule, based on the system operating state index set, arranges the calculated voltage deviation integral value, power imbalance degree and charge / discharge rate in a predetermined order and encapsulates them into a structured array to establish a real-time system state vector.
[0008] Preferably, the solution space particle initialization module includes: The power scheme generation submodule generates multiple allocation schemes that satisfy power constraints within the preset upper and lower power limits of each port based on the real-time system state vector, and represents each scheme as a multi-dimensional position vector to establish a random power position vector set. The particle velocity initialization submodule generates an equal number of random velocity vectors with dimensions matching the position vectors within a preset velocity upper and lower limit range, based on the random power position vector set and the number of position vectors in the set, thereby constructing a random particle velocity set. The particle swarm structuring submodule pairs the vectors in the random power position vector set and the random particle velocity set according to the index order. Each position vector is combined with a velocity vector to form a particle structure and construct an initial power allocation particle swarm.
[0009] Preferably, the adaptive iterative optimization module includes: The particle fitness evaluation submodule, based on the initial power allocation particle swarm and the real-time system state vector, substitutes the position vector of each particle into the power flow equation to calculate the line loss, and directly extracts the voltage deviation and charge / discharge rate as two other target values to generate a multi-target fitness numerical matrix. The dynamic parameter adjustment submodule, based on the multi-objective fitness numerical matrix and the real-time system state vector, maps the instantaneous rate of change of DC bus voltage and power imbalance values to the corresponding inertia weight and learning factor value ranges through a piecewise linear function, obtains the parameters for iterative updates, and obtains the adaptive iterative parameter set.
[0010] Preferably, the adaptive iterative optimization module further includes: The particle swarm update and filtering submodule updates the velocity and position based on the adaptive iterative parameter set, combined with the current individual optimal position and global optimal position of each particle. It then uses a non-dominated sorting method to compare the dominance relationships of the updated particles, filters all non-dominated solutions and stores them in an external archive, and obtains the Pareto optimal power instruction set.
[0011] Preferably, the power command decision module includes: Run the weight matching submodule, match the category of the current system operating condition with the preset weight coefficient lookup table according to the Pareto optimal power instruction set, retrieve and output the corresponding weight value, and obtain the current operating condition weight coefficient. The comprehensive performance evaluation submodule, based on the Pareto optimal power command set and the current operating condition weight coefficient, performs a weighted summation of the three objective function values for each non-dominated solution in the set, transforming the multi-objective evaluation problem into a single-objective evaluation problem, and obtaining a list of comprehensive evaluation values for the command solutions.
[0012] Preferably, the power command decision module further includes: The optimal instruction selection submodule, based on the instruction decomposition comprehensive evaluation value list, selects a power allocation scheme corresponding to the evaluation value with the best value by comparing the magnitude of all evaluation values in the list, and generates a power scheduling instruction for the selected port.
[0013] This invention also provides a bidirectional energy router control method for DC microgrids, comprising the following steps: Using voltage sensors and multiple current sensors, the DC bus voltage, photovoltaic output current, energy storage unit current, load current, and grid interaction current are periodically collected. The difference between the DC bus voltage and the reference voltage is calculated and accumulated in the time domain. The power imbalance of the system is calculated by summing the power values of multiple ports. At the same time, the charge and discharge rate is calculated based on the energy storage unit current and rated capacity, and a real-time system state vector is established. Based on the real-time system state vector, within the preset upper and lower limit ranges of power for each port, multiple power allocation schemes are generated as position vectors by a random number generator, and a set of random velocity vectors within a preset velocity range are matched for each position vector. The position vectors and velocity vectors are combined into multiple particles to construct an initial power allocation particle swarm. Based on the initial power allocation particle swarm and the real-time system state vector, the DC bus voltage deviation integral value, the estimated system network loss value, and the energy storage unit charging and discharging rate are calculated for the position vector of each particle in the swarm. The instantaneous change rate of DC bus voltage and the power imbalance are input into a preset mapping function to obtain dynamic inertia weights and learning factors. The updated weights and learning factors are used to update the velocity vector and position vector of each particle, filter non-dominated solutions, and obtain the Pareto optimal power instruction set. Based on the Pareto optimal power instruction set, a preset weight coefficient set is matched according to the current system operating conditions. The voltage deviation target value, network loss target value, and energy storage lifetime target value of each solution in the instruction set are weighted and summed using the weight coefficient set to obtain a comprehensive evaluation value. The solution with the best comprehensive evaluation value is selected to generate a power scheduling instruction for the selected port.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by periodically collecting DC bus voltage and multi-port current values, and calculating voltage deviation integral, power imbalance, and energy storage charge / discharge rate, a vector reflecting the instantaneous operating state of the microgrid can be constructed. Based on this vector, the complex power scheduling problem is transformed into a multi-objective optimization function that includes voltage stability, system network loss, and energy storage lifetime. Parallel solutions are obtained using a swarm of particles. The key is to dynamically correlate the inertia weight and learning factor of the particle swarm with the DC bus voltage change rate and power imbalance, establishing a real-time feedback mechanism between control algorithm parameters and system physical state. During severe disturbances, the search range can be broadened, guiding the power allocation scheme to converge quickly to a new stable operating point, effectively suppressing voltage overshoot and fluctuations. When the system tends to stabilize, local optimization is performed to reduce control command jitter and steady-state error. Finally, the command that best suits the current operating conditions is selected from the Pareto optimal solution set through weighted decision-making, improving the dynamic response speed and steady-state accuracy of the DC bus voltage. Attached Figure Description
[0015] Figure 1 This is a system flowchart of the present invention. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0017] Please see Figure 1 This invention provides a technical solution: a DC microgrid bidirectional energy router control system comprising: The real-time status sensing module uses voltage sensors and multiple current sensors to periodically collect DC bus voltage values, photovoltaic output current values, energy storage unit current values, load current values, and grid interaction current values. It calculates the difference between the DC bus voltage value and the reference voltage value and performs time-domain accumulation. It also summarizes the power values of multiple ports to calculate the system power imbalance. At the same time, it calculates the charge and discharge rate based on the energy storage unit current value and rated capacity value to establish a real-time system status vector. The solution space particle initialization module generates multiple power allocation schemes as position vectors within the preset upper and lower power limits of each port based on the real-time system state vector. It also matches a set of random velocity vectors within a preset velocity range for each position vector and combines the position vectors and velocity vectors into multiple particles to construct the initial power allocation particle swarm. The adaptive iterative optimization module calculates the integral value of DC bus voltage deviation, the estimated value of system network loss, and the charging and discharging rate of energy storage unit for the position vector of each particle in the swarm based on the initial power allocation particle swarm and the real-time system state vector. It also inputs the instantaneous change rate of DC bus voltage and the power imbalance into a preset mapping function to obtain dynamic inertia weights and learning factors. The updated weights and learning factors are used to update the velocity vector and position vector of each particle, filter non-dominated solutions, and obtain the Pareto optimal power instruction set. The power command decision module matches a preset weighted coefficient set based on the Pareto optimal power command set and the current system operating conditions. It then uses the weighted coefficient set to perform a weighted summation of the voltage deviation target value, network loss target value, and energy storage lifetime target value for each solution in the command set to obtain a comprehensive evaluation value. Finally, it selects the solution with the best comprehensive evaluation value and generates a power scheduling command for the selected port.
[0018] The real-time status awareness module includes: The port data acquisition submodule uses voltage sensors and multiple current sensors to convert port analog signals into digital quantities at a preset sampling frequency through an analog-to-digital converter, and timestamps continuous digital quantities to form synchronous data frames including voltage and multiple currents, thereby acquiring a set of electrical parameters for multiple ports. The key indicator calculation submodule calculates the difference between the DC bus voltage value and the reference voltage based on the multi-port electrical parameter set, sums them up within a preset time window, compares the power values of each port with the preset total power target value to obtain the imbalance, and divides the energy storage unit current value by the rated capacity value to obtain the system operating status indicator set. The state vector construction submodule arranges the calculated voltage deviation integral value, power imbalance degree and charge / discharge rate in a predetermined order according to the system operation state index set, and encapsulates them into a structured array to establish a real-time system state vector.
[0019] Specifically, the port data acquisition submodule first connects to sensors installed at various key nodes of the DC microgrid via hardware interfaces. This includes a voltage divider sensor located on the DC bus, and Hall effect current sensors deployed at the photovoltaic array output, energy storage unit interface, main load connection point, and grid common coupling point. Then, the analog-to-digital converter (ADC) operating parameters are configured, and a fixed sampling frequency is set. This frequency is set to be at least 10 times the switching frequency of the power electronic converter within the microgrid system. For example, if the converter switching frequency is 10kHz, the sampling frequency is set to 100kHz to ensure accurate capture of transient voltage and current changes caused by switching actions. At each sampling moment, the ADC simultaneously samples and converts the analog voltage signals from all sensor channels, generating a set of 16-bit precision raw digital values. To ensure the synchronization of data from all channels, a synchronization trigger signal driven by the system master clock is used to initiate the analog-to-digital conversion of all channels. During the conversion process, after the conversion is completed, the current count value of the hardware timer (e.g., a 64-bit microsecond-level counter) is immediately read as the timestamp of the data set. This timestamp is then combined with the digital values of the DC bus voltage and the multiple currents to form a structured data record, which is a synchronization data frame. The specific structure of this data frame is: a 64-bit unsigned integer timestamp, a 32-bit floating-point bus voltage value, and a 32-bit floating-point array containing photovoltaic current, energy storage current, load current, and grid interaction current. The continuously generated synchronization data frames are sequentially stored in a first-in-first-out (FIFO) circular buffer. The size of this buffer is set to accommodate the amount of data in the most recent second, i.e., 100,000 data frames, thus forming a dynamically updated original dataset containing accurate time and electrical quantity information. Finally, the most recent N (e.g., N=1000) data frames are extracted from this circular buffer to form a set of multiple-port electrical parameters for subsequent calculations.
[0020] The key performance indicator (KPI) calculation submodule initiates a series of calculation processes to quantify the current operating status of the system based on the multi-port electrical parameter set obtained in the previous step. First, it processes the integral of the DC bus voltage deviation, extracting all DC bus voltage values within the most recent preset time window from the multi-port electrical parameter set. The length of this time window is dynamically set according to the system control cycle, typically 20 milliseconds, corresponding to 2000 sampling points. Next, it subtracts each voltage sample value within this window from a fixed reference voltage value (e.g., the system nominal voltage of 400V) to obtain a series of instantaneous voltage deviation values. Then, these deviation values are multiplied by the sampling time interval (10 microseconds) and summed. The calculation formula is as follows: ,in, It is the integral value of voltage deviation. This is the number of sampling points within the time window (2000). It is the kth voltage sample value. The reference voltage is 400V. The sampling interval is 10 microseconds to obtain the cumulative deviation reflecting recent voltage stability. The formula considers both the magnitude and duration of the voltage deviation. A small but persistent deviation, or a large but short-lived deviation, will be effectively quantified by this integral value, thus providing a more comprehensive reflection of voltage quality over a period of time. Simultaneously, the system power imbalance is calculated using the voltage and multiplex current values from the latest synchronized data frame in the multi-port electrical parameter set to calculate the instantaneous power of each port, such as photovoltaic output power. Energy storage unit power (Charging is negative, discharging is positive), load consumes power. and grid interaction power (Input is negative, output is positive), and then these power values are algebraically summed according to the energy flow direction, that is... The preset total power target value here is set to 0, so the summation result is directly used as the power imbalance. Finally, the charge and discharge rate of the energy storage unit is calculated by dividing the latest energy storage unit current value (absolute value) by a preset rated capacity value of the energy storage unit. This rated capacity value comes from the static configuration parameters of the battery management system (BMS), such as 100 ampere-hours (Ah). The dimensionless value obtained is the current charge and discharge rate. Finally, the three key indicators of voltage deviation integral value, power imbalance and charge and discharge rate are summarized to obtain the system operation status index set.
[0021] The state vector construction submodule performs data structuring operations based on the system operating state index set obtained in the previous step. This index set includes three independent values: voltage deviation integral value, power imbalance degree, and charge / discharge rate. To facilitate unified processing in subsequent optimization algorithms, these indices with different physical meanings and dimensions need to be standardized and organized. First, these three indices are arranged in a predetermined and fixed order, defined as follows: the first element is the voltage deviation integral value, the second element is the power imbalance degree, and the third element is the charge / discharge rate. This fixed order ensures that each element in the vector always corresponds to the same physical meaning, avoiding confusion during algorithm processing. Next, to eliminate the impact of differences in the numerical ranges of different indices on algorithm performance, each index value is normalized and mapped to a unified interval, such as [-1, 1]. The specific normalization operation is as follows: for the voltage deviation integral value, a maximum expected integral value is set. (For example, estimate the maximum allowable voltage fluctuation and duration as 0.1 volt-seconds, then divide the actual calculated value by this maximum value; for power imbalance, set a maximum unbalanced power threshold.) (For example, 5% of the total system capacity, such as 1 kilowatt), divide the actual value by the threshold; for the charge / discharge rate, it is usually in the range of [0, C_max] (for example, the maximum allowable rate is 1C), so you can directly divide the actual value by the maximum allowable rate. After normalization, the three normalized values arranged in a predetermined order are encapsulated into a structured array or vector data type, such as a one-dimensional array containing three 32-bit floating-point numbers. This structured array is the final real-time system state vector.
[0022] The solution space particle initialization module includes: The power scheme generation submodule generates multiple allocation schemes that meet power constraints within the preset upper and lower power limits of each port based on the real-time system state vector, and represents each scheme as a multi-dimensional position vector to establish a random power position vector set. The particle velocity initialization submodule generates an equal number of random velocity vectors with dimensions matching the position vectors within a preset velocity upper and lower limit range, based on the random power position vector set and the number of position vectors in the set, thus constructing a random particle velocity set. The particle swarm structuring submodule pairs the vectors in the random power position vector set and the random particle velocity set according to the index order. Each position vector is combined with a velocity vector to form a particle structure and construct the initial power allocation particle swarm.
[0023] Specifically, the power scheme generation submodule executes the initial generation of the power allocation scheme based on the control cycle triggered by the real-time system state vector. This process does not directly use the value of the real-time system state vector, but uses its generation as the start signal. The core basis is a set of preset upper and lower limit ranges of power for each port. These ranges are dynamically determined according to the physical characteristics and current operating status of each port device. For example, the lower limit of the photovoltaic port is always 0, and the upper limit is the real-time maximum output power calculated by the maximum power point tracking (MPPT) algorithm under the current irradiance and temperature. The power range of an energy storage unit is determined by its current state of charge (SOC) and state of health (SOH), and its maximum charging power... and maximum discharge power Provided by the Battery Management System (BMS), forming The power range of the grid interconnection port is determined by the agreement with the grid operator or the rated capacity of the converter, for example... Next, within this multidimensional power space, a specified number (e.g., 50 groups) of power allocation schemes are generated using a random number generator. To ensure that each generated scheme satisfies the system's power balance constraints, i.e. The power value is generated using a constraint satisfaction strategy. Specifically, for a system with N controllable ports, N-1 power values are randomly generated, with each value randomly selected within its respective upper and lower limit range. Then, the power value of the Nth port is calculated based on the power balance equation. Calculate Then, check if it also falls within its own power upper and lower limit range. If it does, then the group [ A valid allocation scheme is formed. If the scheme is not satisfied, the set of random numbers is discarded and regenerated until a valid scheme is obtained. Each valid power allocation scheme generated in this way is represented as a multi-dimensional position vector, where each dimension of the vector corresponds to the power setting value of a controllable port. Finally, all 50 sets of multi-dimensional position vectors generated are set together to establish a random power position vector set.
[0024] The particle velocity initialization submodule generates initial velocity information for the particle swarm to be constructed based on the random power position vector set established in the previous step. The core of this process is to match each position vector in the random power position vector set with an initial velocity vector of the same dimension and random values. First, the number of velocity vectors to be generated is determined, and this number is exactly equal to the number of position vectors in the random power position vector set. For example, if 50 position vectors are generated, then 50 velocity vectors also need to be generated. Next, a preset upper and lower limit range is set for each dimension of the velocity vector. The setting of this range directly affects the convergence performance of the particle swarm optimization algorithm. A common method is to set the upper and lower limits of the velocity as a proportional coefficient to the range of variation of the corresponding position vector dimension (i.e., port power). For example, the maximum velocity... Set to the corresponding power range 20% of Speed limit Then let it be its opposite, that is Taking an energy storage port as an example, if its power range is [-5kW, 5kW] and the total range is 10kW, then its corresponding velocity upper and lower limit intervals are [-2 kW / iteration, 2 kW / iteration]. Then, for each particle to be initialized, traverse each dimension of its velocity vector and generate a uniformly distributed random number within the velocity upper and lower limit intervals corresponding to that dimension, as the initial velocity value for that dimension. For example, the initial value of the j-th dimension of the velocity vector. Through formula The calculation yielded, where This represents a random number between 0 and 1. The formula generates a random initial velocity within a preset velocity range. This process is repeated for all dimensions of all 50 particles, eventually generating a set containing 50 velocity vectors, which is the random particle velocity set.
[0025] The particle swarm structuring submodule performs final combination and encapsulation based on the previously generated random power position vector sets and random particle velocity sets to construct an initial power allocation particle swarm that can be directly used by the optimization algorithm. This process is a deterministic data pairing and structuring process. First, the vectors in the random power position vector set and random particle velocity set are paired one-to-one according to their index order in the set, ensuring that the first position vector is paired with the first velocity vector, the second position vector with the second velocity vector, and so on, until all vectors are paired. This strict index correspondence ensures that each initialized particle has a unique set of corresponding position and velocity attributes. Next, a unified particle data structure is defined for each paired position-velocity vector pair. This structure is a composite data type and contains at least the following core fields: current_position, used to store the current position vector; current_velocity, used to store the current velocity vector; personal `_best_position` stores the best position the particle has experienced since the start of the iteration. During initialization, this field is directly set to the value of its `current_position`. `personal_best_fitness` stores the fitness value corresponding to the individual's best position. During initialization, this field is usually set to a value representing infinity and is updated after the first fitness evaluation. Each paired position and velocity vector is filled into the `current_position` and `current_velocity` fields of this particle structure, and the `personal_best_position` field is also initialized to the value of `current_position`, completing the structured creation of a particle. This operation is repeated for all 50 paired vectors, ultimately gathering all the created particle structures into an array or list, thus constructing a complete initial power allocation particle swarm containing 50 particles.
[0026] The adaptive iterative optimization module includes: The particle fitness evaluation submodule, based on the initial power allocation particle swarm and the real-time system state vector, substitutes the position vector of each particle into the power flow equation to calculate the line loss, and directly extracts the voltage deviation and charge / discharge rate as two other target values to generate a multi-target fitness numerical matrix. The dynamic parameter adjustment submodule, based on the multi-objective fitness numerical matrix and the real-time system state vector, maps the instantaneous change rate of DC bus voltage and power imbalance values to the corresponding inertia weight and learning factor value ranges through a piecewise linear function, obtains the parameters for iterative updates, and obtains the adaptive iterative parameter set. The particle swarm update and filtering submodule updates the velocity and position based on the adaptive iterative parameter set, combined with the current individual optimal position and the global optimal position of each particle. It then uses a non-dominated sorting method to compare the dominance relationships of the updated particles, filters all non-dominated solutions and stores them in an external archive, and obtains the Pareto optimal power instruction set.
[0027] Specifically, the particle fitness evaluation submodule performs fitness calculations for each particle in the particle swarm based on the initial power allocation particle swarm and the real-time system state vector. First, for the calculation of the network loss target value, the position vector of each particle (i.e., a specific set of port power allocation schemes, such as {P_PV=5kW, P_bat=-1kW, P_grid=-2kW, P_load=2kW}) is used as known input and substituted into the pre-established DC microgrid power flow equation. This equation is constructed based on Kirchhoff's laws, specifically in the form that the node injected current vector equals the node admittance matrix multiplied by the node voltage vector, i.e. Among them, the nodal admittance matrix The microgrid topology and line resistance parameters are pre-calculated and stored. These parameters are obtained through offline measurements or by consulting cable manuals. For example, the line resistance between node 1 and node 2 is 0.05 ohms. This equation set is non-linear (due to node injection current). The Newton-Raphson iterative method is used to solve the problem, with a convergence accuracy of 0.0001. The voltage distribution of all nodes in the network under this power allocation scheme is solved iteratively. After obtaining the voltage of each node, the power loss of the line between any two nodes i and j is calculated. Then, the losses of all lines are summed to obtain the estimated total network loss of the system corresponding to the particle's position vector. This value serves as the first fitness target value. Secondly, for the calculation of the voltage deviation target value, the root mean square deviation of all load node voltages relative to a reference voltage (e.g., 400V) is calculated using the node voltages obtained from power flow calculations. ,in The number of load nodes serves as the second fitness target value. Finally, for the calculation of the energy storage lifetime target value, the power value of the energy storage unit is directly extracted from the particle position vector. Divide the result by the product of the energy storage unit's rated capacity (e.g., 50 amp-hours) and rated voltage (e.g., 400 V) to obtain the absolute value of the charge / discharge rate. This value serves as the third fitness target value. The three target values of all particles are combined to generate an N×3 dimensional multi-objective fitness numerical matrix, where N is the number of particles.
[0028] The dynamic parameter adjustment submodule adaptively adjusts key parameters in the particle swarm optimization algorithm based on the multi-objective fitness matrix obtained in the previous step and the latest real-time system state vector. The core of this process is establishing a mapping relationship from the real-time system state to the algorithm parameters, specifically implemented using a piecewise linear function. First, the absolute value of the instantaneous rate of change of the DC bus voltage is extracted from the real-time system state vector. The absolute value of power imbalance As input, two threshold levels are then set to classify the system's operating state. These thresholds are based on historical operating data analysis and expert experience. For example, the voltage change rate threshold is set as follows: low fluctuation zone (less than 0.5% of the rated voltage per second, i.e., 2V / s), medium fluctuation zone (2V / s to 5V / s), and high fluctuation zone (greater than 5V / s). The power imbalance threshold is set as follows: low imbalance zone (less than 1% of the system's rated power, e.g., 100W for a 10kW system), medium imbalance zone (100W to 500W), and high imbalance zone (greater than 500W). Then, based on the regions where these two indicators fall, the inertia weight is determined using a piecewise linear function. and learning factors and The value of inertia weight The adjustment rule is as follows: when the system is in a state of low fluctuation and low imbalance, set... smaller value When the system is in a state of high fluctuation or high imbalance, set Larger value In the intermediate state, a comprehensive deviation index is defined. ,but The calculation formula is Learning factor (Cognitive part) and The regulation rule for the (social component) is: when the system is stable, particles are encouraged to explore individually, and the following settings are implemented. Larger and Smaller, for example When the system experiences drastic fluctuations, to promote rapid convergence of particles towards the global optimum, the following settings are implemented. Smaller and Larger, for example Similarly, using the comprehensive deviation index Perform linear interpolation calculations. as well as The final calculated , and Pack the three values together to obtain the adaptive iterative parameter set.
[0029] The particle swarm update and filtering submodule executes the iterative evolution process of the particle swarm based on the state of the previous generation and the adaptive iterative parameter set obtained in the previous step. First, for each particle in the particle swarm, the updated inertia weights are used... and learning factors , To update its velocity and position vectors, the velocity vector update follows the formula: It is used to adaptively adjust the optimization parameters according to the system fluctuation state, where... It is the new velocity vector of particle i. This is the current speed. It is the best position in the individual history of this particle. It is the globally optimal position selected from external archives. This is the current location. and Given two independently generated random numbers within the interval [0,1], the position vector update is as follows: After the update, for the new position vector Boundary checks are performed to ensure that the values of each dimension are within the upper and lower limits of the power of the corresponding port. If they exceed the limits, they are set as boundary values. Then, the fitness values of all updated particles under the three objective functions are recalculated. Next, the non-dominated sorting method is used to filter the updated particle population. This process merges the newly generated particle population with the solutions in an external archive with a preset capacity (e.g., 50). The dominance relationship is compared on this merged set. The condition for a solution A to dominate a solution B is that A is not inferior to B on all objectives and is superior to B on at least one objective. By repeatedly searching for all non-dominated solutions in the set, they are layered into different non-dominated fronts. All solutions of the first layer of non-dominated fronts (i.e., Pareto optimal solutions) are stored in a new external archive. If the number of solutions in the first layer exceeds the archive capacity, the crowding distance sorting method is used to prioritize retaining solutions distributed in sparser regions of the solution space and removing solutions in crowded regions to maintain the diversity of solutions. After a complete round of updates and filtering, the set of non-dominated solutions stored in the external archive is the Pareto optimal power instruction set for the current iteration.
[0030] The power command decision module includes: Run the weight matching submodule, match the category of the current system operating condition with the preset weight coefficient lookup table according to the Pareto optimal power instruction set, retrieve and output the corresponding weight value, and obtain the weight coefficient of the current operating condition. The comprehensive performance evaluation submodule, based on the Pareto optimal power command set and the current operating condition weight coefficient, performs a weighted summation of the three objective function values for each non-dominated solution in the set, transforming the multi-objective evaluation problem into a single-objective evaluation problem, and obtaining a list of comprehensive evaluation values for the command solutions; The optimal instruction selection submodule, based on the instruction decomposition and comprehensive evaluation value list, compares the magnitude of all evaluation values in the list, selects the power allocation scheme corresponding to the evaluation value with the best value, and generates the selected port power scheduling instruction.
[0031] Specifically, the weight matching submodule dynamically matches decision weights based on the obtained Pareto optimal power instruction set and the judgment of the current system operating condition. This process first requires a preset weight coefficient lookup table. This table is established by the system designers through offline simulation and expert systems according to different operational objective priorities. The table defines various typical system operating conditions and their corresponding weight coefficient sets. The criteria for classifying operating conditions include: grid connection status (grid-connected / islanded), load level (heavy load / light load), renewable energy output status (high output / low output), and energy storage unit state of charge (high SOC / low SOC). For example, the lookup table may contain the following entry: 'Operating Condition A: Grid-connected, heavy load, high photovoltaic output, normal SOC', whose objective is economic optimization, and the corresponding weight coefficient set is { =0.6, =0.2, =0.2}, 'Operating Condition B: Islanding, Heavy Load, Low PV Output, Low SOC', its objective is optimal power supply reliability, and the corresponding weight coefficient set is { =0.1, =0.7, =0.2}, and then, monitor the system status parameters in real time. For example, determine whether it is grid-connected or islanded by reading the status of the grid interface circuit breaker, compare the load current value with the rated load current (e.g., 70% greater than the rated value indicates heavy load), compare the photovoltaic output power with the rated power (e.g., 80% greater than the rated value indicates high output), and use the SOC value reported by the BMS (e.g., less than 30% indicates low SOC). Using this real-time data, a simple logic rule engine matches the current system operating status to the closest operating condition category in the lookup table. For example, if the system is currently detected to be in an islanded state, the load current is 85% of the rated value, the photovoltaic output is 20% of the rated value, and the SOC is 25%, then the current operating condition is determined to be 'Operating Condition B'. Finally, retrieve the weight coefficient set {0.1, 0.7, 0.2} corresponding to 'Operating Condition B' from the lookup table and output it to obtain the current operating condition weight coefficient.
[0032] The comprehensive performance evaluation submodule quantifies and evaluates each non-dominated solution in the Pareto optimal power instruction set based on the matched current operating condition weight coefficients, transforming the multi-objective optimization problem into a single-objective decision problem. Firstly, due to the three objective functions (system network loss...)... Voltage deviation Energy storage charge / discharge rate The dimensions and numerical ranges of the objective functions are different, and directly performing a weighted summation will lead to unclear physical meaning and results biased towards the objective function with a larger numerical range. Therefore, it is necessary to normalize each objective function value, traverse all solutions in the Pareto optimal power instruction set, and find the maximum value of each objective function in the current non-dominated solution set. and minimum value Then, for each solution i, the j-th objective function value Perform min-max normalization, the calculation formula is as follows: After this processing, all objective function values are mapped to the interval [0, 1]. Next, using the current working condition weight coefficients obtained in the previous step... , , For each non-dominated solution i, the three normalized objective function values are weighted and summed to calculate its comprehensive evaluation value. The calculation formula is: ,in , , These are the normalized network loss, voltage deviation, and energy storage ratio target values for solution i. This calculation process is repeated for each solution in the Pareto optimal power command set, ultimately resulting in a list that corresponds one-to-one with the non-dominated solutions. This list contains the comprehensive evaluation value of each solution, i.e., the comprehensive evaluation value list of command solutions.
[0033] The optimal instruction selection submodule executes the final decision-making process based on the comprehensive evaluation value list of instruction solutions generated in the previous step. Since all three objective functions (system network loss, voltage deviation, and energy storage charge / discharge rate) are defined as minimization objectives during the fitness evaluation phase, and this optimization direction is maintained during the normalization and weighted summation processes in the comprehensive performance evaluation, solutions with smaller comprehensive evaluation values represent better overall performance under the current operating conditions. The selection process is very straightforward: it iterates through the entire comprehensive evaluation value list of instruction solutions, finding and recording the minimum value in the list through iterative comparison operations. For example, if the list is [0.45, 0.21, 0.63, ...], ... If 0.38], then the minimum value is 0.21. At the same time, the index position of the minimum value in the list is recorded. For example, the index of the minimum value is k. This index k corresponds not only to the list of evaluation values, but also to the solution in the original Pareto optimal power instruction set, because the two are in a one-to-one correspondence in order. Then, using this index k, the kth solution is extracted from the Pareto optimal power instruction set. The data structure of this solution contains a complete power allocation scheme, that is, a vector containing the target power values of all controllable ports (such as photovoltaic, energy storage, grid interface). For example, the power allocation scheme corresponding to index k is {P_PV=4.5kW, P_bat=0.5kW, P_grid=-2.5kW}. Finally, this selected power allocation scheme vector is formatted and converted into a communication protocol frame that the underlying controller can recognize (for example, encapsulated into a Modbus or CAN message containing device address, function code and power setting value), and the selected port power scheduling instruction is generated.
Claims
1. A direct current microgrid bidirectional energy router control system, characterized in that, The system comprises: A real-time state perception module, which adopts a voltage sensor and a plurality of current sensors, periodically collects a direct-current bus voltage value, a photovoltaic output current value, a storage unit current value, a load current value and a grid interaction current value, calculates a system power imbalance degree by subtracting the direct-current bus voltage value from a reference voltage value and performing time-domain accumulation, and calculates a charge-discharge rate according to the storage unit current value and a rated capacity value to establish a real-time system state vector; A solution space particle initialization module, which generates a plurality of power distribution schemes as position vectors in a preset upper and lower limit interval of each port power according to the real-time system state vector through a random number generator, matches each group of position vectors with a group of random speed vectors in a preset speed range, combines the position vectors and the speed vectors into a plurality of particles to construct an initial power distribution particle group.
2. The DC microgrid bidirectional energy router control system of claim 1, wherein, The system comprises: An adaptive iterative optimization module, which calculates a direct-current bus voltage deviation integral value, a system loss estimation value and a storage unit charge-discharge rate according to the initial power distribution particle group and the real-time system state vector, inputs a direct-current bus voltage instantaneous change rate and a power imbalance degree into a preset mapping function to obtain a dynamic inertia weight and a learning factor, and updates the speed vector and the position vector of each particle by using the updated weight and learning factor, screens non-dominated solutions and obtains a Pareto optimal power instruction set; A power instruction decision module, which matches a preset weight coefficient set according to a current system operating condition according to the Pareto optimal power instruction set, performs weighted summation on a voltage deviation target value, a loss target value and a storage life target value of each solution in the instruction set by using the weight coefficient set to obtain a comprehensive evaluation value, and selects the solution with the optimal comprehensive evaluation value to generate a selected port power scheduling instruction.
3. The DC microgrid bidirectional energy router control system of claim 1, wherein, The real-time state perception module comprises: A port data acquisition submodule, which adopts a voltage sensor and a plurality of current sensors, converts port analog signals into digital quantities by using an analog-to-digital converter at a preset sampling frequency, time-stamps the continuous digital quantities to form a synchronous data frame including voltage and a plurality of currents, and obtains a plurality of port electrical parameter sets; A key indicator calculation submodule, which calculates a system operating state indicator set by subtracting a reference voltage from a direct-current bus voltage value and performing summation and accumulation within a preset time window, and dividing a storage unit current value by a rated capacity value according to the plurality of port electrical parameter sets; A state vector construction submodule, which arranges the calculated voltage deviation integral value, power imbalance degree and charge-discharge rate in a predetermined order according to the system operating state indicator set, encapsulates them as a structured array, and establishes a real-time system state vector.
4. The DC microgrid bidirectional energy router control system of claim 1, wherein, The solution space particle initialization module comprises: The power scheme generation submodule generates multiple allocation schemes that satisfy power constraints within the preset upper and lower power limits of each port based on the real-time system state vector, and represents each scheme as a multi-dimensional position vector to establish a random power position vector set. The particle velocity initialization submodule generates an equal number of random velocity vectors with dimensions matching the position vectors within a preset velocity upper and lower limit range, based on the random power position vector set and the number of position vectors in the set, thereby constructing a random particle velocity set. The particle swarm structuring submodule pairs the vectors in the random power position vector set and the random particle velocity set according to the index order. Each position vector is combined with a velocity vector to form a particle structure and construct an initial power allocation particle swarm.
5. The DC microgrid bidirectional energy router control system of claim 2, wherein, The adaptive iterative optimization module includes: The particle fitness evaluation submodule, based on the initial power allocation particle swarm and the real-time system state vector, substitutes the position vector of each particle into the power flow equation to calculate the line loss, and directly extracts the voltage deviation and charge / discharge rate as two other target values to generate a multi-target fitness numerical matrix. The dynamic parameter adjustment submodule, based on the multi-objective fitness numerical matrix and the real-time system state vector, maps the instantaneous rate of change of DC bus voltage and power imbalance values to the corresponding inertia weight and learning factor value ranges through a piecewise linear function, obtains the parameters for iterative updates, and obtains the adaptive iterative parameter set.
6. The DC microgrid bidirectional energy router control system of claim 5, wherein, The adaptive iterative optimization module also includes: The particle swarm update and filtering submodule updates the velocity and position based on the adaptive iterative parameter set, combined with the current individual optimal position and global optimal position of each particle. It then uses a non-dominated sorting method to compare the dominance relationships of the updated particles, filters all non-dominated solutions and stores them in an external archive, and obtains the Pareto optimal power instruction set.
7. The DC microgrid bidirectional energy router control system of claim 2, wherein, The power command decision module includes: Run the weight matching submodule, match the category of the current system operating condition with the preset weight coefficient lookup table according to the Pareto optimal power instruction set, retrieve and output the corresponding weight value, and obtain the current operating condition weight coefficient. The comprehensive performance evaluation submodule, based on the Pareto optimal power command set and the current operating condition weight coefficient, performs a weighted summation of the three objective function values for each non-dominated solution in the set, transforming the multi-objective evaluation problem into a single-objective evaluation problem, and obtaining a list of comprehensive evaluation values for the command solutions.
8. The DC microgrid bidirectional energy router control system of claim 7, wherein, The power command decision module also includes: The optimal instruction selection submodule, based on the instruction decomposition comprehensive evaluation value list, selects a power allocation scheme corresponding to the evaluation value with the best value by comparing the magnitude of all evaluation values in the list, and generates a power scheduling instruction for the selected port.
9. The DC microgrid bidirectional energy router control method of claim 1-8, wherein, Includes the following steps: The voltage sensor and the multi-channel current sensor are used to periodically collect the DC bus voltage value, the photovoltaic output current value, the energy storage unit current value, the load current value and the grid interaction current value, the DC bus voltage value is subtracted from the reference voltage value and is accumulated in time domain, the system power imbalance degree is calculated by summing up the multiple port power values, the charge-discharge rate is calculated according to the energy storage unit current value and the rated capacity value, and the real-time system state vector is established; According to the real-time system state vector, a plurality of groups of power distribution schemes are generated as position vectors by a random number generator within the preset upper and lower limit intervals of each port power, a group of random speed vectors within the preset speed range is matched for each group of position vectors, the position vectors and the speed vectors are combined into a plurality of particles to construct an initial power distribution particle group; According to the initial power distribution particle group and the real-time system state vector, the DC bus voltage deviation integral value, the system loss estimation value and the energy storage unit charge-discharge rate are calculated for the position vector of each particle in the group, the DC bus voltage instantaneous change rate and the power imbalance degree are input into a preset mapping function to obtain a dynamic inertia weight and a learning factor, the speed vector and the position vector of each particle are updated by using the updated weight and learning factor, non-dominated solutions are screened, and a Pareto optimal power instruction set is obtained; According to the Pareto optimal power instruction set, a set of preset weight coefficients is matched according to the current system operating condition, the voltage deviation target value, the loss target value and the energy storage life target value of each solution in the instruction set are weighted and summed by using the set of weight coefficients, a comprehensive evaluation value is obtained, and the solution with the optimal comprehensive evaluation value is selected to generate a selected port power scheduling instruction.