PR controller parameter optimization method based on whale algorithm and related equipment

Through the PR controller parameter optimization method based on whale algorithm, the problems of large computing resource consumption and complex parameter adjustment in F-type three-level grid-connected inverter control are solved, and the system response speed is improved and the steady-state error is reduced, which significantly improves the system performance.

CN119543280APending Publication Date: 2025-02-28XIAN ELECTRIC POWER COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411637609.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

When controlling the F-type three-level grid-connected inverter, the existing PR control measures consume large computing resources and complex parameter adjustments, resulting in slow system response and large steady-state errors, which seriously affects system performance.

Method used

The PR controller parameter optimization method based on whale algorithm is adopted. By establishing a model of the F-type three-level grid-connected inverter, the reference current and actual current under the αβ coordinate system are obtained, and the performance index function is constructed, and the whale algorithm is iteratively solved to optimize the parameters of the PR controller.

Benefits of technology

It significantly reduces computing resource consumption, improves system response speed and stability, reduces overshoot and fluctuations, improves optimization efficiency, and improves the performance of F-type three-level grid-connected inverter.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119543280A_ABST
    Figure CN119543280A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of grid-connected inverter control, and discloses a PR controller parameter optimization method based on the whale algorithm and related equipment.The method comprises the steps that firstly, a reference current and an actual current under an alpha-beta coordinate system are obtained through an established model of an F-type three-level grid-connected inverter with a PR controller as a control framework; constructing a performance index function by taking an absolute error generated by comparing the two values and system operation time as optimization targets; therefore, the steady-state error and the control time can be integrated, quick response of the system can be ensured, overshoot is reduced, and fluctuation is relieved; and finally, solving optimization parameters of the PR controller in combination with the whale algorithm. The method has a strong global search capability and a fast convergence rate, effectively solves the problems of complex parameter adjustment and long time consumption of the PR controller, can quickly find the optimal parameter combination, significantly reduces the consumption of computing resources, and improves the optimization efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of grid-connected inverter control, specifically to the field of F-type three-level grid-connected inverter parameter optimization, and in particular to a PR controller parameter optimization method based on a whale algorithm and related equipment. Background Art

[0002] With the rise and maturity of distributed power generation technology, the capacity of distributed photovoltaic grid-connected power generation has been continuously improved, and the distribution network has shown different characteristics from the traditional ones. It has gradually developed from a "passive network" to an "active network", and the direction of the system flow has changed; at the same time, the voltage over-limit, fluctuation, and harmonics caused by the access of distributed photovoltaic power generation have become more prominent. As the core device of the distributed photovoltaic system, the nonlinear characteristics of the inverter lead to harmonic distortion problems. In the case of drastic changes in sunlight, the harmonic content on the grid-connected side is high, which affects the safe operation of the distribution network and causes the deterioration of the power supply quality. The control parameters of the photovoltaic inverter will lead to different harmonic characteristics. Within the stable operation range of the photovoltaic system, the background harmonics of the power grid can be resisted and the harmonic distortion rate can be reduced by reasonably selecting the control parameters.

[0003] With its high efficiency and low loss, the F-type three-level grid-connected inverter has shown broad application prospects in the new energy converter market and is expected to become a key technology choice to promote the efficient use and economic deployment of green energy. However, for the F-type three-level grid-connected inverter using PR control, the implementation and optimization of the PR controller requires more computing resources, especially when performing simulation and parameter optimization, which may require higher computing power and time. The PR controller needs to adjust multiple parameters (such as proportional gain, resonant gain, resonant frequency, and cutoff frequency). The selection and optimization of these parameters are relatively complex and need to be fine-tuned according to the specific application scenario.

[0004] It can be seen that the existing PR control measures, when controlling the F-type three-level grid-connected inverter, have the phenomenon of large computing resource consumption and complex parameter adjustment, resulting in slow system response and large steady-state error, which has a great impact on system performance. Summary of the invention

[0005] The purpose of the present invention is to provide a PR controller parameter optimization method based on the whale algorithm and related equipment to solve the technical problem that when using existing PR control measures to control the F-type three-level grid-connected inverter, there is a large consumption of computing resources and complex parameter adjustment, which leads to slow system response and large steady-state error, greatly affecting the system performance.

