A grid-connected inverter multi-parameter online setting method, system, device and medium
By establishing a simulation model of the grid-connected inverter circuit and searching for target control parameters using the particle swarm optimization algorithm, and combining long short-term memory networks and artificial neural network feature extraction, the problems of long parameter tuning time and real-time measurement of grid impedance in grid-connected inverters are solved, and fast and stable control parameter tuning is achieved.
Patent Information
- Application Number
- CN202511079552.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-08-04
AI Technical Summary
Existing methods for setting parameters of grid-connected inverters involve long parameter adjustment times or require real-time measurement of grid impedance, which increases the risk of system instability.
A circuit simulation model of a grid-connected inverter is established. The target control parameters are iteratively searched using the particle swarm optimization algorithm, and a parameter inference model is constructed. Current features are extracted using long short-term memory networks and artificial neural networks to achieve offline training and online tuning.
It enables rapid tuning of grid-connected inverter control parameters, avoids the pressure of real-time search, and ensures stable operation of the system under dynamic grid conditions.
Smart Images

Figure CN120566582B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power electronic converter technology, and in particular to a method, system, device and medium for online multi-parameter tuning of a grid-connected inverter. Background Technology
[0002] With the real-time changes in grid impedance and the increase in the number of grid-connected inverters, the interaction between grid-connected inverters and the grid is significantly enhanced, leading to an increased risk of instability in the grid-connected inverter system. Studies have shown that the main reason for this instability is that the current control loop and phase-locked loop with fixed gain cannot adapt to the dynamic changes in grid operating conditions.
[0003] In contrast, grid-connected inverters with online control parameter tuning capabilities are better suited to dynamic grid conditions. Online parameter tuning can be achieved using analytical modeling methods. For example, stability criteria can be used to analytically derive the stability boundary of the control loop bandwidth, or a design criterion for the control loop gain can be designed to maintain constant bandwidth and phase margin when grid impedance changes. However, such analytical parameter adjustment strategies rely on small-signal models and real-time grid impedance measurements. This presents the following limitations: 1. Traditional small-signal models typically ignore key nonlinear factors affecting system stability, such as switching effects, phase-locked loop dynamic characteristics, and harmonic control, and the modeling complexity of multi-parallel inverter systems increases significantly; 2. Online impedance measurement requires a trade-off between response speed, measurement accuracy, and disturbance magnitude, limiting its online real-time application.
[0004] Data-driven parameter tuning methods are gradually becoming a viable alternative: online parameter tuning methods based on the Particle Swarm Optimization (PSO) algorithm have been successfully applied to outer-loop power control and DC bus voltage control. These methods use the integral time absolute error as the fitness function to ensure a fast and smooth system response to disturbances. However, while these methods do not require precise small-signal models and real-time impedance measurements, the tuning time is relatively long because each iteration requires substituting particle values into the proportional-integral controller and calculating the fitness function based on the system's operating data over a period of time. Another type of artificial neural network (ANN) combines online parameter search technology to map the control parameters of the current control loop and phase-locked loop to the closed-loop pole locations, minimizing the deviation between the actual poles and the reference poles under dynamic grid conditions to maintain stability. However, this type of method requires real-time measurement of grid impedance. Summary of the Invention
[0005] The purpose of this invention is to provide a method, system, device and medium for online multi-parameter tuning of grid-connected inverters, which can solve the problems of long parameter tuning time or the need for real-time measurement of grid impedance in existing parameter tuning methods.
[0006] To address the aforementioned technical problems, embodiments of the present invention provide a method for online tuning of multiple parameters of a grid-connected inverter, comprising the following steps:
[0007] Establish a circuit simulation model for the grid-connected inverter;
[0008] The output current of the grid-connected inverter under different grid impedance conditions is obtained by circuit simulation model, and the target control parameters of the grid-connected inverter under different grid impedance conditions are obtained by iterative search using particle swarm optimization algorithm through circuit simulation model.
[0009] The parameter inference model is trained offline by using the output current of the grid-connected inverter under different grid impedance conditions and the target control parameters under the corresponding grid impedance conditions.
[0010] The output current of the grid-connected inverter is acquired in real time, and the acquired output current is input into the trained parameter inference model to obtain the corresponding target control parameters.
[0011] The control parameters of the grid-connected inverter are tuned online using the target control parameters output by the parametric inference model.
[0012] Optionally, the fitness function of the particle swarm optimization algorithm is based on the grid-connected inverter's response to changes in grid impedance. d The time required for the shaft output current to enter and remain within the preset steady-state value tolerance range is calculated using the following formula:
[0013] ;
[0014] In the formula, T i ( k ) indicates the first k In the next iteration, particles i fitness value, t s express d Shaft output current i d The moment when it enters and remains within the preset steady-state value's allowable error range, t 0 indicates the moment of sudden change in grid impedance. I dref express i d The steady-state value.
[0015] Optionally, the search steps of the particle swarm optimization algorithm are as follows:
[0016] S1: Initialize the particle swarm size, the initial velocity and initial position of each particle, the search range of the control parameters, and the maximum number of iterations;
[0017] S2: Initialize the circuit simulation model with the grid impedance before the sudden change;
[0018] S3: Input the position of each particle into the circuit simulation model in sequence, run the circuit simulation model, and record the real-time running data;
[0019] S4: Calculate the fitness value of each particle based on real-time running data and the fitness function;
[0020] S5: Update the individual optimal solution and the global optimal solution, including the update content of velocity, position and fitness value;
[0021] S6: Update the velocity and position of each particle in the next iteration;
[0022] S7: Determine whether the fitness of the global optimal solution is less than the preset strict threshold. If yes, execute S11; otherwise, execute S8.
[0023] S8: Increment the iteration count by 1;
[0024] S9: Determine if the maximum number of iterations has been reached. If yes, execute S10; otherwise, return to S3.
[0025] S10: Determine whether the fitness of the global optimal solution is less than the preset leniency threshold. If yes, execute S11; otherwise, end the algorithm.
[0026] S11: Save the global optimal solution, including velocity, position and corresponding grid impedance;
[0027] S12: Set the global optimal solution as one of the initial particles under the new grid impedance condition, and reset the iteration count;
[0028] S13: Update the grid impedance of the circuit simulation model by increasing the grid impedance in fixed steps to establish a new grid impedance condition, and return to S3.
[0029] Optionally, the network structure of the parameter inference model consists of a long short-term memory network and an artificial neural network. The step of inputting the real-time acquired output current into the trained parameter inference model to obtain the corresponding target control parameters includes:
[0030] The output current acquired in real time is extracted using two long short-term memory networks. d Shaft output current and q Timing characteristics of shaft output current;
[0031] Extracted using a two-layer artificial neural network d Shaft output current and q Global characteristics of shaft output current;
[0032] By fusing temporal features and global features, a fused feature is obtained.
[0033] A four-layer artificial neural network outputs the corresponding target control parameters based on the fused features.
[0034] Optionally, before inputting the real-time acquired output current into the trained parameter inference model, the method further includes:
[0035] Determine the output current acquired in real time d The shaft output current is relative to the preset value. d The deviation of the steady-state value of the shaft output current exceeds the preset deviation threshold.
[0036] Optionally, the offline training of the parameter inference model using the output current of the grid-connected inverter under different grid impedance conditions and the corresponding target control parameters under the grid impedance conditions includes:
[0037] The target control parameters of the grid-connected inverter under different grid impedance conditions are used as multiple labels, and a lookup table is established to correspond one-to-one between the labels and the target control parameters.
[0038] The parameter inference model is trained offline by using the output current of the grid-connected inverter under different grid impedance conditions and the corresponding multiple labels.
[0039] The step of inputting the real-time acquired output current into the trained parameter inference model to obtain the corresponding target control parameters includes:
[0040] The real-time acquired output current is input into the trained parameter inference model to obtain the corresponding label;
[0041] The corresponding target control parameters are retrieved from the lookup table based on the labels output by the parameter inference model.
[0042] Optionally, the control parameters of the grid-connected inverter include: the proportional gain and integral gain of the current control loop and the proportional gain and integral gain of the phase-locked loop.
[0043] Embodiments of the present invention also provide a multi-parameter online tuning system for a grid-connected inverter, comprising:
[0044] The simulation model building module is used to build a circuit simulation model of the grid-connected inverter;
[0045] The control parameter search module is used to obtain the output current of the grid-connected inverter under different grid impedance conditions through the circuit simulation model, and to obtain the target control parameters of the grid-connected inverter under different grid impedance conditions through the particle swarm optimization algorithm iterative search using the circuit simulation model.
[0046] The optimized model training module is used to train the parameter inference model offline by using the output current of the grid-connected inverter under different grid impedance conditions and the target control parameters under the corresponding grid impedance conditions.
[0047] The control parameter acquisition module is used to acquire the output current of the grid-connected inverter in real time and input the acquired output current into the trained parameter inference model to obtain the corresponding target control parameters.
[0048] The control parameter tuning module is used to tune the control parameters of the grid-connected inverter online using the target control parameters output by the parameter inference model.
[0049] Embodiments of the present invention also provide a computer device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described online multi-parameter tuning method for grid-connected inverters.
[0050] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described online multi-parameter tuning method for grid-connected inverters.
[0051] The online multi-parameter tuning method for grid-connected inverters provided by this invention has at least the following beneficial effects:
[0052] By establishing a circuit simulation model of the grid-connected inverter, the output current of the grid-connected inverter under different grid impedance conditions is obtained. Then, the target control parameters of the grid-connected inverter under different grid impedance conditions are obtained by iterative search using the particle swarm optimization algorithm. These target control parameters are the approximately optimal control parameters of the grid-connected inverter under different grid impedance conditions. The target control parameters and the output current constitute an offline dataset for training the parameter inference model. The trained parameter inference model can output the corresponding target control parameters based on the real-time output current of the grid-connected inverter. The control parameters of the grid-connected inverter can be tuned through these target control parameters.
[0053] This invention establishes a mapping relationship between the output current of a grid-connected inverter under different grid impedance conditions and the corresponding control parameters under those conditions. By combining offline pre-calculation using a particle swarm optimization algorithm with online inference using a parameter inference model, parameter tuning is transformed from "real-time search" to "mapping lookup," reducing time consumption and enabling rapid tuning of the grid-connected inverter's control parameters. Furthermore, the parameter tuning using the particle swarm optimization algorithm is performed offline, avoiding online time pressure. Simultaneously, the parameter inference model only uses real-time current as input, requiring no additional variables such as grid impedance. Attached Figure Description
[0054] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0055] Figure 1 A flowchart illustrating a method for online multi-parameter tuning of a grid-connected inverter provided by the present invention;
[0056] Figure 2 A schematic diagram of an LC-type grid-connected inverter provided by the present invention;
[0057] Figure 3 A schematic diagram of an adjustment time definition provided by the present invention;
[0058] Figure 4 A schematic diagram of a PSO-based label marking process provided by the present invention;
[0059] Figure 5 A schematic diagram of a feature fusion model based on LSTM and ANN provided by the present invention;
[0060] Figure 6 This invention provides a schematic flowchart of an online control parameter tuning process.
[0061] Figure 7 This is a schematic diagram of a multi-parameter online tuning method for a grid-connected inverter provided by the present invention. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0063] The technical solutions provided by the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0064] One embodiment of the present invention relates to a method for online tuning of multiple parameters of a grid-connected inverter. The specific process of the online tuning method for multiple parameters of a grid-connected inverter in this embodiment can be as follows: Figure 1 As shown, it includes:
[0065] Step 101: Establish a circuit simulation model of the grid-connected inverter.
[0066] Step 102: Obtain the output current of the grid-connected inverter under different grid impedance conditions through the circuit simulation model, and use the particle swarm optimization algorithm to iteratively search for the target control parameters of the grid-connected inverter under different grid impedance conditions through the circuit simulation model.
[0067] Step 103: The parameter inference model is trained offline by using the output current of the grid-connected inverter under different grid impedance conditions and the target control parameters under the corresponding grid impedance conditions.
[0068] Step 104: Acquire the output current of the grid-connected inverter in real time, and input the acquired output current into the trained parameter inference model to obtain the corresponding target control parameters.
[0069] Step 105: The control parameters of the grid-connected inverter are tuned online using the target control parameters output by the parameter inference model.
[0070] The following is a detailed description of the implementation details of the online multi-parameter tuning method for grid-connected inverters in this embodiment. The following content is only for the convenience of understanding and is not necessary for implementing this solution.
[0071] In step 101, a detailed simulation model of the grid-connected inverter circuit is established using various grid-connected inverter system simulation platforms and hardware-in-the-loop simulation platforms.
[0072] In step 102, the output current of the grid-connected inverter under different grid impedance conditions is obtained by running the circuit simulation model, and the PSO algorithm is used to iteratively search for the approximately optimal control parameters (i.e., target control parameters) of the grid-connected inverter under different grid impedance conditions. At each iteration, the adjustment effect of the control parameters is evaluated by running the circuit simulation model.
[0073] In one example, a finite set of approximately optimal control parameters obtained through the PSO algorithm are used as multiple labels to construct a lookup table that maps parameters to labels one-to-one. These labels, together with the sampled current data (i.e., the output current of the grid-connected inverter under different grid impedance conditions), constitute the offline training dataset for the artificial intelligence model (i.e., the parameter inference model).
[0074] Specifically, Figure 2 This is a schematic diagram of an LC-type grid-connected inverter in this embodiment. Figure 2 It can be seen that the output current of the grid-connected inverter i abc Sampled and through abc / dq Convert to d Axial components ( i d )and q Axial components ( iq That is, the output current of the grid-connected inverter includes d Shaft output current and q Shaft output current. Additionally, the control parameter described in this embodiment is the proportional gain of the current control loop (…). k pi ) and integral gain ( k ii ) and the proportional gain of the phase-locked loop ( k ppll ) and integral gain ( k ipll These are the four control parameters that need to be tuned.
[0075] This embodiment is based on a trial-and-error method, utilizing the PSO algorithm and a detailed circuit simulation model. Different grid impedance change conditions are set, and parameter search is performed within a predefined rule framework. In this process, the position of each particle in the four-dimensional search space represents four control parameters. The rationality of the control parameters is determined by… i d The settling time is used as a fitness function. The settling time is defined as the duration required for the transient response to enter and remain within a preset steady-state value tolerance range (e.g., steady-state value ±2%). Figure 3 As shown, the fitness function of the particle swarm optimization algorithm is based on the grid-connected inverter's response to changes in grid impedance. d The time required for the shaft output current to enter and remain within the preset steady-state value tolerance range.
[0076] in, i d The settling time (fitness function) is defined as:
[0077] ;
[0078] In the formula, T i ( k ) indicates the first k In the next iteration, particles i The adjustment time (fitness value). t s express i d The moment when the value enters and remains within the preset steady-state value tolerance range (e.g., steady-state value ±2%), t 0 indicates the moment of sudden change in grid impedance. I dref express i d The steady-state value, i.e. d Shaft current reference value.
[0079] When the grid impedance changes, if i d If the control parameters converge to within the allowable error range of their steady-state value, then the control parameters are considered feasible. Otherwise, the control parameters are considered insufficient to ensure stable operation of the grid-connected inverter under given operating conditions. Among all feasible solutions, the one with the shortest settling time is considered the optimal solution. It is worth noting that the solution obtained through PSO is an approximate optimal solution.
[0080] Figure 4 The detailed flowchart of the PSO algorithm provided by this invention specifically includes the following steps:
[0081] S1: Perform PSO algorithm initialization, including: particle swarm size ( N ), the initial velocity of each particle ( v i (0) and initial position ( x i (0)), the search range of the four control parameters ( X sr ) and maximum number of iterations ( MaxIt );in i =1,2,…, N ; v i and x i It is a 4×1 vector. X sr It is four-dimensional space (hyperplane);
[0082] S2: Initialize the grid impedance (representing a strong grid) before the abrupt change in the detailed circuit simulation model.
[0083] S3: Input the position of each particle (the values of the four control parameters) into the detailed circuit simulation model in sequence, run the model, and record the real-time running data. i d ;
[0084] S4: Calculate the fitness value for each particle;
[0085] S5: Update the individual optimal solution and the global optimal solution. The update includes: velocity, position and fitness value;
[0086] S6: Update the velocity and position of each particle in the next iteration;
[0087] ;
[0088] ;
[0089] In the formula, w Indicates inertia weight, c 1 andc 2 represents the acceleration coefficient. r 1 and r 2 represents a random number uniformly distributed in the range [0,1]. x p,i Represents particles i The optimal position of an individual x g This represents the global optimal position of all particles;
[0090] S7: Determine whether the fitness of the global optimal solution is less than a preset strict threshold. δ 1 (In this embodiment) δ 1 is set to 0.06s (corresponding to the grid-connected inverter being able to recover stability within three basic cycles). If it is less than 0.06s, it is considered that an approximate optimal solution has been found in advance under the current operating conditions, and S11 is executed; otherwise, S8 is executed.
[0091] S8: Increment the iteration count by 1;
[0092] S9: Determine if the maximum number of iterations has been reached. If it has, execute S10; otherwise, return to S3.
[0093] S10: Determine whether the fitness of the global optimal solution is less than a preset leniency threshold. δ 2 (In this embodiment) δ 2 is set to 5s (corresponding to the grid-connected inverter being able to recover stability within 5s). If it is less than 5s, it is considered that an acceptable approximate optimal solution has been found under the current operating conditions, and S11 is executed; otherwise, the entire program ends.
[0094] S11: Stores the global optimal particle information, including velocity and position, as well as the corresponding grid impedance value;
[0095] S12: Set the globally optimal particle as one of the initial particles for the new round of conditions, and reset the iteration count. k =0;
[0096] S13: Update the grid impedance of the detailed circuit simulation model, increase the grid impedance in fixed steps to establish a new operating condition, and return to S3.
[0097] The grid impedance starts from the initial grid impedance (representing a strong grid) and increases in fixed steps until it reaches a large grid impedance (representing an extremely weak grid) where feasible control parameters cannot be obtained. Since a set of control parameters can ensure stable operation of the grid-connected inverter within a certain impedance range, the number of control parameter combinations obtained through the PSO algorithm is limited. These control parameters are discretized and labeled in ascending order of grid impedance (label 1, label 2, etc.), and a lookup table is established that maps control parameters one-to-one with their labels. See the above; these labels and... d Axis grid-connected inverter output current andq The output current of the grid-connected inverter together constitutes the offline training dataset of the parametric inference model. Therefore, the output current of the grid-connected inverter under different grid impedance conditions and the corresponding multiple labels can be used to train the parametric inference model offline.
[0098] In step 103, the parameter inference model is a feature fusion model based on Long Short-Term Memory (LSTM) and Artificial Neural Network (ANN), used to extract parameters from the sampled data. d Axis grid-connected inverter output current and q Timing and global features are extracted from the output current of the shaft-connected grid inverter to achieve accurate label fitting. Model training is completed by repeatedly adjusting model parameters and iteratively training until the optimal model parameters are obtained.
[0099] In practical implementation, the feature fusion model is as follows: Figure 5 As shown, it specifically includes:
[0100] (1) Input module:
[0101] Use window width as M The sliding window for the collected d shaft and q The output current signal of the axis-connected grid inverter is intercepted and used as... f res Resampling is performed to reduce the sampling frequency. Subsequently, the obtained small-scale sample sequences are sequentially assigned to the corresponding input nodes of the feature fusion model in chronological order.
[0102] (2) Feature extraction module: includes two LSTMs and one ANN to extract the temporal features and global features of the input samples respectively.
[0103] Extract using two LSTMs respectively d shaft and q Timing characteristics of the output current of the shaft-connected grid-connected inverter; the two LSTMs have independent network parameters.
[0104] ;
[0105] ;
[0106] In the formula, F id and F iq They represent from d Axis grid-connected inverter output current sample sequence I d and q Axis grid-connected inverter output current sample sequenceI q The temporal features extracted are the output of the LSTM network at the last time step. The LSTM network includes input gates, forget gates, output gates, and memory units.
[0107] The input gate determines the input sample sequence. x t ( x t express t Input current signal at time i d ( t )or i q ( t How much information needs to be stored in memory?
[0108] ;
[0109] In the formula, σ is the sigmoid activation function. W xi and W hi The input gates are respectively the inputs at the current time ( x t ) and the hidden state of the previous time step ( h t-1 The weighting coefficients of ) b i For bias terms;
[0110] The forget gate controls which old information from the previous storage unit's state can be passed to the current state;
[0111] ;
[0112] In the formula, W xf and W hf The forget gate is used to process the input at the current time ( x t ) and the hidden state of the previous time step ( h t-1 The weighting coefficients of ) b f For bias terms;
[0113] Perform a candidate memory update operation to generate new memory content based on the current input:
[0114] ;
[0115] In the formula, tanh is the activation function. W xc andW hc These are the corresponding weight coefficients. b c For bias terms;
[0116] Perform a memory unit update operation, combining the results of the forget gate and the input gate to update the state of the memory unit:
[0117] ;
[0118] In the formula, ⊙ represents element-wise multiplication. c t-1 surface This indicates the state of the memory unit at the previous moment.
[0119] The output gate determines which information from the memory cell at the current moment will be output to the hidden state:
[0120] ;
[0121] In the formula, W xo and W ho The output gate is the input at the current time ( x t ) and the hidden state of the previous time step ( h t-1 The weighting coefficients of ) b o For bias terms;
[0122] Based on the updated memory cells and output gate results, generate the output for the current time step and pass it to the next time step:
[0123] ;
[0124] Will d Axis grid-connected inverter output current sample sequence I d and q Axis grid-connected inverter output current sample sequence I q Arrange them in a row to form a new array, represented as X =[ I d , I q Extracting arrays using a two-level ANN. X Global features:
[0125] ;
[0126] ;
[0127] In the formula, F X Indicates a two-layer ANN from X The global features extracted from it, where ReLU represents the activation function. W 1, B 1, W 2, B 2 represents the weight coefficient matrix and bias matrix of the first and second layers of the two-layer ANN, respectively.
[0128] (3) Feature fusion module: Introduce residual connection architecture to complete the feature fusion step.
[0129] ;
[0130] In the formula, F C This indicates the feature vector after fusing temporal and global features. concat means directly connecting the temporal and global features along the channel dimension and merging them into a larger feature vector.
[0131] (4) Inference module, output predicted labels:
[0132] After obtaining the fused features, a four-layer ANN is used to obtain the initial predicted probability for each classification label:
[0133] ;
[0134] ;
[0135] ;
[0136] ;
[0137] In the formula, F P This represents the features extracted from the fused features by the four-layer ANN, which is also the initial predicted probability for each classification label. W and B These represent the weighting coefficient matrix and the bias matrix, respectively.
[0138] Using the Softmax classifier F P Mapped to the (0,1) space, and summed to 1. The label corresponding to the maximum predicted probability is the inference predicted label corresponding to the input sample.
[0139] (5) Training and tuning module: The true labels of the samples are used for supervised training of the feature fusion model. The feature fusion network structure and parameters are repeatedly adjusted until the model with the highest prediction probability is obtained. During iterative training, the gradient descent algorithm is used to minimize the loss function, which is defined as follows:
[0140] ;
[0141] In the formula, l Indicates the number of category labels. y j The one-hot encoding representing the true label of the sample. θ The parameter set representing the feature fusion model. P ( θ ) represents the corresponding parameter set θ The predicted probability output by the feature fusion model.
[0142] In step 104, the trained feature fusion model obtained from the above process is used as the online tuning model for control parameters, and this model is deployed on the controller of the grid-connected inverter. At this time, by acquiring the output current of the grid-connected inverter in real time and inputting this real-time output current into the trained parameter inference model, it is possible to: extract the output current acquired in real time from the data using two long short-term memory networks. d Shaft output current and q Timing characteristics of shaft output current; extracted using a two-layer artificial neural network. d Shaft output current and q The global characteristics of the shaft output current are obtained; the timing characteristics and global characteristics are fused to obtain the fused characteristics; and the corresponding target control parameters are output based on the fused characteristics through a four-layer artificial neural network.
[0143] In one example, if the target control parameters of the grid-connected inverter under different grid impedance conditions are used as multiple labels, and a lookup table is established to correspond one-to-one between the labels and the target control parameters, the parameter inference model is trained offline using the output current of the grid-connected inverter under different grid impedance conditions and the corresponding multiple labels. Then, the real-time acquired output current is input into the trained parameter inference model to obtain the corresponding label; the corresponding target control parameter is then looked up from the lookup table based on the label output by the parameter inference model.
[0144] In one example, the online tuning model for control parameters only... d shaft current (current) d The system will only activate when the deviation of the current axis current exceeds a predefined threshold (i.e., before inputting the current output current into the trained feature fusion model, it is necessary to determine the current axis current deviation). d The shaft output current is relative to the preset value. dIf the deviation of the steady-state value of the shaft output current exceeds the preset deviation threshold, this model will not be run during normal operation of the grid-connected inverter.
[0145] In specific implementations, such as Figure 6 As shown, the optimal control parameters corresponding to the current output current are determined through the following steps:
[0146] S1: Initialization parameters, including the input window width ( W and downsampling frequency ( f res );
[0147] These two parameters together determine the input dimension of the model and directly affect the model size. To ensure deployability, the storage capacity of the target hardware during actual deployment must be considered.
[0148] S2: Continuous monitoring during grid-connected inverter operation d Axis-connected grid inverter output current signal ( i d );
[0149] S3: Judgment d Does the shaft current deviation exceed a predefined threshold (defined as 2% in this patent)? If it does, execute S4; otherwise, return to S2.
[0150] d The relative deviation of the shaft current is calculated as follows:
[0151] ;
[0152] In the formula, I dref express d Reference value for the output current of the shaft-connected grid inverter.
[0153] S4: Determine if the deviation is caused by an internal control command, such as a change in reference power or reference current. If yes, return to S2; otherwise, execute S5.
[0154] S5: Use the set downsampling frequency f res The width of the input window is W of d shaft and q The output current of the shaft-connected grid-connected inverter;
[0155] S6: Input the collected data into the feature fusion model, perform inference calculations, and output the predicted label;
[0156] S7: Determine if the prediction label is zero. If it is zero, it means that the grid-connected inverter is in a stable operating state and no control parameters need to be updated. Return to S2. If it is not zero, it means that the grid-connected inverter is in an unstable operating state and the control parameters need to be updated. Execute S8.
[0157] S8: Retrieve the corresponding control parameters from the predefined lookup table and use them to update the control parameters of the current loop and phase-locked loop in step 105.
[0158] In some embodiments, the online multi-parameter tuning method for grid-connected inverters of the present invention can be achieved through methods such as... Figure 7 The schematic diagram shown is used to implement this, specifically including:
[0159] S1: Establish a detailed simulation model of the grid-connected inverter circuit using various grid-connected inverter system simulation platforms and hardware-in-the-loop simulation platforms.
[0160] S2: The PSO algorithm is used to iteratively search for the near-optimal combination of control parameters under different grid impedance conditions. In each iteration, the effect of adjusting the control parameters is evaluated by running the circuit model. A finite set of near-optimal parameters obtained through PSO is used as multiple labels to construct a lookup table that maps control parameters to their corresponding labels.
[0161] S3: Collect data under different grid impedances d Axis grid-connected inverter output current and q Output current data from the grid-connected inverter. This data, along with the labels, constitutes the offline training dataset for the AI model.
[0162] S4: A feature fusion model based on LSTM and ANN is proposed for sampling... d Axis grid-connected inverter output current and q Timing and global features are extracted from the output current of the shaft-connected grid inverter to achieve accurate label fitting. Model training is completed by repeatedly adjusting model parameters and iteratively training until the optimal model parameters are obtained.
[0163] S5: Deploy the trained feature fusion model on the controller of the grid-connected inverter. When d The feature fusion model is activated only when the shaft current deviation exceeds a preset threshold. The system samples the current signal with an appropriate downsampling frequency and input window width, and inputs it into the feature fusion model for inference. The feature fusion model outputs the predicted label.
[0164] S6: The controller retrieves the corresponding control parameters from the predefined lookup table and updates the proportional-integral gain of the current control loop and phase-locked loop in real time.
[0165] The present invention provides a multi-parameter online tuning method for grid-connected inverters, which uses the PSO algorithm based on a detailed circuit simulation model to iteratively search for approximately optimal combinations of control parameters. These combinations of control parameters are used as multiple labels, and... dq The output current signal of the grid-connected inverter is used to construct a dataset. A feature fusion model based on LSTM and ANN is built. Through multiple iterations of training and parameter tuning, the model parameters with the highest prediction accuracy are obtained. The trained model is then used to output predicted labels based on real-time sampled current signals. The controller retrieves the corresponding control parameters from a predefined lookup table and updates the proportional-integral gain of the current control loop and phase-locked loop in real time to ensure the stable operation of the grid-connected inverter under changing grid conditions.
[0166] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the protection scope of this invention. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, without changing the core design of the algorithm and process, are also within the protection scope of this invention.
[0167] Another embodiment of the present invention relates to a multi-parameter online tuning system for a grid-connected inverter. The implementation details of this embodiment's multi-parameter online tuning system are described below. The following details are provided for ease of understanding and are not essential for implementing this solution. This embodiment's multi-parameter online tuning system for a grid-connected inverter includes:
[0168] The simulation model building module is used to build a circuit simulation model of the grid-connected inverter;
[0169] The control parameter search module is used to obtain the output current of the grid-connected inverter under different grid impedance conditions through the circuit simulation model, and to obtain the target control parameters of the grid-connected inverter under different grid impedance conditions through the particle swarm optimization algorithm iterative search using the circuit simulation model.
[0170] The optimized model training module is used to train the parameter inference model offline by using the output current of the grid-connected inverter under different grid impedance conditions and the target control parameters under the corresponding grid impedance conditions.
[0171] The control parameter acquisition module is used to acquire the output current of the grid-connected inverter in real time and input the acquired output current into the trained parameter inference model to obtain the corresponding target control parameters.
[0172] The control parameter tuning module is used to tune the control parameters of the grid-connected inverter online using the target control parameters output by the parameter inference model.
[0173] It is not difficult to see that this embodiment is a system embodiment corresponding to the above method embodiments, and this embodiment can be implemented in conjunction with the above method embodiments. The relevant technical details and technical effects mentioned in the above embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above embodiments.
[0174] It is worth mentioning that all modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by this invention; however, this does not mean that other units are absent from this embodiment.
[0175] Another embodiment of the present invention relates to a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the online multi-parameter tuning method for grid-connected inverters in the above embodiments.
[0176] The memory and processor are connected via a bus, which can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors and memories. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.
[0177] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.
[0178] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the method embodiments described above.
[0179] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0180] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing the present invention, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of the present invention.
Claims
1. A method for online tuning of multiple parameters of a grid-connected inverter, characterized in that, The method includes: Establish a circuit simulation model for the grid-connected inverter; The output current of the grid-connected inverter under different grid impedance conditions is obtained through circuit simulation modeling. The target control parameters of the grid-connected inverter under different grid impedance conditions are then obtained through iterative search using a particle swarm optimization algorithm based on the circuit simulation model. The fitness function of the particle swarm optimization algorithm is determined based on the output current of the grid-connected inverter under varying grid impedance conditions. d The time required for the shaft output current to enter and remain within the preset steady-state value within the allowable error range; The parameter inference model is trained offline by using the output current of the grid-connected inverter under different grid impedance conditions and the target control parameters under the corresponding grid impedance conditions. The output current of the grid-connected inverter is acquired in real time, and the acquired output current is input into the trained parameter inference model to obtain the corresponding target control parameters. The control parameters of the grid-connected inverter are tuned online using the target control parameters output by the parametric inference model.
2. The online multi-parameter tuning method for grid-connected inverters according to claim 1, characterized in that, The fitness function of the particle swarm optimization algorithm is as follows: ; In the formula, T i ( k ) indicates the first k In the next iteration, particles i fitness value, t s express d Shaft output current i d The moment when it enters and remains within the preset steady-state value's allowable error range, t 0 indicates the moment of sudden change in grid impedance. I dref express i d The steady-state value.
3. The online multi-parameter tuning method for grid-connected inverters according to claim 2, characterized in that, The search steps of the particle swarm optimization algorithm are as follows: S1: Initialize the particle swarm size, the initial velocity and initial position of each particle, the search range of the control parameters, and the maximum number of iterations; S2: Initialize the circuit simulation model with the grid impedance before the sudden change; S3: Input the position of each particle into the circuit simulation model in sequence, run the circuit simulation model, and record the real-time running data; S4: Calculate the fitness value of each particle based on real-time running data and the fitness function; S5: Update the individual optimal solution and the global optimal solution, including the update content of velocity, position and fitness value; S6: Update the velocity and position of each particle in the next iteration; S7: Determine whether the fitness of the global optimal solution is less than the preset strict threshold. If yes, execute S11; otherwise, execute S8. S8: Increment the iteration count by 1; S9: Determine if the maximum number of iterations has been reached. If yes, execute S10; otherwise, return to S3. S10: Determine whether the fitness of the global optimal solution is less than the preset leniency threshold. If yes, execute S11; otherwise, end the algorithm. S11: Save the global optimal solution, including velocity, position and corresponding grid impedance; S12: Set the global optimal solution as one of the initial particles under the new grid impedance condition, and reset the iteration count; S13: Update the grid impedance of the circuit simulation model by increasing the grid impedance in fixed steps to establish a new grid impedance condition, and return to S3.
4. The online multi-parameter tuning method for grid-connected inverters according to claim 1, characterized in that, The network structure of the parameter inference model consists of a long short-term memory network and an artificial neural network. The step of inputting the real-time acquired output current into the trained parameter inference model to obtain the corresponding target control parameters includes: The output current acquired in real time is extracted using two long short-term memory networks. d Shaft output current and q Timing characteristics of shaft output current; Extracted using a two-layer artificial neural network d Shaft output current and q Global characteristics of shaft output current; By fusing temporal features and global features, a fused feature is obtained. A four-layer artificial neural network outputs the corresponding target control parameters based on the fused features.
5. The online multi-parameter tuning method for grid-connected inverters according to claim 4, characterized in that, Before inputting the real-time acquired output current into the trained parameter inference model, the following is also included: Determine the output current acquired in real time d The shaft output current is relative to the preset value. d The deviation of the steady-state value of the shaft output current exceeds the preset deviation threshold.
6. The online multi-parameter tuning method for a grid-connected inverter according to claim 1, characterized in that, The offline training of the parameter inference model, based on the output current of the grid-connected inverter under different grid impedance conditions and the corresponding target control parameters under those conditions, includes: The target control parameters of the grid-connected inverter under different grid impedance conditions are used as multiple labels, and a lookup table is established to correspond one-to-one between the labels and the target control parameters. The parameter inference model is trained offline by using the output current of the grid-connected inverter under different grid impedance conditions and the corresponding multiple labels. The step of inputting the real-time acquired output current into the trained parameter inference model to obtain the corresponding target control parameters includes: The real-time acquired output current is input into the trained parameter inference model to obtain the corresponding label; The corresponding target control parameters are retrieved from the lookup table based on the labels output by the parameter inference model.
7. The online multi-parameter tuning method for a grid-connected inverter according to any one of claims 1 to 6, characterized in that, The control parameters of the grid-connected inverter include: the proportional gain and integral gain of the current control loop, and the proportional gain and integral gain of the phase-locked loop.
8. A multi-parameter online tuning system for a grid-connected inverter, characterized in that, The system includes: The simulation model building module is used to build a circuit simulation model of the grid-connected inverter; The control parameter search module is used to obtain the output current of the grid-connected inverter under different grid impedance conditions through a circuit simulation model, and to iteratively search for the target control parameters of the grid-connected inverter under different grid impedance conditions using a particle swarm optimization algorithm based on the circuit simulation model; wherein, the fitness function of the particle swarm optimization algorithm is based on the grid-connected inverter's output current under different grid impedance conditions. d The time required for the shaft output current to enter and remain within the preset steady-state value within the allowable error range; The optimized model training module is used to train the parameter inference model offline by using the output current of the grid-connected inverter under different grid impedance conditions and the target control parameters under the corresponding grid impedance conditions. The control parameter acquisition module is used to acquire the output current of the grid-connected inverter in real time and input the acquired output current into the trained parameter inference model to obtain the corresponding target control parameters. The control parameter tuning module is used to tune the control parameters of the grid-connected inverter online using the target control parameters output by the parameter inference model.
9. A computer device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the online multi-parameter tuning method for a grid-connected inverter as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the online multi-parameter tuning method for grid-connected inverters as described in any one of claims 1 to 7.
Citation Information
Patent Citations
PMSM current loop PI parameter adaptive control method based on parameter identification and table look-up optimization
CN120675454A
Cited By
Parameter optimization method for grid-connected inverter based on neural network multi-model fusion
CN122620597A
