Micro-grid operation mode smooth switching method based on consistency algorithm
By employing a smooth switching method for operating modes based on a consensus algorithm in microgrids, and utilizing a secondary controller and a fuzzy proportional-integral controller to generate pulse modulation signals, the switching problem between grid-connected and off-grid modes in microgrids is solved, achieving safe and smooth switching and harmonic elimination, thereby improving the practicality and economy of microgrids.
Patent Information
- Application Number
- CN202511440519.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2026-01-06
AI Technical Summary
Existing microgrids experience significant inrush current and voltage distortion when switching between grid-connected and off-grid operation modes, making smooth switching difficult. Furthermore, the lack of coordinated regulation and control strategies among multiple distributed power sources results in high operating mode switching costs and the generation of harmonics during PWM pulse width modulation.
A smooth switching method for microgrid operation modes based on consensus algorithm is adopted. By adding operation mode switching compensation signal to the consensus algorithm of secondary control agent, and combining fuzzy proportional integral controller and voltage and current loop dual-loop control, pulse modulation signal is generated to control inverter, so as to realize safe and smooth switching of distributed microgrid between off-grid and grid-connected modes.
It enables safe and smooth switching of microgrids between off-grid and grid-connected modes, reduces the cost of switching operating modes, improves the practicality and economy of microgrids, promotes the application of multi-agent consensus algorithms in microgrids, and realizes intelligent operation of microgrids.
Smart Images