[0006] In order to achieve the above object, the present invention adopts the following technical solution: A PR controller parameter optimization method based on a whale algorithm, comprising: Establish an F-type three-level grid-connected inverter model with a PR controller as the control architecture, and obtain the reference current in the αβ coordinate system and the actual current in the αβ coordinate system of the inverter model; Based on the absolute error generated by comparing the reference current in the αβ coordinate system and the actual current in the αβ coordinate system and the system operation time, a performance index function is constructed; The whale algorithm is used to iteratively solve the performance index function until the maximum number of iterations is reached, and the current optimal solution is output as the optimization parameter of the PR controller.

[0007] Furthermore, the steps for obtaining the reference current in the αβ coordinate system of the inverter model are as follows: DSOGI-FLL is used to collect the phase information of the grid voltage, and the reference current of the inverter model in the dq coordinate system is set according to the phase information of the grid voltage, and the reference current in the αβ coordinate system is calculated; The steps for obtaining the actual current in the αβ coordinate system of the inverter model are as follows: The three-phase current is collected from the power grid and the actual current in the αβ coordinate system is obtained by Clark transformation.

[0008] Furthermore, the process of comparing the reference current in the αβ coordinate system with the actual current in the αβ coordinate system is as follows: The actual current in the αβ coordinate system is compared with the reference current in the αβ coordinate system, and the obtained error signal is input into the PR controller; The PR controller generates a reference voltage of the grid according to the error signal, and adjusts the output of the inverter based on the reference voltage of the grid, so that the actual current in the αβ coordinate system tracks the reference current in the αβ coordinate system.

[0009] Furthermore, the specific steps of constructing the performance indicator function are as follows: The integral of the product of the absolute error and the system running time is used as the performance index to construct a performance index function, where the performance index function is expressed as:

[0010] In the formula, The upper limit of the integral time; is the input value of the PR controller; t is the system running time.

[0011] Furthermore, the steps of iteratively solving the performance indicator function using the whale algorithm are as follows: Initialize the number of whales and the maximum number of iterations; The main loop of the whale algorithm for solving the performance index function is started based on the number of whales and the maximum number of iterations until the maximum number of iterations is reached; wherein the main loop includes the encirclement and predation phase, the spiral position update phase and the prey search phase.

[0012] Furthermore, the specific steps of the encirclement and predation phase, the spiral position update phase and the prey search phase include: The mathematical model of the encirclement and predation stage is as follows:

[0013]

[0014] In the formula, is the current optimal solution, is the individual's current location, is the number of iterations; Indicates the length between the individual and the current best solution; if Show better location information, then update Location; and They are coefficient vectors: The mathematical model of the spiral update position phase is as follows:

[0015]

[0016] In the formula, is the distance between the target and the individual during this iteration; is a constant that defines the shape of the logarithmic spiral, ; when When , the whale is in the local search stage; introducing random factors , randomly select a method to update ,in ; The mathematical model of the prey search phase is as follows:

[0017]

[0018] In the formula, is the random position information selected from the current population, Represents the search individual distance The moving step length; The whale update position formula is expressed as follows: .

[0019] A PR controller parameter optimization system based on a whale algorithm is used to implement the steps of the PR controller parameter optimization method based on the whale algorithm, including: A model building module is used to build an F-type three-level grid-connected inverter model using a PR controller as a control architecture, and simultaneously obtain a reference current in an αβ coordinate system and an actual current in an αβ coordinate system of the inverter model; A performance indicator function building module, used to build a performance indicator function based on an absolute error generated by comparing a reference current in an αβ coordinate system with an actual current in an αβ coordinate system and a system operating time; The parameter optimization module is used to iteratively solve the performance index function using the whale algorithm until the maximum number of iterations is reached, and output the current optimal solution as the optimization parameter of the PR controller.

[0020] A device comprising: Memory for storing computer programs; A processor is used to implement the steps of the above-mentioned PR controller parameter optimization method based on the whale algorithm when executing the computer program.

