Secondary Frequency Adaptive System of Microgrid and Its Control Method
By using genetic algorithms to optimize the equivalent coefficient, proportional coefficient and integral coefficient in the microgrid, the problem of difficulty in setting the parameter of the secondary frequency modulation controller in the microgrid is solved, and the rapid frequency modulation and stable recovery of the microgrid system are achieved.
Patent Information
- Application Number
- CN202210085945.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-25
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2042-01-25
AI Technical Summary
The prior art is difficult to effectively adapt to the difficulty of setting the secondary frequency modulation controller parameters caused by frequent switching of power generation equipment and changes in network structure in microgrids, and has poor versatility.
By obtaining the initial equal value coefficient of the microgrid, the population is formed, and the genetic algorithm is used to calculate the fitness function value of the population to obtain the optimal solution of the equal value coefficient, proportional coefficient and integral coefficient, and finally the allocation power of the microgrid is adjusted.
It realizes rapid frequency regulation of the microgrid system, helps to quickly recover the frequency, and ensures the stability of the microgrid system.
Smart Images

Figure CN114566982B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of secondary frequency control of microgrids, and particularly to a secondary frequency adaptive system for a microgrid and a control method thereof. Background Art
[0002] When a microgrid operates in island mode, energy storage converters usually adopt control methods such as droop control and virtual synchronous generator control to stabilize the frequency of the system. Since the above-mentioned energy storage converter control methods cause the frequency in the system to change with the load, it is necessary to adopt a secondary frequency modulation strategy to achieve zero-error control of the frequency in order to improve the power supply quality of the microgrid system. However, in the microgrid, the power generation equipment is switched frequently and the network structure is constantly changing, so the secondary frequency modulation controller has poor adaptability and it is difficult to tune the controller parameters.
[0003] Currently, there are mainly proportional-integral control, model predictive control, dynamic matrix control, etc. However, no matter which control method is used, it is necessary to design its parameters by using the model of the controlled object. Therefore, the modeling of the microgrid system is the basis for the optimal design of the secondary frequency modulation controller. In the prior art, according to the characteristics of virtual synchronous machine control, parameter identification methods based on the least squares method and genetic algorithm are proposed to identify the damping coefficient of the virtual synchronous machine. However, this method focuses on parameter identification of a single converter model and is not applied to the identification of the entire microgrid, so its generality is poor.
[0004] The inventors of the present application found in the process of implementing the present invention that the above-mentioned solutions in the prior art have the problem that they cannot be applied to the entire microgrid, so their generality is poor. Summary of the Invention
[0005] The purpose of the embodiments of the present invention is to provide a secondary frequency adaptive system for a microgrid and a control method thereof, which can tune the controller parameters of the entire microgrid.
[0006] To achieve the above purpose, on the one hand, the embodiments of the present invention provide a secondary frequency adaptive system for a microgrid and a control method thereof. The control method includes:
[0007] Obtain the initial equivalent coefficient, proportional coefficient and integral coefficient of the microgrid;
[0008] Encode according to the initial equivalent coefficient to obtain an initial population;
[0009] Use a genetic algorithm to calculate the optimal solutions of the equivalent coefficient, proportional coefficient and integral coefficient according to the population, where the genetic algorithm includes:
[0010] Calculate the fitness function values of the population according to formulas (2) to (4),
[0011]
[0012] Among them, Fitness is the value of the fitness function, i is an integer number, f(i) is the frequency value calculated according to the i-th individual, f′(i) is the frequency value obtained by sampling, and n is the number of individuals in the population;
[0013] f(i) = Af(i - 2) + Bf(i - 1) + CP(i - 1) + DP(i - 2), (2)
[0014]
[0015] Among them, K m is the initial equivalent coefficient, K p is the initial proportionality coefficient, K i is the initial integral coefficient, h is the sampling step, τ is the sampling period, and P(i - 1) is the power value of the (i - 1)-th individual;
[0016] Adjust the distribution power of the microgrid according to the optimal solution.
[0017] Optionally, encoding according to the initial equivalent coefficient to obtain an initial population includes:
[0018] Randomly initialize multiple values according to the initial equivalent coefficient to form an equivalent coefficient set;
[0019] Perform binary encoding on each value in the equivalent coefficient set to form a basic population;
[0020] Calculate the Gray code of each individual in the population according to formula (8),
[0021] B = b m b m-1 ...b2b1,
[0022] G = g m g m-1 …g2g1,
[0023]
[0024] Among them, B is the binary code, G is the Gray code, m is the number of encoding bits and is an integer number, and g m is the encoding value of the m-th bit of the Gray code, b m is the encoding value of the m-th bit of the binary code, g i is the encoding value of the i-th bit of the Gray code, b i is the encoding value of the i-th bit of the binary code, b i+1is the encoding value of the (i + 1)-th bit of the binary code, where i is an integer number;
[0025] Form an initial population according to the Gray code of each individual in the population.
[0026] Optionally, using a genetic algorithm to calculate the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient according to the population includes:
[0027] Calculate the fitness function value of the population;
[0028] Determine whether the fitness function value of the population is less than or equal to a preset threshold;
[0029] In the case where it is determined that the fitness function value of the population is greater than the preset threshold, select a new generation of individuals with the same number as the population according to the fitness function value of each individual in the population;
[0030] Perform replication operations, crossover operations, and mutation operations on the selected new generation of individuals to form a new generation of population;
[0031] And return to the step of calculating the fitness function value of the population again.
[0032] Optionally, using a genetic algorithm to calculate the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient according to the population includes:
[0033] In the case where it is determined that the fitness function value of the population is less than or equal to the preset threshold, select the minimum value of the fitness function value of a single individual in the population;
[0034] Identify the optimal equivalent coefficient corresponding to the minimum value;
[0035] Calculate the corresponding proportional coefficient and integral coefficient according to the optimal equivalent coefficient;
[0036] Adjust the distributed power of the microgrid according to the equivalent coefficient, proportional coefficient, and integral coefficient.
[0037] Optionally, using a genetic algorithm to calculate the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient according to the population includes:
[0038] Preset an iteration number threshold;
[0039] Determine whether the current iteration number is greater than or equal to the iteration number threshold;
[0040] In the case where it is determined that the current iteration number is less than the iteration number threshold, select a new generation of individuals with the same number as the population according to the fitness function value of each individual in the population;
[0041] Perform copy operation, crossover operation, and mutation operation on the selected new generation of individuals to form a new generation of population;
[0042] And return to the step of calculating the fitness function value of the population again.
[0043] Optionally, using a genetic algorithm to calculate the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient according to the population includes:
[0044] When it is determined that the current iteration count is greater than or equal to the iteration count threshold, select the minimum value of the fitness function value of a single individual in the population;
[0045] Identify the optimal equivalent coefficient corresponding to the minimum value;
[0046] Adjust the distributed power of the microgrid according to the equivalent coefficient, proportional coefficient, and integral coefficient.
[0047] Optionally, the copy operation and the crossover operation include:
[0048] Copy the population according to formula (11) to form a new generation of population,
[0049] G i+1 =G i , (11)
[0050] where G i+1 is the Gray code of the (i + 1)-th generation, G i is the Gray code of the i-th generation, and i is an integer number;
[0051] Crossover the population according to formula (12) to form a new generation of population,
[0052] G ij =g mij g (m-1)ij …g 2ij g 1ij ,
[0053] G in =g min g (m-1)in …g 2in g 1in ,
[0054] G (i+1)j =g min g (m-1)in …g 2ij g 1ij ,
[0055] G (i+1)n =g mij g (m-1)ij …g2in g 1in , (12)
[0056] Among them, G ij is the j-th Gray code in the i-th generation population, G in is the n-th Gray code in the i-th generation population, G (i+1)j is the j-th Gray code in the (i + 1)-th generation population, G (i+1)n is the n-th Gray code in the (i + 1)-th generation population, and j and n are integer numbers.
[0057] Optionally, the mutation operation includes:
[0058] Randomly select multiple individuals from the current population as the individuals to be mutated;
[0059] For each of the individuals to be mutated, randomly select multiple coding bits in the individual to be mutated as the positions to be mutated;
[0060] Replace the current coding value with the inverse code of the corresponding coding value at the position to be mutated.
[0061] Optionally, calculating the corresponding proportionality coefficient and integral coefficient according to the equivalent coefficient corresponding to each individual in the new generation population includes:
[0062] Calculate the proportionality coefficient according to formula (13);
[0063]
[0064] Among them, K p is the proportionality coefficient, K m is the identified equivalent coefficient, and τ is the time constant;
[0065] Calculate the integral coefficient according to formula (14),
[0066]
[0067] Among them, K i is the integral coefficient;
[0068] Obtain the open-loop transfer function of the secondary frequency modulation control system according to formula (15),
[0069]
[0070] Among them, G OP (s) is the open-loop transfer function, K z is the equivalent output characteristic,
[0071] On the other hand, the present invention also provides a microgrid secondary frequency adaptive system, including:
[0072] A photovoltaic unit for photovoltaic power generation;
[0073] A wind power unit for wind power generation;
[0074] Multiple energy storage converters, which are connected in parallel and are respectively connected to the photovoltaic unit and the wind power unit;
[0075] A storage device, which is connected to the multiple energy storage converters and is used to store the electric energy generated by the photovoltaic unit and the wind power unit;
[0076] An intelligent switch, one end of which is connected to one of the energy storage converters, and the other end is used to be connected to the power grid;
[0077] Multiple loads, which are connected to the energy storage converters;
[0078] A microgrid central controller for executing the control method as described in any one of the above.
[0079] Through the above technical solution, the microgrid secondary frequency adaptive system and its control method provided by the present invention obtain the initial equivalent coefficient of the microgrid, encode it to form a population, calculate the fitness function value of the population by using the genetic algorithm, and obtain the optimal solutions of the equivalent coefficient, the proportional coefficient, and the integral coefficient according to the fitness function value. Finally, the distribution power of the microgrid is adjusted according to the optimal solutions to achieve fast frequency modulation of the microgrid system, which is beneficial to the rapid recovery of the microgrid frequency and ensures the stability of the microgrid system.
[0080] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent specific implementation part. Description of the Drawings
[0081] The drawings are used to provide a further understanding of the embodiments of the present invention, and constitute a part of the specification. Together with the following specific implementation, they are used to explain the embodiments of the present invention, but do not constitute a limitation to the embodiments of the present invention. In the drawings:
[0082] Figure 1 is a flowchart of the control method for microgrid secondary frequency adaptation according to an embodiment of the present invention;
[0083] Figure 2 is a schematic flowchart of encoding in the control method for microgrid secondary frequency adaptation according to an embodiment of the present invention;
[0084] Figure 3 is a schematic flowchart of the genetic algorithm in the control method for microgrid secondary frequency adaptation according to an embodiment of the present invention;
[0085] Figure 4 It is a flow chart of the genetic algorithm in the microgrid secondary frequency adaptive control method according to an embodiment of the present invention;
[0086] Figure 5 It is a flow chart of the mutation operation in the microgrid secondary frequency adaptive control method according to an embodiment of the present invention;
[0087] Figure 6 It is a schematic diagram of the microgrid secondary frequency adaptive system according to an embodiment of the present invention;
[0088] Figure 7 It is a diagram of the identification result of the genetic algorithm optimization process of the microgrid secondary frequency adaptive system according to an embodiment of the present invention;
[0089] Figure 8 It is the identification value of the equivalent coefficient of the frequency modulation control system of the microgrid secondary frequency adaptive system according to an embodiment of the present invention;
[0090] Figure 9 It is the frequency output waveform after online optimization of the controller of the microgrid secondary frequency adaptive system according to an embodiment of the present invention.
[0091] Description of the reference numerals
[0092] 01, Photovoltaic unit 02, Wind power unit
[0093] 03, Load 04, Energy storage device
[0094] 05, Microgrid central controller 06, Energy storage converter
[0095] 07, Intelligent switch 08, Power grid Detailed implementation manners
[0096] The following will describe in detail the specific implementation manners of the embodiments of the present invention with reference to the accompanying drawings. It should be understood that the specific implementation manners described herein are only for explaining and illustrating the embodiments of the present invention, and are not used to limit the embodiments of the present invention.
[0097] Figure 1 It is a flow chart of the microgrid secondary frequency adaptive control method according to an embodiment of the present invention. In Figure 1 it, the control method may include:
[0098] In step S10, the initial equivalent coefficient, proportional coefficient, and integral coefficient of the microgrid are obtained. Among them, the initial equivalent coefficient, proportional coefficient, and integral coefficient are preset values. The microgrid central controller will perform droop control on the frequency of the microgrid according to the initial equivalent coefficient, proportional coefficient, and integral coefficient to ensure the stability of the microgrid system. The initial equivalent coefficient of the microgrid system can be calculated according to formula (1).
[0099]
[0100] Among them, K m is the initial equivalent coefficient, f is the real-time frequency of the microgrid system, f o is the reference frequency of the microgrid system, f oi is the reference frequency of the i-th converter in the microgrid system, P oi is the reference power of the i-th converter in the microgrid system, P is the real-time power of the microgrid system, K mi is the equivalent coefficient of the i-th converter.
[0101] In step S11, encoding is performed according to the initial equivalent coefficient to obtain the initial population. Among them, after obtaining the initial equivalent coefficient, the initial equivalent coefficient is randomized to obtain the initial equivalent coefficient set, and each individual in the initial equivalent coefficient set is encoded to obtain the initial population.
[0102] In step S12, the genetic algorithm is used to calculate the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient according to the population. Among them, the genetic algorithm includes calculating the fitness function value of the population according to formulas (2) to (4).
[0103] f(i) = Af(i - 2) + Bf(i - 1) + CP(i - 1) + DP(i - 2), (2)
[0104]
[0105] Among them, K p is the initial proportional coefficient, K i is the initial integral coefficient, h is the sampling step, taking 10 -3 , τ is the sampling period, taking 20ms, P(i - 1) is the power value of the (i - 1)-th individual, and f(i) is the frequency value calculated according to the i-th individual.
[0106] Calculate the fitness function according to formula (4).
[0107]
[0108] Among them, Fitness is the fitness function value, i is the integer number, f′(i) is the frequency value obtained by sampling, and n is the number of individuals in the population.
[0109] In this embodiment of the present invention, the calculation formula of the fitness function value can be obtained through the following steps:
[0110] Obtain the transfer function of the microgrid system according to the equivalent control block diagram of the traditional equivalent model as shown in formula (5). The equivalent control block diagram of the traditional equivalent model is prior art and will not be elaborated here.
[0111]
[0112] Among them, K mx is the equivalent equivalent coefficient of the microgrid system, and K zx is the equivalent output power characteristic of the microgrid system.
[0113] Construct a new P-F transfer function according to formula (6).
[0114]
[0115] Among them, G PF (s) is the P-F transfer function of the microgrid system, and K m is the equivalent equivalent coefficient of the microgrid system, and K p is the proportional coefficient of the microgrid system, and K i is the integral coefficient of the microgrid system.
[0116] Represent formula (6) in the discrete domain to obtain the differential equation shown in formula (7).
[0117]
[0118] Process formula (7) with the three-point interpolation derivative formula to obtain the recurrence formulas shown in formulas (2) and (3).
[0119] In step S13, adjust the distribution power of the microgrid according to the optimal solution. Among them, after obtaining the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient, substitute the optimal solutions into the secondary frequency transfer function of the microgrid system to obtain the distribution power of each converter in the microgrid system, and distribute the distribution power proportionally to multiple energy storage converters to maintain the frequency stability of the microgrid system.
[0120] In steps S10 to S13, it is necessary to encode according to the obtained initial equivalent coefficient to obtain an initial population, and use a genetic algorithm to calculate the fitness function of this population to obtain the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient. Finally, the microgrid system calculates the allocated power of each converter according to the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient, and distributes it to each converter to maintain the stability of the microgrid system.
[0121] In the traditional control method for the secondary frequency modulation of converters in a microgrid system, mainly based on the characteristics of virtual synchronous machine control and the parameter identification methods based on the least squares method and genetic algorithm, the damping coefficient of the virtual synchronous machine is identified, and then the purpose of secondary frequency modulation of the converter is achieved. However, this method mainly performs parameter identification for a single converter. For multiple converters in the entire microgrid system, multiple parameters need to be identified, and the identification logic is complex and cannot be uniformly regulated. Therefore, the versatility of this method is poor. In this embodiment of the present invention, a population is formed by encoding according to the initial equivalent coefficient of the microgrid system, and the fitness function value of the population is calculated by a genetic algorithm to obtain the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient of the entire microgrid system, so as to achieve fast frequency modulation of the microgrid system, which is beneficial to the rapid recovery of the microgrid frequency and ensures the stability of the microgrid system.
[0122] In this embodiment of the present invention, in order to obtain the initial population of the genetic algorithm, it is also necessary to encode the initial equivalent coefficient. Specifically, this control method may further include the steps as Figure 2 shown.
[0123] In Figure 2 , this control method may further include:
[0124] In step S20, multiple values are randomly initialized according to the initial equivalent coefficient to form an equivalent coefficient set. Among them, after obtaining the initial equivalent coefficient, a preset number of values are randomized according to the initial equivalent coefficient and form an equivalent coefficient set with the initial equivalent coefficient, and the numbers in the set are all real numbers.
[0125] In step S21, each value in the equivalent coefficient set is binary encoded to form a basic population. Among them, when binary encoding each real number in the equivalent coefficient set, the number of bits of each binary code in the basic population is the same, and the number of bits of the binary code is determined by the number of bits of the binary code corresponding to the largest real number in the equivalent coefficient set.
[0126] In step S22, the Gray code of each individual in the population is calculated according to formula (8),
[0127] B = b m b m-1...b2b1,
[0128] G = g m g m-1 …g2g1,
[0129]
[0130] where B is a binary code, G is a Gray code, m is the number of encoding bits and is an integer number, and g m is the encoding value of the m-th bit of the Gray code, and b m is the encoding value of the m-th bit of the binary code, and g i is the encoding value of the i-th bit of the Gray code, and b i is the encoding value of the i-th bit of the binary code, and b i+1 is the encoding value of the (i + 1)-th bit of the binary code, and i is an integer number.
[0131] In step S23, an initial population is formed according to the Gray code of each individual in the population. Among them, the randomness of the equivalent coefficient set makes the local search ability of the binary encoding poor, and there are some problems affecting the calculation accuracy. After the population is calculated by the genetic algorithm for multiple generations, when the solution of the new generation population approaches the optimal solution, the change of the binary encoding after mutation is large and discontinuous, which leads to the situation that the next generation population is far from the optimal solution, making the optimal solution of the equivalent coefficient calculated by this genetic algorithm not stable enough. Since there is only one code bit different between the encoding values corresponding to two consecutive integers of the Gray code, the Gray code can effectively prevent the occurrence of such phenomena.
[0132] In steps S20 to S23, a set of multiple real numbers is randomly generated according to the initial equivalent coefficient, and the multiple real numbers in the set are binary encoded to form a basic population. In order to ensure that the genetic algorithm can make the solution of the new generation population approach the optimal solution after multiple generations of calculation, each binary code in the basic population needs to be converted into the corresponding Gray code to form an initial population. By using the Gray code encoding method, the number of iterations of the genetic algorithm can be reduced, and the stable output of the optimal solution can be ensured.
[0133] In this embodiment of the present invention, in order to obtain the optimal solutions of the equivalent coefficient, the proportional coefficient, and the integral coefficient, the genetic algorithm also needs to be used for calculation. Specifically, the control method may further include the steps as Figure 3 shown. Specifically, in Figure 3 , the control method may further include:
[0134] In step S30, the fitness function value of the population is calculated. Among them, after inputting the current population, the fitness function value corresponding to the current population is calculated according to formulas (2) to (4).
[0135] In step S31, it is judged whether the fitness function value of the population is less than or equal to a preset threshold. Among them, after calculating the fitness function value corresponding to the contemporary population, in order to judge whether there is an optimal solution in the contemporary population, it is also necessary to compare this fitness function value with the preset threshold.
[0136] In step S32, when it is judged that the fitness function value of the population is greater than the preset threshold, a new generation of individuals with the same number as the population is selected according to the fitness function values of each individual in the population. Among them, if this fitness function value is greater than the preset threshold, it means that the contemporary population does not meet the requirement of having an optimal solution. In order to make the population approach the optimal solution, it is necessary to select a new generation of individuals with the same number according to the size of the fitness function values of each individual in the population.
[0137] In step S33, copy operations, crossover operations, and mutation operations are performed on the selected new generation of individuals to form a new generation of population. Among them, after selecting the new generation of individuals, it is also necessary to perform copy operations, crossover operations, and mutation operations on each individual in the contemporary population, etc., to improve the fitness of each individual, that is, the fitness function value of each individual gradually decreases, so that the new generation of population gradually approaches the optimal solution.
[0138] In step S34, it returns to the step of calculating the fitness function value of the population again. Among them, after the new generation of population is formed, it is also necessary to calculate the fitness function value of the new generation of population to judge whether the fitness function value of the new generation of population meets the preset threshold, and this cycle continues until the optimal solution of the population is obtained.
[0139] In steps S30 to S34, it is necessary to calculate the fitness function value of the contemporary population and compare this fitness function value of the contemporary population with the preset threshold to judge whether there is an individual with an optimal solution in this contemporary population. If the fitness function value of the contemporary population is greater than the preset threshold, it means that there is no individual with an optimal solution in the contemporary population, and it is necessary to select the individuals with high fitness in the contemporary population and perform copy operations, crossover operations, mutation operations, etc., to form a new generation of population. By using the methods of screening, copy operations, crossover operations, and mutation operations, the fitness of the individuals in the population can be made higher and higher, that is, the individuals in the contemporary population gradually approach the optimal solution, which is convenient for obtaining the optimal solution.
[0140] In this embodiment of the present invention, when the fitness function value of the population meets the requirements of the preset threshold, it is also necessary to calculate the optimal solutions of the equivalent coefficient, the proportional coefficient, and the integral coefficient. Specifically, the control method may further include as Figure 3 shown in the steps. Specifically, in Figure 3 it, the control method may include:
[0141] In step S35, when it is determined that the fitness function value of the population is less than or equal to the preset threshold, the minimum value of the fitness function value of a single individual in the population is selected. Among them, if the fitness function value of the population is less than or equal to the preset threshold, it indicates that there is an individual in this generation of the population that is the optimal solution. In order to improve the accuracy and precision of selecting the individual as the optimal solution, the individual with the minimum fitness function value among the individuals in this generation of the population is selected as the optimal solution.
[0142] In step S36, the optimal equivalent coefficient corresponding to the minimum value is identified. Among them, when obtaining the Gray code corresponding to the individual with the minimum fitness function value, it is necessary to convert it into a binary code. The Gray code is converted into a binary code according to formula (9),
[0143] B = b m b m-1 ...b2b1,
[0144] G = g m g m-1 …g2g1,
[0145]
[0146] Then the binary code is transcoded into a real number, and this real number is the optimal equivalent coefficient.
[0147] In step S37, the corresponding proportional coefficient and integral coefficient are calculated according to the optimal equivalent coefficient. Among them, after obtaining the optimal equivalent coefficient, it is also necessary to calculate the optimal proportional coefficient and the optimal integral coefficient to meet the stability and accuracy of the secondary frequency modulation of the microgrid system.
[0148] In step S38, the distributed power of the microgrid is adjusted according to the equivalent coefficient, the proportional coefficient, and the integral coefficient. Among them, after calculating the optimal values of the equivalent coefficient, the proportional coefficient, and the integral coefficient, the microgrid system can perform adaptive secondary frequency modulation according to the optimal values to ensure the stability of the microgrid system.
[0149] In steps S35 to S38, if the fitness function value of the population is less than or equal to the preset threshold, it indicates that this population meets the requirement of having an optimal solution individual. The individual corresponding to the minimum value of the fitness function value in this population is used as the optimal solution of the equivalent coefficient, and it is decoded. The corresponding proportional coefficient and integral coefficient are calculated according to the optimal solution of the equivalent coefficient to form a complete secondary frequency modulation transfer function of the microgrid system, and the microgrid system is quickly and stably frequency modulated.
[0150] In this embodiment of the present invention, in order to ensure the stability and accuracy of the optimal value of the equivalent coefficient, it is necessary to limit the number of iterations of the population. Specifically, this control method may further include as Figure 4 shown steps. Specifically, inFigure 4 In this case, the control method may further include:
[0151] In step S40, a preset iteration number threshold is set. Specifically, in order to ensure that the optimal solution of the equivalent coefficient can be stably obtained after multiple iterations of the population, the minimum number of iterations of the population can be preset, so that the population must undergo iterative operations for the preset number of iterations.
[0152] In step S41, it is judged whether the current iteration number is greater than or equal to the iteration number threshold. Among them, in the population after fewer iterations, the individuals in the newly formed population may not meet the requirements of the optimal solution of the equivalent coefficient. Therefore, it is necessary to ensure that the population undergoes multiple iterations, that is, to undergo iterations for the preset number of iterations.
[0153] In step S42, when it is judged that the current iteration number is less than the iteration number threshold, a new generation of individuals with the same number as the population is selected according to the fitness function values of each individual in the population. Among them, if the iteration number is less than the iteration number threshold, it means that the number of iterations of the current population is insufficient, and at this time, the population may not have an optimal solution. In order to make the population approach the optimal solution, it is necessary to select a new generation of individuals with the same number according to the magnitudes of the fitness function values of each individual in the population.
[0154] In step S43, copy operations, crossover operations, and mutation operations are performed on the selected new generation of individuals to form a new generation of population. Among them, after selecting the new generation of individuals, copy operations, crossover operations, and mutation operations, etc., also need to be performed on each individual in the current population to improve the fitness of each individual, that is, the fitness function value of each individual gradually decreases, so that the new generation of population gradually approaches the optimal solution.
[0155] In step S44, the step of calculating the fitness function value of the population is returned again. Among them, after the new generation of population is formed, it is also necessary to calculate the number of iterations of the new generation of population to judge whether the number of iterations of the new generation of population meets the preset iteration number threshold, and this cycle continues until the iteration of the iteration number threshold is completed.
[0156] In steps S40 to S44, the threshold of the number of iterations that the population needs to perform is preset in advance, and the population is iterated a finite number of times until the number of iterations of the population reaches the iteration number threshold. If the number of iterations of the population does not reach the iteration number threshold, the population may not meet the requirement of having an optimal solution. Therefore, it is necessary to perform iterations for the preset iteration number threshold on the population to ensure that the population can stably obtain the optimal solution.
[0157] In this embodiment of the present invention, in order to obtain the optimal solutions of the proportional coefficient and the integral coefficient, it is also necessary to calculate the optimal solution of the identified equivalent coefficient. Specifically, the control method may further include asFigure 4 The steps shown. Specifically, in Figure 4 , the control method may further include:
[0158] In step S45, when it is determined that the current iteration count is greater than or equal to the iteration count threshold, the minimum value of the fitness function value of a single individual in the population is selected. Among them, if the iteration count of the population is greater than or equal to the iteration count threshold, it means that the population iteration is completed, and the optimal solution of the equivalent coefficient stably exists in the current population. To improve the accuracy and precision of selecting the individual as the optimal solution, the individual with the minimum fitness function value in this generation of the population is selected as the optimal solution.
[0159] In step S46, the optimal equivalent coefficient corresponding to the minimum value is identified. Among them, when obtaining the Gray code corresponding to the individual with the minimum fitness function value, it needs to be converted into a binary code. Convert the Gray code into a binary code according to formula (8), and then convert the binary code into a real number, and this real number is the optimal equivalent coefficient.
[0160] In step S47, the corresponding proportional coefficient and integral coefficient are calculated according to the optimal equivalent coefficient. Among them, after obtaining the optimal equivalent coefficient, it is also necessary to calculate the optimal proportional coefficient and the optimal integral coefficient to meet the stability and accuracy of the secondary frequency regulation of the microgrid system.
[0161] In step S48, the distributed power of the microgrid is adjusted according to the equivalent coefficient, the proportional coefficient, and the integral coefficient. Among them, after calculating the optimal values of the equivalent coefficient, the proportional coefficient, and the integral coefficient, the microgrid system can perform adaptive secondary frequency regulation according to the optimal values to ensure the stability of the microgrid system.
[0162] In steps S45 to S48, if the iteration count of the population is greater than or equal to the iteration count threshold, it means that the population meets the requirement of having an optimal solution individual. The individual corresponding to the minimum value of the fitness function value in this population is used as the optimal solution of the equivalent coefficient, and it is decoded. The corresponding proportional coefficient and integral coefficient are calculated according to the optimal solution of the equivalent coefficient to form a complete secondary frequency regulation transfer function of the microgrid system, and the microgrid system is quickly and stably frequency-regulated.
[0163] In this embodiment of the present invention, the roulette wheel selection method is used to select the new generation of individuals. Specifically, the fitness function value of each individual in the population is calculated according to formula (2) and formula (3), and the probability of each individual in the population being selected can be obtained according to formula (10),
[0164]
[0165] where K mi is the i-th individual in the population, i is an integer number, f(Kmi ) is the fitness function value of the i-th individual in the population, and P{K mi} is the selection probability of the i-th individual in the population. n is the number of individuals in the population, and n is an integer number.
[0166] As can be seen from formula (10), the smaller the fitness function value, the greater the probability of being selected. That is, the higher the fitness, the greater the probability of being selected. Individuals with high fitness will have more offspring in the next generation, while individuals with low fitness will have fewer offspring in the next generation or even be eliminated. After multiple iterations, the population will consist of offspring with high fitness.
[0167] When selecting a new generation of individuals, the roulette is divided into n parts, where n is the number of individuals in the population. The reciprocals of the fitness function values of each individual in the population are distributed on the roulette in proportion, and two fixed pointers are set. By rotating the roulette, two individuals can be obtained, and so on until a new generation of individuals with the same number as the population is obtained.
[0168] In this embodiment of the present invention, the replication operation may include replicating the operation population according to formula (11) to form a new generation of population,
[0169] G i+1 = G i , (11)
[0170] where G i+1 is the Gray code of the (i + 1)-th generation, G i is the Gray code of the i-th generation, and i is an integer number.
[0171] In this embodiment of the present invention, the crossover operation may include performing a crossover operation on the population according to formula (12) to form a new generation of population,
[0172] G ij = g mij g (m-1)ij …g 2ij g 1ij ,
[0173] G in = g min g (m-1)in …g 2in g 1in ,
[0174] G (i+1)j = g min g (m-1)in …g 2ij g 1ij ,
[0175] G (i+1)n = g mij g (m-1)ij …g2in g 1in , (12)
[0176] wherein, G ij is the j-th Gray code in the i-th generation population, G in is the n-th Gray code in the i-th generation population, G (i+1)j is the j-th Gray code in the (i + 1)-th generation population, G (i+1)n is the n-th Gray code in the (i + 1)-th generation population, and j and n are integer numbers.
[0177] In this embodiment of the present invention, in order to obtain a new generation population with high fitness, a mutation operation is also performed. Specifically, the control method may further include steps as Figure 5 shown. Specifically, in Figure 5 , the control method may further include:
[0178] In step S50, a plurality of individuals are randomly selected from the current population as the individuals to be mutated. Among them, according to the principle of gene mutation in biological inheritance, the mutation probability P m is very small. Since mutation is random, a plurality of individuals in the population are randomly selected according to the mutation probability P m and wait for mutation.
[0179] In step S51, for each individual to be mutated, a plurality of coding bits are randomly selected in the individual to be mutated as the positions to be mutated. Among them, the mutation probability of each coding bit of each individual is also very small and is random. Therefore, a plurality of coding bits in the individual to be mutated are randomly selected and wait for mutation.
[0180] In step S52, the current coding value is replaced with the inverse code of the coding value corresponding to the position to be mutated. Among them, since each coding bit of the Gray code consists of 0 or 1, when mutation occurs at the position to be mutated in the Gray code, this coding bit changes from 0 to 1, or from 1 to 0, that is, it is replaced with the inverse code.
[0181] In steps S50 to S52, individuals in the population are randomly selected as the individuals to be mutated, and a certain coding bit on the individual to be mutated is randomly selected as the position to be mutated. During mutation, the position to be mutated is replaced with the inverse code to achieve the mutation operation. Relying solely on the mutation operation cannot obtain benefits in the solution, but it can ensure that the genetic algorithm will not produce a single population that cannot evolve. Because when each individual in the population is the same, the crossover operation cannot produce new individuals, and only the mutation operation can produce new individuals. Therefore, the mutation operation increases the characteristics of global optimization.
[0182] In this embodiment of the present invention, the calculation of the optimal value of the proportionality coefficient includes calculating the proportionality coefficient according to formula (13);
[0183]
[0184] Among them, K p is the proportionality coefficient, K m is the identified equivalent coefficient, τ is the time constant, h is the bandwidth, and h = 5.
[0185] In this embodiment of the present invention, the calculation of the optimal value of the integral coefficient includes calculating the integral coefficient according to formula (14),
[0186]
[0187] Among them, K i is the integral coefficient.
[0188] In this embodiment of the present invention, the tuning of the parameters of the microgrid central controller in the microgrid system includes obtaining the open-loop transfer function of the secondary frequency modulation control system according to formula (15),
[0189]
[0190] Among them, G OP (s) is the open-loop transfer function, K z is the equivalent output power characteristic,
[0191] The denominator of the open-loop transfer function of the secondary frequency modulation control system can extract s, as shown in formula (16),
[0192]
[0193] Formula (16) has an extra constant term K compared with the typical type II system transfer function m K z . If the constant term K m K z can be omitted, then G OP (s) is in the same form as the typical type II system transfer function. According to the root formula, if , the constant term K m K z will hardly change the pole distribution of the typical type II system transfer function.
[0194] The value of the open-loop transfer function of the secondary frequency modulation control system can be obtained by the following steps:
[0195] The droop coefficient K m of a single inverter = Δf / P n , where P nis the rated power, and Δf selects the maximum allowable frequency deviation, usually taking Δf ≤ 0.5 Hz. In actual engineering, K m takes values in the range of 10 -6 ~10 -5 order of magnitude. Since increasing the value of the droop coefficient will reduce the stability of the system, 10 -5 is regarded as the worst-case condition.
[0196] The calculation of K z needs to consider the difference in the output impedance values in different droop modes. The smaller the impedance, the larger K z . According to the actual situation, take Z = 0.8 Ω as the worst condition and substitute it into the calculation (the filter inductance value of a high-power inverter is usually less than 3 mH, and the resistance in a low-voltage system is about 0.6 Ω per kilometer. Calculate according to a 3-km line). Substituting into the calculation, it can be obtained that under the worst-case condition, there is satisfying the above conditions. When multiple converters are operating in parallel, the equivalent droop coefficient K m and the equivalent output characteristic K z do not have an order-of-magnitude leap compared with a single machine, so it can still be approximated in this way.
[0197] On the other hand, the present invention also provides a secondary frequency adaptive system for a microgrid. As Figure 6 shown, the adaptive system may include a photovoltaic unit 01, a wind power unit 02, a plurality of energy storage converters 06, an intelligent switch 07, a plurality of loads 03, an energy storage device 04, and a microgrid central controller 05.
[0198] The photovoltaic unit 01 is used for photovoltaic power generation, the wind power unit 02 is used for wind power generation, and a plurality of energy storage converters 06 are connected in parallel and are respectively connected to the photovoltaic unit 01 and the wind power unit 02. The energy storage device 04 is connected to a plurality of energy storage inverters 06 and is used to store the electric energy generated by the photovoltaic unit 01 and the wind power unit 02. One end of the intelligent switch 07 is connected to one of the energy storage converters 06, and the other end is used to connect to the power grid 08. A plurality of loads 03 are connected to the energy storage converter 06, and the microgrid central controller 05 is used to execute any of the above control methods.
[0199] In this embodiment of the present invention, in order to verify the optimization and identification ability of the genetic algorithm for the equivalent coefficient in the secondary frequency modulation strategy described in this article, the following simulation scheme is designed: The simulation parameters of three converter droop control inverters are set as K m1 = 8×10 -6 , K m2 = 5×10 -6 , K m3 = 3×10 -6 . Substituting into Equation (1) for calculation, the theoretical K m = 1.52×10-6 Now, apply a grid disturbance frequency of 0.2 Hz, and the sampling step size h is 10 -3 s. Send the simulation sampling data into the genetic algorithm program, set the population size to 100, the number of elites to 2 (i.e., the two individuals with the smallest fitness function values in each generation of the population), the crossover ratio to 0.8, the stopping generation to 50, and the deviation of the fitness function value to 10 -6 , and the simulation results are as follows Figure 7 as shown
[0200] After optimization and solution by the genetic algorithm, the optimal individual that meets the optimization termination condition is K m = 1.5×10 -6 . It can be seen from the figure that the genetic algorithm completes 50 generations of identification within 2.5 s, with a rapid identification speed, and the identification value tends to be stable at the 25th generation, and the identification result is accurate Figure 7 In [Figure 6], as the number of generations increases, the optimal fitness value and the average fitness value of the individuals gradually decrease and get closer and closer, which indicates that the difference between the output frequency calculated by substituting the identification value and the actual output frequency of the system is getting smaller and smaller, that is, the optimal identification value is close to the actual value Figure 7 In [Figure 7], the identification value gradually stabilizes at 1.5×10 -6 at the 25th generation, indicating that the identification result is accurate and the deviation is low. From the identified K m = 1.5×10 -6 compared with the calculated theoretical value K m = 1.52×10 -6 , it can also be known that the error is 1.31%, meeting the accuracy requirement of an error within 5%. In traditional fixed-order offline identification, the identification time is long and the identification accuracy is low. In the actual microgrid application, it is not conducive to the rapid tuning of the controller, which in turn affects the secondary frequency regulation speed and causes microgrid frequency oscillation
[0201] In this embodiment of the present invention, in order to test the online optimization effect of the microgrid frequency modulation control system, the following experiment is designed to verify the influence of the presence or absence of optimization of the frequency modulation control system on the system stability and frequency modulation speed when the number of connected converters is different: The equivalent coefficients of the microgrid model are obtained through the above genetic algorithm, and then adaptively updated to the optimal values according to formulas (13) and (14). Three converters operate in the P-F droop parallel mode. The system frequency is collected and uploaded by the common connection point intelligent gateway circuit breaker to the MGCC for analysis and processing, and then sent to MATLAB to draw the frequency waveform. The frequency collected by the gateway circuit breaker is 6.4 kHz, and the sliding filter value of 5 cycles is used as the frequency calculation result, with a sampling accuracy of 0.01 Hz. The MGCC scheduling period is 20 ms. The lower computer data is collected and calculation instructions are sent down every cycle. The inertia time constant τ is consistent with the MGCC scheduling period. The DC bus voltage of the inverter is 700 V, the line voltage effective value is 380 V, and the filter inductor is 1.5 mH. If the inverter stops, it is recorded as "stopped", and the K m identified by the genetic algorithm and the K p value online optimized by the microgrid central controller 05 are sent out by the oscilloscope. The specific experimental data is shown in Table 1.
[0202] Table 1 Experimental data
[0203]
[0204]
[0205] The identified values of K m during the whole experimental process are as Figure 8 shown, and the corresponding frequency waveforms are as Figure 9 shown.
[0206] It can be seen from the figure that:
[0207] During the t1 period: 3 inverters operate without load, and the system frequency stabilizes at 50 Hz.
[0208] During the t2 period: A 30 kW load is suddenly applied, and the system frequency drops and stabilizes within 0.2 s, indicating that under the action of the PI controller, the system can perform secondary frequency modulation.
[0209] During the t3 period: Converter 1 exits the operation, and the 30 kW load is jointly borne by converters 2 and 3. When the original PI value is used, the system output frequency oscillates and converges to (50 ± 0.02) Hz after about 5 s.
[0210] During the t4 period: The genetic algorithm online identification is started, and the regulator parameters are adaptively optimized. After 1 s, the microgrid frequency is adjusted to maintain at 50 Hz.
[0211] During period t5: Converter 2 stops running, converter 3 independently carries 30kW of load, PI parameters maintain the values of period t4, PI regulator output is immediately saturated, jumping between upper and lower limits, and the corresponding frequency fluctuation also reaches the limit value of ±0.2Hz. The drastic fluctuation of frequency leads to the fluctuation of reference angle in dq conversion, which causes deviation in the calculation of instantaneous value of active power.
[0212] During period t6, after optimizing the regulator parameters online and adaptively adjusting the PI parameter values, the microgrid frequency converges back to the given value of 50 Hz, and the calculation of the instantaneous value of active power also stabilizes back to 30 kW.
[0213] During t7 period, inverter 2 was restarted. The power redistribution during startup caused a slight disturbance to the system frequency, but it recovered quickly.
[0214] Through the above technical scheme, the microgrid secondary frequency adaptive system and control method provided by the present invention obtain the initial equivalent coefficient of the microgrid and encode it to form a population, use a genetic algorithm to calculate the fitness function value of the population, and obtain the optimal solution of the equivalent coefficient, proportional coefficient and integral coefficient based on the fitness function value, and finally adjust the distributed power of the microgrid according to the optimal solution to achieve rapid frequency modulation of the microgrid system, which is beneficial to the rapid recovery of the microgrid frequency and ensures the stability of the microgrid system.
[0215] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0216] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A control method for secondary frequency self - adaptation of a micro - grid, characterized in that, Including: Obtain the initial equivalent coefficient, proportional coefficient, and integral coefficient of the microgrid; Encode according to the initial equivalent coefficient to obtain an initial population; Use a genetic algorithm to calculate the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient based on the population, where the genetic algorithm includes: Calculate the fitness function value of the population according to formulas (2) to (4); where Fitness is the fitness function value, i is an integer number, f(i) is the frequency value calculated according to the i-th individual, f′(i) is the sampled frequency value, and n is the number of individuals in the population; f(i) = Af(i - 2) + Bf(i - 1) + CP(i - 1) + DP(i - 2), (2) Among them, K m is the initial equivalent coefficient, K p is the initial proportional coefficient, K i is the initial integral coefficient, h is the sampling step, τ is the sampling period, and P(i - 1) is the power value of the (i - 1)-th individual; Adjust the distributed power of the microgrid according to the optimal solutions.
2. The control method according to claim 1, wherein Encoding according to the initial equivalent coefficient to obtain an initial population includes: Randomly initialize multiple values according to the initial equivalent coefficient to form an equivalent coefficient set; Perform binary encoding on each value in the equivalent coefficient set to form a basic population; Calculate the Gray code of each individual in the population according to formula (8); B = b m b m-1 …b2b1, G = g m g m-1 …g2g1, Among them, B is the binary code, G is the Gray code, m is the number of encoding bits and is an integer number, and g m is the encoding value of the m-th bit of the Gray code, and b m is the encoding value of the m-th bit of the binary code, and g i is the encoding value of the i-th bit of the Gray code, and b i is the encoding value of the i-th bit of the binary code, and b i+1 is the encoding value of the (i + 1)-th bit of the binary code, where i is an integer number; Form an initial population according to the Gray code of each individual in the population.
3. The control method according to claim 2, wherein Using a genetic algorithm to calculate the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient based on the population includes: Calculate the fitness function value of the population; Judge whether the fitness function value of the population is less than or equal to a preset threshold; When it is judged that the fitness function value of the population is greater than the preset threshold, select a new generation of individuals with the same number as the population according to the fitness function value of each individual in the population; Perform replication operation, crossover operation, and mutation operation on the selected new generation of individuals to form a new generation of population; And return to the step of calculating the fitness function value of the population again.
4. The control method according to claim 3, characterized in that Using a genetic algorithm to calculate the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient based on the population includes: When it is judged that the fitness function value of the population is less than or equal to the preset threshold, select the minimum value of the fitness function value of a single individual in the population; Identify the optimal equivalent coefficient corresponding to the minimum value; Calculate the corresponding proportional coefficient and integral coefficient according to the optimal equivalent coefficient; Adjust the distributed power of the microgrid according to the equivalent coefficient, proportional coefficient, and integral coefficient.
5. The control method according to claim 2, wherein Using a genetic algorithm to calculate the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient based on the population includes: Preset an iteration number threshold; Judge whether the current iteration number is greater than or equal to the iteration number threshold; When it is judged that the current iteration number is less than the iteration number threshold, select a new generation of individuals with the same number as the population according to the fitness function value of each individual in the population; Perform replication operation, crossover operation, and mutation operation on the selected new generation of individuals to form a new generation of population; And return to the step of calculating the fitness function value of the population again.
6. The control method according to claim 5, wherein Using a genetic algorithm to calculate the optimal solutions of the equivalent coefficient, proportional coefficient, and integral coefficient based on the population includes: When it is determined that the number of iterations at this time is greater than or equal to the iteration number threshold, select the minimum value of the fitness function values of individual individuals in the population; Identify the optimal equivalent coefficient corresponding to the minimum value; Calculate the corresponding proportional coefficient and integral coefficient according to the optimal equivalent coefficient; Adjust the distributed power of the microgrid according to the equivalent coefficient, proportional coefficient and integral coefficient.
7. The control method according to claim 3 or 5, characterized in that, The replication operation and the crossover operation include: Replicate the population according to formula (11) to form a new generation of population, G i+1 = G i , (11) Among them, G i+1 is the (i + 1)-th generation Gray code, and G i is the i-th generation Gray code, where i is an integer number; Crossover the population according to formula (12) to form a new generation of population, G ij = g mij g (m-1)ij … g 2ij g 1ij , G in = g min g (m-1)in … g 2in g 1in , G (i+1)j = g min g (m-1)in … g 2ij g 1ij , G (i+1)n = g mij g (m-1)ij … g 2in g 1in , (12) Among them, G ij is the j-th Gray code in the i-th generation population, and G in is the n-th Gray code in the i-th generation population, and G (i+1)j is the j-th Gray code in the (i + 1)-th generation population, and G (i+1)n is the n-th Gray code in the (i + 1)-th generation population, where j and n are integer numbers.
8. The control method according to claim 3 or 5, characterized in that, The mutation operation includes: Randomly select multiple individuals from the current population as the individuals to be mutated; For each of the individuals to be mutated, randomly select multiple coding bits in the individual to be mutated as the positions to be mutated; Replace the current coding value with the inverse code of the corresponding coding value at the position to be mutated.
9. The control method according to claim 4 or 6, characterized in that, Calculating the corresponding proportional coefficient and integral coefficient according to the equivalent coefficient corresponding to each individual in the new generation of population includes: Calculate the proportional coefficient according to formula (13); where K p is the proportionality coefficient, and K m is the identified equivalent coefficient, and τ is the time constant; Calculate the integral coefficient according to formula (14), Among them, K i is the integral coefficient; Obtain the open-loop transfer function of the secondary frequency modulation control system according to formula (15), where G OP (s) is the open-loop transfer function, K z is the equivalent output characteristic, 10. A secondary frequency adaptive system for a microgrid, characterized in that, including: A photovoltaic unit (01) for photovoltaic power generation; A wind power unit (02) for wind power generation; A plurality of energy storage converters (06), the plurality of energy storage converters (06) are connected in parallel and are respectively connected to the photovoltaic unit (01) and the wind power unit (02); A storage device (04) connected to the plurality of energy storage converters (06) for storing the electric energy generated by the photovoltaic unit (01) and the wind power unit (02); An intelligent switch (07), one end of which is connected to one of the energy storage converters (06), and the other end is used to be connected to the power grid (08); A plurality of loads (03) connected to the energy storage converter (06); A microgrid central controller (05) for executing the control method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Microgrid power flow calculating method taking secondary voltage and frequency control into consideration
CN106374498A
Gene sequence optimization method , device and equipment and medium
CN111883208A