Figure CN121282971A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of microgrid control and intelligent agent algorithms, and more specifically, to a method for smooth switching of microgrid operation modes based on a consensus algorithm. Background Technology
[0002] Microgrids, as a flexible and efficient way to integrate distributed renewable energy generation, have attracted widespread attention and have developed rapidly in recent years. Microgrids successfully transform the grid connection problem of large-scale distributed power sources into the grid connection problem of controllable microgrids, thereby reducing the impact of the randomness and volatility of renewable energy on the safe and stable operation of the distribution network. This maximizes the utilization rate of renewable energy and fully promotes the flexible and efficient application of distributed energy and renewable energy.
[0003] Microgrids commonly operate in two modes: grid-connected and off-grid (also known as islanded). Adopting different operating modes for different scenarios is key to the practicality and economic advantages of microgrids. When the main grid experiences a fault or is scheduled for maintenance, the connection between the microgrid and the main grid should be quickly disconnected, and the microgrid should enter islanded operation mode. Once the main grid resumes normal operation, the microgrid needs to reconnect from islanded mode to grid-connected operation mode. Because the switching between grid-connected and off-grid operating modes generates significant inrush current and voltage distortion, it has a substantial impact on the stable operation of the power grid. Therefore, in microgrid operation, adopting a control strategy to ensure a seamless and smooth transition between grid-connected and off-grid modes is crucial for a smooth transition between the two operating modes.
[0004] Microgrids currently mostly employ distributed control, which is autonomous control based entirely on local information and does not rely on communication. While offering high reliability, it struggles to achieve global collaborative optimization. Utilizing computer science and artificial intelligence methods, distributed control based on multi-agent consensus algorithms provides a feasible solution for reliable, collaborative, and autonomous microgrids. Its key features include leveraging communication between distributed power sources to achieve global information sharing, resulting in high reliability and enabling global collaborative management. By adding control signals to the distributed control system, existing distributed power sources can be used to smoothly switch microgrid operating modes without requiring additional power compensators within the microgrid, significantly reducing operating mode switching costs.
[0005] Currently, microgrid operation mode smooth switching control is mostly aimed at achieving power synchronization for a single power source, lacking a smooth switching control strategy for coordinated regulation among multiple distributed power sources, and harmonics are easily generated during PWM pulse width modulation. Summary of the Invention
[0006] To address the problems in related technologies, this invention proposes a method for smooth switching of microgrid operating modes based on a consensus algorithm. To overcome the shortcomings of existing methods, a mode-switching compensation signal is added to the consensus algorithm of the secondary control agent, generating secondary control variables. The primary control, based on droop control, is supplemented with the secondary control variables and virtual impedance before being fed into a voltage-current dual-loop control system. Finally, a pulse modulation signal is generated via PWM to control the inverter. This invention enables safe and smooth switching between off-grid and grid-connected operating modes in distributed microgrids. It is of great significance for improving the practicality and economy of microgrids, promoting the application of multi-agent consensus algorithms in microgrids, realizing intelligent operation of microgrids, and facilitating the friendly integration of distributed energy resources into the future power grid.
[0007] Therefore, the specific technical solution adopted by the present invention is as follows:
[0008] A method for smooth switching of microgrid operation modes based on a consensus algorithm, comprising:
[0009] Based on the microgrid architecture with distributed power sources, calculate the active and reactive power on each bus; and establish a communication network between distributed power sources based on graph theory.
[0010] Based on the communication network between distributed power sources, and combining the active and reactive power on each bus, a secondary controller is established; based on the secondary controller, and with the addition of the compensation signal output by the fuzzy proportional-integral controller, the secondary controller is adjusted; and the secondary control variable is output through the secondary controller.
[0011] Based on droop control and by adding secondary control variables, a primary controller is obtained; based on the output voltage signal of the primary controller and the voltage-current loop dual-loop control mechanism, the voltage control signal of the voltage-current loop is generated.
[0012] Based on optimization technology and selective harmonic cancellation pulse width modulation technology, the voltage control signal is converted into a pulse modulation signal to control the output power of the distributed power source;
[0013] The secondary control system obtains information about neighboring nodes through a distributed communication structure and provides power regulation signals through a consensus algorithm.
[0014] Furthermore, based on the microgrid architecture with distributed power sources, the calculation of active and reactive power on each bus includes:
[0015] Distributed power sources are installed on each bus of the microgrid;
[0016] Calculate the first action term between a certain distributed power source and the selected distributed power source, and multiply the first action term by the sine value of the phase difference to obtain the first product value. Add all the first product values to obtain the active power on each bus.
[0017] For the selected distributed power source, calculate the ratio of the square of the voltage amplitude to the line impedance; calculate the second action term between a certain distributed power source and the selected distributed power source, and multiply the second action term by the cosine of the phase difference to obtain the second product value. After adding all the second product values, subtract the ratio of the square of the voltage amplitude to the line impedance to obtain the reactive power on each bus.
[0018] Furthermore, when calculating the active and reactive power on each bus, if measurement data cannot be obtained for a certain bus, the active and reactive power output of the bus is determined by the weighted minimum absolute value of the measured value and the value determined by the measurement function.
[0019] Furthermore, based on graph theory techniques, establishing a communication network between distributed power sources includes:
[0020] Each distributed power source is treated as a node in an undirected connected graph, and the edges between nodes are determined based on the communication connections between adjacent distributed power sources.
[0021] Establish a communication network between distributed power sources using an undirected connected graph.
[0022] Furthermore, based on the communication network between distributed power sources, and combining the active and reactive power on each bus, a secondary controller is established, including:
[0023] Determine the communication connection value based on the communication network between distributed power sources;
[0024] Calculate the first difference between the measurement frequency of the selected distributed power source and the grid frequency, and the second difference between the selected distributed power source and the secondary active power control variable of a certain distributed power source.
[0025] Based on the communication connection value, the first difference, the second difference, and the operation symbol, the first summation part is calculated; the result of multiplying the first summation part by the positive gain of the controller is equal to the rate of change of the primary active power control variable of the selected distributed power source over time, thus obtaining the power controller used for frequency regulation and active power sharing.
[0026] The third difference is calculated based on the selected distributed power source and the reactive power and rated reactive power of a certain distributed power source; the fourth difference is calculated based on the voltage regulation gain, the measured voltage of the selected distributed power source, and the rated voltage amplitude.
[0027] The second summation part is calculated based on the communication connection value, the third difference, the fourth difference, and the operation symbol. The result of multiplying the second summation part by the positive gain of the voltage secondary controller is equal to the rate of change of the selected distributed power source's voltage secondary control variable over time, thus obtaining a power controller for voltage regulation and reactive power sharing.
[0028] Furthermore, based on the secondary controller and supplemented by the compensation signal output from the fuzzy proportional-integral controller, the adjustment of the secondary controller includes:
[0029] By using a fuzzy algorithm to update the proportional and integral parameters of the proportional-integral controller in real time, a fuzzy proportional-integral controller is obtained.
[0030] The difference between the microgrid phase and the grid connection point phase, as well as the difference between the microgrid voltage amplitude and the grid connection point phase, are input into the fuzzy proportional-integral controller to obtain the compensation signal for the active power required to undertake the switching of operating modes and the compensation signal for the reactive power required to undertake the switching of operating modes.
[0031] By adding a compensation signal to the power controller used for frequency regulation and active power sharing, which is used to bear the active power required for operating mode switching, an adjusted power controller for frequency regulation and active power sharing is obtained.
[0032] By adding a compensation signal to the power controller used for voltage regulation and reactive power sharing to handle the reactive power required for operating mode switching, an adjusted power controller for voltage regulation and reactive power sharing is obtained.
[0033] Furthermore, the fuzzy proportional-integral controller includes:
[0034] The difference between the microgrid phase and the grid connection point phase, or the difference between the microgrid voltage amplitude and the grid connection point phase, is used as the first input variable of the fuzzy proportional-integral controller.
[0035] The rate of change of phase difference or the rate of change of voltage amplitude difference is used as the second input variable of the fuzzy proportional-integral controller.
[0036] The adjustment amounts of the proportional and integral parameters of the fuzzy proportional-integral controller are used as output variables;
[0037] Configure the basic domain and linguistic domain of the first input variable; configure the linguistic domain of the second input variable; configure the linguistic domain of the output variable.
[0038] Configure the relationship between the number of elements in the domain of the linguistic variables and the multiples of the linguistic value elements in the fuzzy subset of the linguistic variables, the linguistic values, the fuzzy subsets of the first and second input variables, and the fuzzy subset of the output variables;
[0039] Configure the membership functions of the first input variable, the second input variable, and the output variable, and set control rules for the membership functions.
[0040] Furthermore, based on the output voltage signal of the primary controller and the voltage-current loop dual-loop control mechanism, the voltage control signals for the voltage-current loop are generated as follows:
[0041] The voltage signal in the direct-axis quadrature-axis coordinate system is transformed to generate a reference voltage in the three-phase stationary coordinate system.
[0042] A virtual impedance control is added to the reference voltage to counteract the effects of line impedance and generate a new reference voltage.
[0043] The new reference voltage is input into the voltage and current loop dual-loop control mechanism to update the voltage and current values in real time and output a voltage control signal.
[0044] Furthermore, based on optimization techniques and selective harmonic cancellation pulse width modulation techniques, the voltage control signal is converted into a pulse modulation signal to control the output power of the distributed power source, including:
[0045] After the voltage control signal is processed by selective harmonic elimination pulse width modulation, a pulse modulation signal is obtained and input into the inverter, which controls the output power of the distributed power source.
[0046] Construct a set of harmonic elimination equations; based on the principle of unifying the minimum multi-objective problem into a single-objective problem, transform the set of harmonic elimination equations and obtain several objective variables;
[0047] Construct an objective function based on the objective variable and determine the switching angle constraint conditions; solve the objective function and satisfy the switching angle constraint conditions using the Grey Wolf optimization algorithm to obtain the solution set, which is used to eliminate harmonics.
[0048] Furthermore, the objective function and the switching angle constraint conditions include:
[0049] ;
[0050] ;
[0051] In the formula, These are different target variables; These represent different switching angles, and Q is the objective function.
[0052] The beneficial effects of this invention are as follows:
[0053] This invention adds a mode-switching compensation signal to the secondary control agent consensus algorithm to generate secondary control variables. The primary control, based on droop control, adds the secondary control variables and virtual impedance before being fed into a voltage-current dual-loop control system, ultimately controlling the inverter via a PWM-generated pulse modulation signal. This invention enables safe and smooth switching between off-grid and grid-connected operating modes in distributed microgrids, which is of great significance for improving the practicality and economy of microgrids, promoting the application of multi-agent consensus algorithms in microgrids, realizing intelligent operation of microgrids, and facilitating the friendly integration of distributed energy resources into the future power grid. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a flowchart illustrating a specific use according to an embodiment of the present invention;
[0056] Figure 2 This is a flowchart of the compensation signal generation process according to an embodiment of the present invention;
[0057] Figure 3 This is a control strategy structure diagram according to an embodiment of the present invention;
[0058] Figure 4 This is a schematic diagram of the phase difference from the simulation results according to an embodiment of the present invention;
[0059] Figure 5 This is a schematic diagram of the voltage amplitude difference based on the simulation results of an embodiment of the present invention;
[0060] Figure 6 This is a flowchart of a method for smooth switching of microgrid operation modes based on a consensus algorithm according to an embodiment of the present invention. Detailed Implementation
[0061] To further illustrate the various embodiments, the present invention provides accompanying drawings, which are part of the disclosure of the present invention. These drawings are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementation methods and the advantages of the present invention. The components in the drawings are not drawn to scale, and similar component symbols are generally used to represent similar components.
[0062] According to an embodiment of the present invention, a method for smooth switching of microgrid operation modes based on a consensus algorithm is provided, which realizes safe and smooth switching of distributed microgrids between off-grid and grid-connected operation modes, while eliminating pulse width modulation harmonics and improving control performance.
[0063] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figure 6 As shown, the microgrid operation mode smooth switching method based on consensus algorithm according to an embodiment of the present invention includes:
[0064] S1. Based on the microgrid architecture with distributed power sources, calculate the active and reactive power on each bus; establish a communication network between distributed power sources based on graph theory.
[0065] S2. Based on the communication network between distributed power sources, and combining the active and reactive power on each bus, establish a secondary controller; based on the secondary controller, and with the compensation signal output by the fuzzy proportional-integral controller, adjust the secondary controller; output the secondary control variable through the secondary controller.
[0066] S3. Based on droop control and adding secondary control variables, a primary controller is obtained; based on the output voltage signal of the primary controller and the voltage-current loop dual-loop control mechanism, the voltage control signal of the voltage-current loop is generated.
[0067] S4. Based on optimization technology and selective harmonic cancellation pulse width modulation technology, the voltage control signal is converted into a pulse modulation signal to control the output power of the distributed power source;
[0068] The secondary control system obtains information about neighboring nodes through a distributed communication structure and provides power regulation signals through a consensus algorithm.
[0069] In one embodiment, calculating the active and reactive power on each bus, based on a microgrid architecture with distributed power sources, includes:
[0070] Distributed power sources are installed on each bus of the microgrid. The first action term between a certain distributed power source and a selected distributed power source is calculated, and the first action term is multiplied by the sine value of the phase difference to obtain the first product value. All first product values are added together to obtain the active power on each bus. For the selected distributed power source, the ratio of the square of the voltage amplitude to the line impedance is calculated. The second action term between a certain distributed power source and the selected distributed power source is calculated, and the second action term is multiplied by the cosine value of the phase difference to obtain the second product value. All second product values are added together, and the difference is taken from the ratio of the square of the voltage amplitude to the line impedance to obtain the reactive power on each bus.
[0071] In one embodiment, when calculating the active and reactive power on each bus, if measurement data cannot be obtained for a certain bus, the active and reactive power output of the bus is determined by the weighted minimum absolute value of the measured value and the value determined by the measurement function.
[0072] In one embodiment, establishing a communication network between distributed power sources based on graph theory includes:
[0073] Each distributed power source is treated as a node in an undirected connected graph, and the edges between nodes are determined based on the communication connections between adjacent distributed power sources; a communication network between distributed power sources is established using the undirected connected graph.
[0074] In one embodiment, a secondary controller is established based on the communication network between distributed power sources, combining the active and reactive power on each bus, including:
[0075] Based on the communication network between distributed power sources, determine the communication connection value; calculate the first difference between the measured frequency of the selected distributed power source and the grid frequency, and the second difference between the selected distributed power source and the secondary active power control variable of a certain distributed power source; calculate the first summation part based on the communication connection value, the first difference, the second difference, and the operation symbol; multiply the first summation part by the positive gain of the controller, and make the result equal to the rate of change of the primary active power control variable of the selected distributed power source over time, to obtain the power controller for frequency regulation and active power sharing; calculate the third difference based on the reactive power and rated reactive power of the selected distributed power source and a certain distributed power source; calculate the fourth difference based on the voltage regulation gain, the measured voltage of the selected distributed power source, and the rated voltage amplitude; calculate the second summation part based on the communication connection value, the third difference, the fourth difference, and the operation symbol; multiply the second summation part by the positive gain of the voltage secondary controller, and make the result equal to the rate of change of the voltage secondary control variable of the selected distributed power source over time, to obtain the power controller for voltage regulation and reactive power sharing.
[0076] In one embodiment, adjusting the secondary controller based on the secondary controller, and with the addition of a compensation signal output from the fuzzy proportional-integral controller, includes:
[0077] A fuzzy proportional-integral controller (PIC) is obtained by updating its proportional and integral parameters in real time using a fuzzy algorithm. The differences between the microgrid phase and the grid connection point phase, as well as the differences between the microgrid voltage amplitude and the grid connection point phase, are input into the fuzzy PIC to obtain compensation signals for the active power and reactive power required for operating mode switching. These compensation signals are then added to the power controller used for frequency regulation and active power sharing to obtain an adjusted power controller for both. Similarly, the same compensation signals are added to the power controller used for voltage regulation and reactive power sharing to obtain an adjusted power controller for both.
[0078] In one embodiment, the fuzzy proportional-integral controller includes:
[0079] The difference between the microgrid phase and the grid connection point phase, or the difference between the microgrid voltage amplitude and the grid connection point phase, is used as the first input variable of the fuzzy proportional-integral controller; the rate of change of the phase difference or the rate of change of the voltage amplitude difference is used as the second input variable of the fuzzy proportional-integral controller; the adjustment amounts of the proportional and integral parameters of the fuzzy proportional-integral controller are used as output variables; the basic universe of discourse and the linguistic variable universe of discourse of the first input variable are configured; the linguistic variable universe of discourse of the second input variable is configured; the linguistic variable universe of discourse of the output variable is configured; the number of elements in the linguistic variable universe of discourse and the multiple relationship between the linguistic value elements in the fuzzy subset of the linguistic variable, the linguistic value, the fuzzy subsets of the first and second input variables, and the fuzzy subset of the output variable are configured; the membership functions of the first input variable, the second input variable, and the output variable are configured, and control rules are set for the membership functions.
[0080] In one embodiment, the voltage control signal for the voltage and current loop is generated based on the output voltage signal of the primary controller and the voltage-current loop dual-loop control mechanism, including:
[0081] The voltage signal in the direct-axis and quadrature-axis coordinate system is transformed to generate a reference voltage in the three-phase stationary coordinate system. A virtual impedance control is added to the reference voltage to offset the influence of line impedance and generate a new reference voltage. The new reference voltage is input into the voltage and current loop dual-loop control mechanism to update the voltage and current values in real time and output a voltage control signal.
[0082] In one embodiment, converting a voltage control signal into a pulse-modulated signal to control the output power of a distributed power source, based on optimization techniques and selective harmonic cancellation pulse width modulation techniques, includes:
[0083] The voltage control signal is processed by selective harmonic elimination pulse width modulation to obtain a pulse modulated signal, which is then input into the inverter. The inverter controls the output power of the distributed power source. A set of harmonic elimination equations is constructed. Based on the principle of unifying the multi-objective problem into a single-objective problem, the set of harmonic elimination equations is transformed to obtain several objective variables. An objective function is constructed based on the objective variables, and the switching angle constraint conditions are determined. The objective function is solved using the Grey Wolf optimization algorithm, satisfying the switching angle constraint conditions, to obtain a solution set, which is used to eliminate harmonics.
[0084] In one embodiment, the objective function and switching angle constraints include:
[0085] ;
[0086] ;
[0087] In the formula, These are different target variables; These represent different switching angles, and Q is the objective function.
[0088] To facilitate understanding of the above technical solutions of the present invention, the working principle of the present invention in actual process will be described in detail below.
[0089] The present invention includes the following steps: (1) Design a microgrid architecture applicable to the present invention. Each bus of the microgrid is equipped with a distributed generation (DG) or load. There are n buses in total. Calculate the active power and reactive power injected on each bus using voltage, impedance, and power factor. If some bus data cannot be measured, estimate the active and reactive power injected on the bus using the weighted minimum absolute value method. Establish a communication connection matrix using an undirected graph based on the communication network connection situation between DGs. (2) Establish a secondary controller based on the communication network. Input the power and secondary control variables of each bus at each moment into the frequency / voltage secondary controller. Integrate the output value and send it as a secondary control variable to the primary controller. (3) Select a power source as the regulating power source. On the basis of the power controller that shares active and reactive power, add a power controller that undertakes the operation mode. (4) The compensation signal is obtained by sending the phase difference and voltage amplitude difference between the microgrid and the grid connection point to the output of the fuzzy PI controller. The PI controller is used to track the phase and voltage amplitude. The fuzzy algorithm is used to update the proportional and integral parameters of the PI controller in real time. (5) The basic principle of the frequency / voltage primary controller is frequency / voltage droop control. On the basis of droop control, frequency / voltage secondary control variables are added respectively. The reference voltage is output by the reference voltage generator. After adding virtual impedance, it is sent to the voltage and current dual-loop control. The control signal is then generated by selective harmonic elimination pulse width modulation (SHE-PWM) based on the gray wolf optimization algorithm to eliminate the 5th and 7th harmonics that are more harmful to the system. The pulse modulation signal is sent to the inverter to control the output power of the DG.
[0090] like Figure 1 As shown, the specific steps include:
[0091] Step (1):
[0092] 1) Design a microgrid architecture suitable for this invention. Each bus in the microgrid has a distributed generation (DG) or load. There are n buses in total. Each DG consists of a DC power supply, an inverter, and a filter [inductor-capacitor-inductor (LCL)]. Assume the reactance of the i-th DG is X. ij If the line is connected to the j-th DG, then the active power P i and reactive power Q i for:
[0093] ;
[0094] ;
[0095] In the formula, E i and E j These are the voltage amplitudes of the i-th DG and the j-th DG, respectively; Let be the line impedance of the i-th DG. ; and These represent the phases of the i-th and j-th DGs, respectively; n is the number of buses.
[0096] 2) If a bus cannot obtain measurement data due to a fault, the weighted minimum absolute value method is used to estimate the active and reactive power output of that bus. The measurement equation for system state estimation is:
[0097] ;
[0098] In the formula: z i h is the measurement vector. i (x) is the measurement function vector; r i Let be the residual vector; x be the state variable vector. The unmeasurable active and reactive power of the bus are determined by the weighted minimum absolute value of the measured values and the values determined by the measurement function. The objective function is as follows:
[0099] ; In the formula: c i Let be the weight coefficient vector of the i-th DG. Let be the measurement error variance of the i-th DG.
[0100] 3) The communication network between DGs is proposed using graph theory and modeled using undirected graphs. First, let's define the notation. Suppose a set of real numbers is generated by... express, Represent a set , Represent a set .
[0101] 4) Represents an undirected connected graph. ,in Represents a set of nodes, i.e. , F represents an undirected connected graph. The edge set, i.e. Each node is a distributed power source.
[0102] 5) Matrix Representation diagram The adjacency matrix of DG is such that DG is a matrix of adjacency if and only if ... DG, which is adjacent to it When there are edges, elements , This indicates whether there is a communication connection between DGi and DGj, and vice versa; otherwise... .
[0103] 6) The degree of the i-th DG is defined as follows: ,in ,picture Laplace matrix Defined as ,in, .
[0104] 7) There exists a path called an edge between DGi and its respective neighbor DGj. If a path exists from node i to node j, the graph is considered connected. If G is connected, then... It is a positive semi-finite matrix with zero eigenvalues.
[0105] Step (2):
[0106] 1) Secondary control uses a distributed communication structure to obtain neighboring node information and a consensus algorithm to provide power regulation signals, achieving frequency / voltage recovery and ensuring the power allocation characteristics of primary control. Define u as the secondary frequency control variable. The power controller used for frequency regulation and active power sharing is as follows:
[0107] ;
[0108] In the formula, and Let ω be the secondary active power control variable for the i-th DG and the j-th DG, respectively; i Let ω be the measurement frequency of the i-th DG (i=1,2,…,n); ref K represents the power grid frequency. f The positive gain of the controller; the adjacency matrix for frequency adjustment is represented as A={a ij If there is a communication connection between the i-th DG and the j-th DG, then a ij =1, otherwise a ij =0; t is time.
[0109] 2) Define v i The power controller used for voltage regulation and reactive power sharing, with voltage as the secondary control variable, is as follows:
[0110] ;
[0111] In the formula, and These are the reactive power of the i-th DG and the j-th DG, respectively; and These are the rated reactive power of the i-th DG and the j-th DG, respectively; This is the rated voltage amplitude; It is the measured voltage of the i-th DG (i=1,2,…,n). For the positive gain of the voltage secondary controller, For voltage regulation gain, if there is a communication connection between the i-th DG and the j-th DG, then ,on the contrary , To represent the connection state between DGi and DGj, an adjacency matrix is proposed for simplicity to avoid additional communication channels. .
[0112] Step (3):
[0113] 1) To eliminate frequency and phase angle mismatch between the microgrid and the grid connection point, and to ensure accurate power sharing, a specific power source is selected as the regulating power source. A compensation signal is added to the power controller that regulates the frequency and shares active power to handle the active power required for switching operating modes. The adjusted controller is as follows:
[0114] In the formula, To compensate for signal gain.
[0115] 2) To eliminate voltage amplitude mismatch between the microgrid and the grid connection point, and to ensure accurate power sharing, a compensation signal for reactive power required for switching operating modes is added to the power controller that regulates voltage and shares reactive power with the selected power source. The adjusted controller is as follows:
[0116] In the formula, To compensate for signal gain.
[0117] Step (4):
[0118] 1) Compensation signal or It is the phase of the microgrid Phase with grid connection point difference or microgrid voltage amplitude Phase with grid connection point difference The output of the fuzzy PI controller is used to track the phase and voltage amplitude, and the fuzzy algorithm is used to update the proportional parameters of the PI controller in real time. and integral parameters To improve tracking performance, the compensation signal generation process is described in [link to documentation]. Figure 2 P is the proportional parameter, and I is the integral parameter.
[0119] 2) Select the input variables for the fuzzy controller: Select the microgrid phase. Phase with grid connection point difference or microgrid voltage amplitude Phase with grid connection point difference E is chosen as the rate of change of the phase difference. or rate of change of voltage amplitude difference EC is another input quantity.
[0120] 3) Select the output variables of the fuzzy controller; select the adjustment amounts of the proportional and integral parameters of the PI controller. and As an output variable:
[0121] ;
[0122] In the formula, and These are the proportional and integral parameters for the next time step, respectively.
[0123] 4) Set the basic universe of discourse of the input variable E of the fuzzy controller to [-10, 10], and the universe of discourse of the linguistic variable to X, and quantize it into 9 levels:
[0124] .
[0125] 5) Represent the domain of the linguistic variable EC as Y, and quantify it into 9 levels:
[0126] .
[0127] 6) Output variables and The domains of the linguistic variables are denoted by S and T, and the quantization has nine levels:
[0128] ;
[0129] .
[0130] 7) For better control, the number of elements in the domain of the linguistic variables should be twice the number of linguistic value elements in the fuzzy subset of the linguistic variables. Five linguistic values are selected: "overly negative," "negative," "zero," "positive," and "overly positive." The fuzzy subsets of the two input linguistic variables are represented as follows:
[0131] .
[0132] 8) Represent the fuzzy subsets of the two output linguistic variables as follows:
[0133] .
[0134] 9) Considering the small range of input variation for the fuzzy controller, a triangular membership function is chosen for the input variables, as it has relatively high sensitivity. The output membership functions are all triangular in the middle and Gaussian at both ends, which not only provides high sensitivity but also results in smoother output at the boundaries, exhibiting good stability.
[0135] 10) After determining the membership function, set control rules for the membership function, that is, to obtain the output linguistic variables corresponding to different input linguistic variables. , The control rules are shown in Tables 1 and 2 below.
[0136] Table 1 Output Language Variables Control rule table EEC NB NS ZE PS PB NB PB PS PS NS ZE NS PB PS PS ZE PS ZE PS NS ZE ZE PS PS PS ZE NS ZE PB PB ZE NS NS ZE PB
[0137] Table 2 Output Language Variables Control rule table EEC NB NS ZE PS PB NB NB NS NS ZE ZE NS NS NS NS ZE ZE ZE NS NS ZE PS PS PS NS ZE PS PS PS PB ZE PS PS PS PB
[0138] Step (5):
[0139] 1) Primary control is based on non-communication droop control, which uses local frequency / voltage information to achieve a reasonable distribution of active and reactive power between the distributed generation (DG) to maintain microgrid frequency / voltage stability. The basic principle of the primary frequency / voltage controller is frequency / voltage droop control. By adding secondary frequency / voltage control variables to the droop control, the primary frequency / voltage controller is as follows:
[0140] ;
[0141] ;
[0142] In the formula, and These are the active and reactive droop coefficients of the i-th DG, respectively.
[0143] 2) The primary control output voltage signal in the dq coordinate system is transformed to generate the reference voltage u in the abc coordinate system. abc d is the direct axis, and q is the quadrature axis. The abc coordinate system is a three-phase stationary coordinate system.
[0144] 3) Apply reference voltage u abc Additional virtual impedance control is used to counteract the effects of line impedance and generate a new reference voltage u. abc '.
[0145] 4) Set the new reference voltage u abc The voltage and current values are updated in real time through a dual-loop control system.
[0146] 5) The voltage control signal passing through the voltage-current loop is converted into a pulse modulation signal by selective harmonic elimination pulse width modulation (SHE-PWM) based on the gray wolf optimization algorithm and sent to the inverter. The pulse modulation signal is then fed into the inverter to control the output power of the DG. To eliminate the harmful effects of harmonics on the system, mainly the 5th, 7th, 11th, and 13th harmonics, a set of harmonic elimination equations is constructed:
[0147] ;
[0148] In the formula: M is the modulation ratio, set to 0.8; These represent different switching angles.
[0149] To unify the minimum multi-objective problem into a single single-objective problem, the above equation is transformed into:
[0150] ;
[0151] In the formula: For different target variables.
[0152] The objective function is: .
[0153] The constraints are: .
[0154] By solving the above objective function using the Grey Wolf optimization algorithm and satisfying the constraints, a suitable solution set can be obtained. The complete control strategy structure of this invention is as follows: Figure 3 As shown. Figure 3 In the middle, V DC For distributed generation voltage, Z is the line impedance, L is the load, PCC is the grid connection point, UG is the main power grid, and E is the load. PCC δ is the voltage amplitude at the grid connection point. PCC For the grid connection point voltage phase, E g δ represents the voltage amplitude of the microgrid. g This represents the voltage phase of the microgrid.
[0155] Taking a 4-node microgrid as an example, there is a communication network connection between adjacent power sources. DG1 acts as a regulating power source, and the operating mode switching starts at t=1 second to test the controller performance.
[0156] Simulation results are as follows Figure 4 , Figure 5 As shown, the synchronization standard is quickly reached, and the voltage phase difference and amplitude difference gradually decrease to zero, realizing a smooth transition from off-grid mode to grid-connected mode.
[0157] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for smooth switching of microgrid operation mode based on consensus algorithm, characterized in that, The method comprises the following steps: According to the micro-grid architecture with distributed power supply, the active power and the reactive power on each bus are calculated; Based on the graph theory technology, a communication network between the distributed power supplies is established; According to the communication network between the distributed power supplies, a secondary controller is established in combination with the active power and the reactive power on each bus; Based on the secondary controller, the secondary controller is adjusted by adding a compensation signal output by a fuzzy proportional integral controller; and a secondary control variable is output by the secondary controller; Based on the droop control and the secondary control variable, a primary controller is obtained; and according to the output voltage signal of the primary controller and the voltage-current loop double-loop control mechanism, a voltage control signal of the voltage-current loop is generated; Based on the optimization technology and the selective harmonic elimination pulse width modulation technology, the voltage control signal is converted into a pulse modulation signal to control the output power of the distributed power supply; The secondary control obtains the node information of the neighbors through the distributed communication structure, and provides the power adjustment signal through the consistency algorithm. 2.The microgrid operation mode smooth switching method based on consensus algorithm of claim 1, wherein, The micro-grid architecture with distributed power supply is used to calculate the active power and the reactive power on each bus, which comprises the following steps: Distributed power supplies are arranged on each bus of the micro-grid; A first action item between a certain distributed power supply and a selected distributed power supply is calculated, and a first product value is obtained by multiplying the first action item with the sine value of the phase difference; all the first product values are added to obtain the active power on each bus; For the selected distributed power supply, the ratio of the square of the voltage amplitude to the line impedance is calculated; a second action item between a certain distributed power supply and the selected distributed power supply is calculated, and a second product value is obtained by multiplying the second action item with the cosine value of the phase difference; after all the second product values are added, the difference between the ratio of the square of the voltage amplitude to the line impedance and the sum is obtained to obtain the reactive power on each bus. 3.The microgrid operation mode smooth switching method based on consensus algorithm of claim 2, wherein, When calculating the active power and the reactive power on each bus, if a certain bus cannot obtain the measurement data, the active power and the reactive power output by the bus are determined according to the weighted least absolute value of the measurement value and the measurement function determined value. 4.The microgrid operation mode smooth switching method based on consensus algorithm of claim 1, wherein, The communication network between the distributed power supplies is established based on the graph theory technology, which comprises the following steps: Each distributed power supply is regarded as a node in the undirected connected graph, and the edges between the nodes are determined according to the communication connection between the adjacent distributed power supplies; The communication network between the distributed power supplies is established by using the undirected connected graph.
5. The method of claim 1, wherein the consistency algorithm-based microgrid operation mode smooth switching method is characterized by, The secondary controller is established according to the communication network between the distributed power supplies in combination with the active power and the reactive power on each bus, which comprises the following steps: The communication connection value is determined according to the communication network between the distributed power supplies; The first difference value between the measurement frequency of the selected distributed power supply and the grid frequency, and the second difference value between the secondary active control variable of the selected distributed power supply and a certain distributed power supply are calculated respectively; The first sum part is calculated according to the communication connection value, the first difference value, the second difference value and the operator symbol; the result of multiplying the first sum part with the controller positive gain is equal to the rate of change of the primary active control variable of the selected distributed power supply with time, so as to obtain the power controller for frequency regulation and active power sharing. According to the selected distributed power and the reactive power and rated reactive power of a certain distributed power, a third difference value is calculated; according to the voltage regulation gain, the measured voltage of the selected distributed power and the rated voltage amplitude, a fourth difference value is calculated; According to the communication connection value, the third difference value, the fourth difference value and the operation symbol, a second summation part is calculated; the result of multiplying the second summation part by the voltage quadratic controller positive gain is equal to the rate of change of the voltage quadratic control variable of the selected distributed power with time, to obtain a power controller for voltage regulation and reactive power sharing.
6. The method of claim 1, wherein the consistency algorithm-based microgrid operation mode smooth switching method is characterized by, The adjusting of the quadratic controller based on the quadratic controller and the compensation signal output by the fuzzy proportional-integral controller includes: The proportional parameter and the integral parameter of the proportional-integral controller are updated in real time by using the fuzzy algorithm to obtain the fuzzy proportional-integral controller; The difference between the micro-grid phase and the grid connection point phase and the difference between the micro-grid voltage amplitude and the grid connection point phase are input into the fuzzy proportional-integral controller to obtain the compensation signal of the active power required for the operation mode switching and the compensation signal of the reactive power required for the operation mode switching; The compensation signal of the active power required for the operation mode switching is added to the power controller for frequency regulation and active power sharing to obtain the adjusted power controller for frequency regulation and active power sharing; The compensation signal of the reactive power required for the operation mode switching is added to the power controller for voltage regulation and reactive power sharing to obtain the adjusted power controller for voltage regulation and reactive power sharing.
7. The method of claim 6, wherein the consistency algorithm is based on, The fuzzy proportional-integral controller includes: The difference between the micro-grid phase and the grid connection point phase or the difference between the micro-grid voltage amplitude and the grid connection point phase is taken as the first input variable of the fuzzy proportional-integral controller; The rate of change of the phase difference or the rate of change of the voltage amplitude difference is taken as the second input variable of the fuzzy proportional-integral controller; The adjustment amount of the proportional parameter and the integral parameter of the fuzzy proportional-integral controller is taken as the output variable; The basic domain and the language variable domain of the first input variable are configured; the language variable domain of the second input variable is configured; the language variable domain of the output variable is configured; The element number and the multiple relationship of the language value elements in the fuzzy subset of the language variable domain, the language value, the fuzzy subset of the first input variable and the second input variable, and the fuzzy subset of the output variable are configured; The membership functions of the first input variable, the second input variable and the output variable are configured, and the control rules of the membership functions are set. 8.The microgrid operation mode smooth switching method based on consensus algorithm of claim 1, wherein, The generation of the voltage control signal of the voltage-current loop based on the output voltage signal of the primary controller and the voltage-current loop double-loop control mechanism includes: The voltage signal in the direct-axis-quadrature-axis coordinate system is transformed to generate the reference voltage in the three-phase stationary coordinate system; The virtual impedance control is added to the reference voltage to offset the influence of the line impedance to generate a new reference voltage; The new reference voltage is input into the voltage-current loop double-loop control mechanism to update the voltage and current values in real time and output the voltage control signal. 9.The microgrid operation mode smooth switching method based on consensus algorithm of claim 8, wherein, The voltage control signal is converted into a pulse modulation signal by the optimization technique and the selective harmonic elimination pulse width modulation technique to control the output power of the distributed power supply, which comprises: After the voltage control signal is processed by the selective harmonic elimination pulse width modulation, a pulse modulation signal is obtained and input into an inverter to control the output power of the distributed power supply through the inverter; A harmonic elimination equation set is constructed; the harmonic elimination equation set is transformed according to the principle of unifying a minimum multi-objective problem into a single-objective problem, and a plurality of target variables are obtained; A target function is constructed according to the target variables, and a switching angle constraint condition is determined; the target function is solved by a grey wolf optimization algorithm and the switching angle constraint condition is satisfied to obtain a solution set for eliminating harmonics.
10. The method of claim 9, wherein the consistency algorithm is based on, The target function and the switching angle constraint condition comprise: ; ; wherein are different target variables, respectively; are different switching angles, respectively, and Q is an objective function.