[0021] A computer-readable storage medium stores a computer program, which, when executed by a processor, is used to implement the steps of the above-mentioned PR controller parameter optimization method based on the whale algorithm.

[0022] A computer program product includes a computer program, which, when executed by a processor, implements the steps of the above-mentioned PR controller parameter optimization method based on the whale algorithm.

[0023] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a PR controller parameter optimization method based on a whale algorithm. The method first obtains the reference current and actual current in the αβ coordinate system by establishing an F-type three-level grid-connected inverter model with a PR controller as the control architecture, and then uses the absolute error generated by the comparison between the two and the system operation time as the optimization target to construct a performance index function; in this way, the steady-state error and the control time can be integrated, which can ensure the rapid response of the system, reduce overshoot and alleviate fluctuations; finally, the optimization parameters of the PR controller are solved in combination with the whale algorithm; the method has a strong global search capability and a fast convergence speed, effectively solves the problem of complex and time-consuming parameter adjustment of the PR controller, can quickly find the optimal parameter combination, significantly reduces the consumption of computing resources, and improves the optimization efficiency. The method not only enhances the performance stability and response speed of the F-type three-level grid-connected inverter, but also provides strong support for its wide application in the field of new energy, and promotes the efficient operation and economic deployment of the green energy conversion system.

[0024] Preferably, in the present invention, the grid voltage phase information is collected by DSOGI-FLL, and the reference current is set in the dq coordinate system based on it, and then converted to the αβ coordinate system, thereby ensuring the accuracy and real-time performance of the reference current; at the same time, the three-phase current is directly collected from the grid and the actual current in the αβ coordinate system is obtained through Clark transformation, which simplifies the data processing process and improves the response speed and accuracy of the system.

[0025] Preferably, in the present invention, the reference current in the αβ coordinate system is compared with the actual current, an error signal is generated and input into the PR controller, thereby achieving precise adjustment of the inverter output; this closed-loop control strategy ensures that the inverter can respond quickly to current changes, thereby improving the stability and dynamic performance of the system.

[0026] Preferably, in the present invention, the constructed performance index function comprehensively considers the absolute error and the system running time, and evaluates the overall performance of the system in an integral form. This design makes the optimization process more comprehensive and objective, and helps to find a parameter combination that can reduce the error and shorten the optimization time.

[0027] Preferably, in the present invention, the whale algorithm is used to iteratively solve the performance index function, and the feasibility and efficiency of the algorithm are ensured by initializing the number of whales and the maximum number of iterations. The whale algorithm, with its powerful global search capability and fast convergence speed, can quickly find the optimal solution under limited computing resources.

[0028] Preferably, in the present invention, the whale algorithm includes three processes: the encirclement and predation stage, the spiral position update stage and the prey search stage. These process steps together constitute the core mechanism of the whale algorithm. By simulating the predation behavior of whales, a comprehensive exploration of the search space and local fine search are achieved; this mechanism ensures the efficiency and robustness of the algorithm in solving complex optimization problems. Specifically, the encirclement and predation stage ensures that the algorithm can quickly approach the optimal solution; the spiral position update stage further refines the quality of the solution through local search; the prey search stage increases the diversity of the algorithm to prevent falling into the local optimal solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 A flowchart of a PR controller parameter optimization method based on a whale algorithm provided in an embodiment of the present invention; Figure 2 The overall control block diagram of the F-type three-level grid-connected inverter provided by the embodiment of the present invention; Figure 3 A schematic diagram of the spiral update position provided by an embodiment of the present invention; Figure 4 The F-type three-level inverter topology structure provided by the embodiment of the present invention; Figure 5 An equivalent block diagram of a PR controller provided by an embodiment of the present invention; Figure 6 A control block diagram of a PR controller provided in an embodiment of the present invention; Figure 7 A structural diagram of a SOGI-based frequency-locked loop (SOGI-FLL) provided in an embodiment of the present invention; Figure 8 A flow chart of a PR controller parameter optimization method based on a whale algorithm provided by the present invention; Fig. 9 A schematic diagram of the structure of a PR controller parameter optimization system based on the whale algorithm provided by the present invention. DETAILED DESCRIPTION

[0030] Example 1 The present invention provides a PR controller parameter optimization method based on the whale algorithm, such as Figure 7 As shown, the following steps are included: Establish an F-type three-level grid-connected inverter model with a PR controller as the control architecture, and obtain the reference current in the αβ coordinate system and the actual current in the αβ coordinate system of the inverter model; Specifically, the steps for obtaining the reference current in the αβ coordinate system of the inverter model are as follows: DSOGI-FLL is used to collect the phase information of the grid voltage, and the reference current in the dq coordinate system is set according to the phase information. The reference current in the αβ coordinate system is calculated by the inverter reference current calculation module; The steps for obtaining the actual current in the αβ coordinate system of the inverter model are as follows: The three-phase current is collected from the power grid and the actual current in the αβ coordinate system is obtained by Clark transformation.

[0031] Based on the absolute error generated by comparing the reference current in the αβ coordinate system with the actual current in the αβ coordinate system and the system operation time, a performance index function is constructed; Here, the process of comparing the reference current in the αβ coordinate system with the actual current in the αβ coordinate system is as follows: The actual current in the αβ coordinate system is compared with the reference current in the αβ coordinate system to obtain an error signal, and the error signal is input into the PR controller; The PR controller generates a reference voltage of the grid according to the error signal to adjust the output of the inverter so that the actual current in the αβ coordinate system tracks the reference current in the αβ coordinate system.

[0032] In this embodiment, the specific steps of constructing the performance indicator function are as follows: The integral of the product of the absolute error and the system running time is used as the performance index to construct a performance index function, where the performance index function is expressed as:

[0033] In the formula, The upper limit of the integral time; is the input value of the PR controller.

[0034] The whale algorithm is used to iteratively solve the performance index function until the maximum number of iterations is reached, and the current optimal solution is output as the optimization parameter of the PR controller.

[0035] The specific steps are as follows: Initialize the number of whales and the maximum number of iterations; The main loop of the whale algorithm for solving the performance index function is started based on the number of whales and the maximum number of iterations until the maximum number of iterations is reached; wherein the main loop includes the encirclement and predation phase, the spiral position update phase and the prey search phase.

[0036] The specific steps of the encirclement and predation phase, the spiral position update phase, and the prey search phase include: The mathematical model of the encirclement and predation stage is as follows:

[0037]

[0038] In the formula, is the current optimal solution, is the individual's current location, is the number of iterations; Indicates the length between the individual and the current best solution; if Show better location information, then update Location; and Defined as:

[0039]

[0040]

[0041] In the formula, is the convergence coefficient, The increase of decreases linearly from 2 to 0; The maximum number of iterations set for the whale algorithm; is a random number between [0,1], by adjusting The value of ;in, Is a linearly decreasing value, set ,but The new position of is defined as With the current Any position in between; The mathematical model of the spiral update position phase is as follows:

[0042]

[0043] In the formula, is the distance between the target and the individual during this iteration; is a constant that defines the shape of the logarithmic spiral, ; when When , the whale is in the local search stage; since the shrinking and encircling mechanism and the spiral update position occur synchronously, it is assumed that the probability of each is 50%; the random factor is introduced , randomly select a method to update ,in ;

[0044] The mathematical model of the prey search phase is as follows:

[0045]

[0046] In the formula, is the random position information selected from the current population, Represents the search individual distance The moving step length; Then, the whale update position formula is expressed as follows: .

[0047] like Figure 8 As shown, the present invention also provides a PR controller parameter optimization system based on the whale algorithm, including: a model building module, used to establish an F-type three-level grid-connected inverter model with a PR controller as a control architecture, and simultaneously obtain the reference current in the αβ coordinate system of the inverter model and the actual current in the αβ coordinate system; a performance indicator function construction module, used to construct a performance indicator function based on the absolute error generated by comparing the reference current in the αβ coordinate system and the actual current in the αβ coordinate system and the system running time; a parameter optimization module, used to iteratively solve the performance indicator function using the whale algorithm until the maximum number of iterations is reached, and output the current optimal solution as the optimization parameter of the PR controller.

[0048] The present invention also provides a device, comprising: a memory for storing a computer program; and a processor for implementing the steps of the PR controller parameter optimization method based on the whale algorithm when executing the computer program.

[0049] When the processor executes the computer program, the above-mentioned steps of optimizing the parameters of the PR controller based on the whale algorithm are implemented, for example: establishing an F-type three-level grid-connected inverter model with a PR controller as a control architecture, and simultaneously obtaining the reference current in the αβ coordinate system of the inverter model and the actual current in the αβ coordinate system; constructing a performance indicator function based on the absolute error generated by comparing the reference current in the αβ coordinate system and the actual current in the αβ coordinate system and the system running time; using the whale algorithm to iteratively solve the performance indicator function until the maximum number of iterations is reached, and outputting the current optimal solution as the optimization parameter of the PR controller.

[0050] Alternatively, when the processor executes the computer program, the functions of each module in the above-mentioned system are implemented, for example: a model building module, which is used to establish an F-type three-level grid-connected inverter model with a PR controller as the control architecture, and simultaneously obtain the reference current in the αβ coordinate system of the inverter model and the actual current in the αβ coordinate system; a performance indicator function construction module, which is used to construct a performance indicator function based on the absolute error generated by comparing the reference current in the αβ coordinate system and the actual current in the αβ coordinate system and the system running time; a parameter optimization module, which is used to iteratively solve the performance indicator function using the whale algorithm until the maximum number of iterations is reached, and output the current optimal solution as the optimization parameter of the PR controller.

[0051] Exemplarily, the computer program can be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments that can complete preset functions, and the instruction segments are used to describe the execution process of the computer program in the PR controller parameter optimization device based on the whale algorithm. For example, the computer program can be divided into a model building module, a performance indicator function building module and a parameter optimization module; the specific functions of each module are as follows: a model building module, which is used to establish an F-type three-level grid-connected inverter model with a PR controller as a control architecture, and simultaneously obtain the reference current in the αβ coordinate system of the inverter model and the actual current in the αβ coordinate system; a performance indicator function building module, which is used to build a performance indicator function based on the absolute error generated by comparing the reference current in the αβ coordinate system and the actual current in the αβ coordinate system and the system running time; a parameter optimization module, which is used to iteratively solve the performance indicator function using the whale algorithm until the maximum number of iterations is reached, and output the current optimal solution as the optimization parameter of the PR controller.

[0052] The PR controller parameter optimization device based on the whale algorithm can be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The PR controller parameter optimization device based on the whale algorithm may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the above is an example of a PR controller parameter optimization device based on the whale algorithm, and does not constitute a limitation on the PR controller parameter optimization device based on the whale algorithm. It may include more components than the above, or a combination of certain components, or different components. For example, the PR controller parameter optimization device based on the whale algorithm may also include input and output devices, network access devices, buses, etc.

[0053] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The processor is the control center of the PR controller parameter optimization based on the whale algorithm, and uses various interfaces and lines to connect the various parts of the entire PR controller parameter optimization device based on the whale algorithm.

[0054] The memory can be used to store the computer program and / or module, and the processor implements various functions of the PR controller parameter optimization device based on the whale algorithm by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory.

[0055] The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0056] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the PR controller parameter optimization method based on the whale algorithm are implemented.

[0057] The module / unit integrated in the PR controller parameter optimization system based on the whale algorithm can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product.

[0058] Based on such understanding, the present invention implements all or part of the processes in the above-mentioned PR controller parameter optimization method based on the whale algorithm, and can also be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned PR controller parameter optimization method based on the whale algorithm when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or preset intermediate form, etc.

[0059] The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0060] It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electrical carrier signals and telecommunication signals.

[0061] The present invention will be further described below in conjunction with the embodiments and drawings: Example 2 As described in the background technology, the implementation and optimization of the PR controller of the F-type three-level grid-connected inverter using PR control requires more computing resources, especially when performing simulation and parameter optimization, which may require higher computing power and time. The PR controller needs to adjust multiple parameters (such as proportional gain, resonant gain, resonant frequency and cutoff frequency). The selection and optimization of these parameters are relatively complex and need to be fine-tuned according to the specific application scenario. The PR controller is different from the PID controller, and its control is more complex. The existing PR control measures have the phenomenon of large computing resource consumption and complex parameter adjustment when controlling the F-type three-level grid-connected inverter, resulting in slow system response and large steady-state error, which has a great impact on system performance.

[0062] In order to achieve the above-mentioned purpose, the present invention provides a PR controller parameter optimization method based on the whale algorithm. The method realizes efficient optimization of the PR controller parameters by integrating the F-type three-level grid-connected inverter model with the whale algorithm, and designs a comprehensive performance indicator function based on absolute error and system running time, so as to comprehensively evaluate the system performance.

[0063] like Figure 1 As shown, this embodiment provides a PR controller parameter optimization method based on the whale algorithm, which specifically includes: The first step is to establish a model of an F-type three-level photovoltaic grid-connected inverter, in which PR control is used as the control architecture of the inverter.

[0064] like Figure 4 As shown, Figure 4 It is an F-type three-level photovoltaic grid-connected inverter topology; Figure 5 As shown, Figure 5 is the equivalent block diagram of the PR controller, Figure 6 This is the control block diagram of the PR controller.

[0065] Another example Figure 4 As shown, in this example, the inverter used is an F-type three-level inverter, and its topology adopts , and As an LCL filter, the inverter's control quantity is the grid current , reference current The phase information of the grid voltage is collected by DSOGI-FLL This can make the phase of the reference current synchronized with the grid voltage phase. and By comparing the input value of the PR controller, the equivalent block diagram of the PR controller is as follows: Figure 5As shown. The PR controller outputs a three-phase reference voltage , the control block diagram of the PR controller is as follows Figure 6 Then the output three-phase reference voltage Input DPWM module to control the on and off of the switch tube to achieve closed-loop control. Set the maximum number of iterations , the number of whale populations =20; DC bus voltage is =600V, output line voltage is 380V, maximum output power is 2.2kW, switching frequency is 100kHz, capacitor ,inductance , .

[0066] Among them, DSOGI-FLL, or Dual Second-Order Generalized Integrator Frequency-Locked Loop, is a frequency-locking technology widely used in power electronics, signal processing, and control systems. DSOGI-FLL consists of two second-order generalized integrator (SOGI) modules and a frequency-locked loop (FLL) module. The SOGI module can extract the orthogonal components of the input signal and generate an estimate of the frequency and phase of the input signal. The FLL module adjusts its internal parameters according to the output of the SOGI module to lock the frequency of the input signal.

[0067] Step 2: Initialize the number of whales , set the maximum number of iterations .

[0068] Step 3: Use DSOGI-FLL (Dual Second-Order Generalized Integrator-Frequency Locked Loop) to collect the phase information of the grid voltage , and set the reference current in the dq rotating coordinate system , calculated by the inverter reference current calculation module Reference current in coordinate system Then the three-phase current collected from the power grid is transformed by Clark to obtain Current in coordinate system .

[0069] Among them, the frequency-locked loop structure of SOGI of DSOGI-FLL is as follows Figure 7 shown.

[0070] Step 4: and After comparison, the error signal is input into the PR controller to generate an error signal, and the reference voltage of the power grid is obtained based on the error signal. The integral of the absolute error and the time product between the two is used as the performance index function to optimize the algorithm. This performance index integrates the steady-state error and the control time to ensure the system's rapid response, reduce overshoot, and alleviate fluctuations. That is: (1) In the formula, The upper limit of the integral time; It is the input value of PR control.

[0071] Combination Figure 2 As shown, Figure 2 This is the overall control block diagram of the F-type three-level grid-connected inverter.

[0072] Step 5: The initial position of the whale is used as the parameter of the PR controller of the F-type three-level inverter. The most suitable whale position is calculated as the initial optimal solution through the performance index function. The optimal solution corresponding to it ; Step 6: Start entering the main loop of the whale algorithm. If , then update the position of the whale population according to formula (2). If , then the position of the whale population is updated according to formula (10). If , then the position of the whale population is updated according to formula (9).

[0073] Among them, the steps of the whale algorithm main loop are as follows Figure 1 shown.

[0074] In this embodiment, in order to better understand the technical solution of the present invention, the principle of the whale algorithm is further explained: The Whale Optimization Algorithm (WOA) was proposed by Australian researcher Mirjalili in 2016. It is a new type of swarm intelligence optimization algorithm. WOA abstracts the bubble net hunting method of humpback whales into an algorithm through mathematical modeling. The optimization mechanism is roughly divided into three stages: prey search stage, encirclement hunting stage and spiral position update stage. The algorithm has the advantages of simple principle, easy programming implementation, excellent performance in solving optimization problems, and wide application range.

[0075] Therefore, the above main cycle steps include three stages: the encirclement predation stage, the spiral position update stage and the prey search stage, specifically: 1. Encirclement and predation stage Since the optimal solution position of the optimization design is unknown in the search space in advance, that is, when whales are looking for prey, they may not know the exact location of the prey. They must use the information exchange mechanism of their own species to ensure that the entire group moves to the position of a certain whale (the whale closest to the prey), and regard the position of the whale as the current optimal solution. Then, the whale currently closest to the prey gradually approaches the prey in a random manner, indirectly causing the entire group of whales to approach the prey. The mathematical model of the encirclement predation stage is: (2) (3) In the formula, is the current optimal solution, is the individual's current location, is the number of iterations. Indicates the length between the individual and the current best solution. Show better location information, then update Location. and Defined as: (4) (5) (6) In the formula, is the convergence coefficient, The increase of decreases linearly from 2 to 0; The maximum number of iterations set for the whale algorithm. is a random number between [0,1], by adjusting The value of Known Is a linearly decreasing value, set ,but The new position of is defined as With the current Any position between , that is to say, the whale is always active in the shrinking encirclement, and the search agent is in the local search stage.

[0076] 2. Spiral update position phase By calculating individual With the goal The relative distance between the humpback whale and the humpback whale is calculated by establishing a spiral motion equation to simulate the spiral movement of the humpback whale. Figure 3 As shown, the mathematical model is as follows: (7) (8) In the formula, is the distance between the target and the individual during this iteration; is a constant that defines the shape of the logarithmic spiral, .

[0077] From the formula, we can see that when When , the whale is in the local search phase. Since the shrinking and encircling mechanism and the spiral position update occur synchronously, it is assumed that the probability of each is 50%. The introduction of random factors , randomly select a method to update ,in .Right now: (9) 3. Searching for prey The Whale Algorithm (WOA) is based on the coefficient vector The value of is used to determine whether the whale is currently in the stage of contraction and encirclement or the stage of searching for prey. When As the reference value of this updated position. Its mathematical model can be expressed as: (10) (11) In the formula, is the random position information selected from the current population, Represents the search individual distance The moving step length.

[0078] In summary, the whale update position formula can be expressed as follows: (12) Step 7: After updating the position, calculate the target fitness value for all whales and compare it with the previous initial optimal solution. , then replace .

[0079] Step 8: Determine whether the maximum number of iterations has been reached. If so, terminate the iteration, output the current optimal solution and use the optimal solution as the optimization parameter of the PR controller. Otherwise, go to step 5 to continue iterating.

[0080] In summary, the present invention provides a PR controller parameter optimization method based on the whale algorithm, which has the following advantages over existing PR control measures: This method constructs a model of an F-type three-level photovoltaic grid-connected inverter, adopts a PR control architecture, combines the DSOGI-FLL technology to collect grid voltage phase information, and uses the whale optimization algorithm for parameter optimization to achieve precise control of the inverter output current; this method improves the stability and response speed of the system by designing a reasonable performance indicator function, significantly reduces the consumption of computing resources, and improves the optimization efficiency.

[0081] The above embodiment is only one of the implementation methods that can realize the technical solution of the present invention. The scope of protection claimed by the present invention is not limited only to this embodiment, but also includes changes, replacements and other implementation methods that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention.

Claims

1. A PR controller parameter optimization method based on the whale algorithm, characterized in that: include: Establish an F-type three-level grid-connected inverter model with a PR controller as the control architecture, and obtain the reference current in the αβ coordinate system and the actual current in the αβ coordinate system of the inverter model; Based on the absolute error generated by comparing the reference current in the αβ coordinate system and the actual current in the αβ coordinate system and the system operation time, a performance index function is constructed; The whale algorithm is used to iteratively solve the performance index function until the maximum number of iterations is reached, and the current optimal solution is output as the optimization parameter of the PR controller.

2. The PR controller parameter optimization method based on the whale algorithm according to claim 1 is characterized in that: The steps for obtaining the reference current in the αβ coordinate system of the inverter model are as follows: DSOGI-FLL is used to collect the phase information of the grid voltage, and the reference current of the inverter model in the dq coordinate system is set according to the phase information of the grid voltage, and the reference current in the αβ coordinate system is calculated; The steps for obtaining the actual current in the αβ coordinate system of the inverter model are as follows: The three-phase current is collected from the power grid and the actual current in the αβ coordinate system is obtained by Clark transformation.

3. The PR controller parameter optimization method based on the whale algorithm according to claim 1 is characterized in that: The process of comparing the reference current in the αβ coordinate system with the actual current in the αβ coordinate system is as follows: The actual current in the αβ coordinate system is compared with the reference current in the αβ coordinate system, and the obtained error signal is input into the PR controller; The PR controller generates a reference voltage of the grid according to the error signal, and adjusts the output of the inverter based on the reference voltage of the grid, so that the actual current in the αβ coordinate system tracks the reference current in the αβ coordinate system.

4. The PR controller parameter optimization method based on the whale algorithm according to claim 1 is characterized in that: The specific steps of constructing the performance indicator function are as follows: The integral of the product of the absolute error and the system running time is used as the performance index to construct a performance index function, where the performance index function is expressed as: In the formula, The upper limit of the integral time; is the input value of the PR controller; t is the system running time.

5. The PR controller parameter optimization method based on the whale algorithm according to claim 1 is characterized in that: The steps for iteratively solving the performance indicator function using the whale algorithm are as follows: Initialize the number of whales and the maximum number of iterations; The main loop of the whale algorithm for solving the performance index function is started based on the number of whales and the maximum number of iterations until the maximum number of iterations is reached; wherein the main loop includes the encirclement and predation phase, the spiral position update phase and the prey search phase.

6. The PR controller parameter optimization method based on the whale algorithm according to claim 5 is characterized in that: The specific steps of the encirclement and predation phase, spiral position update phase, and prey search phase include: The mathematical model of the encirclement and predation stage is as follows: In the formula, is the current optimal solution, is the individual's current location, is the number of iterations; Indicates the length between the individual and the current best solution; if Show better location information, then update Location; and They are coefficient vectors: The mathematical model of the spiral update position phase is as follows: In the formula, is the distance between the target and the individual during this iteration; is a constant that defines the shape of the logarithmic spiral, ; when When , the whale is in the local search stage; introducing random factors , randomly select a method to update ,in ; The mathematical model of the prey search phase is as follows: In the formula, is the random position information selected from the current population, Represents the search individual distance The moving step length; The whale update position formula is expressed as follows: 。 7. A PR controller parameter optimization system based on a whale algorithm, used to implement the steps of the PR controller parameter optimization method based on a whale algorithm according to any one of claims 1 to 6, characterized in that: include: A model building module is used to build an F-type three-level grid-connected inverter model using a PR controller as a control architecture, and simultaneously obtain a reference current in an αβ coordinate system and an actual current in an αβ coordinate system of the inverter model; A performance indicator function building module, used to build a performance indicator function based on an absolute error generated by comparing a reference current in an αβ coordinate system with an actual current in an αβ coordinate system and a system operating time; The parameter optimization module is used to iteratively solve the performance index function using the whale algorithm until the maximum number of iterations is reached, and output the current optimal solution as the optimization parameter of the PR controller.

8. A device, characterized in that include: Memory for storing computer programs; A processor, used to implement the steps of the PR controller parameter optimization method based on the whale algorithm as described in any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it is used to implement the steps of the PR controller parameter optimization method based on the whale algorithm as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the PR controller parameter optimization method for the whale algorithm described in any one of claims 1 to 6 are implemented.