Photovoltaic inverter output power control algorithm based on predictive control algorithm
By controlling the output power of a photovoltaic inverter based on a predictive control algorithm and using a BP neural network model for global power prediction and analysis of the photovoltaic power generation system, the problem of transformer burnout caused by output power fluctuations in the photovoltaic power generation system is solved, and the system achieves stable and safe operation.
Patent Information
- Application Number
- CN202410448436.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-15
- Publication Date
- 2026-02-06
AI Technical Summary
The output power of residential photovoltaic power generation systems fluctuates greatly, which can easily lead to excessive power generation and burn out the distribution network transformer.
A photovoltaic inverter output power control algorithm based on predictive control is adopted. The BP neural network model is used to predict the global power of the photovoltaic power generation system. The BP neural network algorithm is used to analyze and control the output power of the photovoltaic power generation system and dynamically adjust the output power of the photovoltaic inverter.
It enables accurate prediction and control of the output power of the photovoltaic power generation system, avoiding the situation where excessive power generation burns out the distribution network transformer, and improving the stability and safety of the system.
Smart Images

Figure CN121485079A_ABST
Abstract
Description
Technical Field
[0001] This invention pertains to predictive control algorithms, specifically a photovoltaic inverter output power control algorithm based on predictive control algorithms. Background Technology
[0002] With the increasing prevalence of residential photovoltaic (PV) power generation equipment, the active power output and power generation capacity of PV systems fluctuate significantly due to environmental factors such as sunlight conditions and solar radiation angle. A predictive control algorithm is needed to dynamically control the output power of the PV inverter based on the local transformer capacity, preventing excessive power fed back from residential PV systems and the potential damage to the distribution network transformer. Summary of the Invention
[0003] The purpose of this invention is to overcome the shortcomings of the prior art and provide a photovoltaic inverter output power control algorithm based on predictive control algorithm, which solves the problems in the background art mentioned above.
[0004] The objective of this invention is achieved as follows: a photovoltaic inverter output power control algorithm based on predictive control algorithm, which includes establishing a BP neural network model, wherein the BP neural network model includes determining the grid structure, input layer design, output layer design, hidden layer design, transfer function, and calculating prediction error.
[0005] Furthermore, the input layer design includes taking variables such as historical output power, data, temperature, and light intensity as inputs according to the actual situation. The input layer nodes are selected as the temperature at the prediction time, the temperature at the same time the day before the prediction time, the light intensity at the prediction time, the light intensity at the same time the day before the prediction time, and the historical output power data at the same time the day before the prediction time, for a total of five input layer nodes.
[0006] Furthermore, the output layer design includes predicting the output power of the target photovoltaic system, which can be achieved with a single output layer node, thus simplifying the model.
[0007] Furthermore, the expression for the hidden layer design is as follows:
[0008]
[0009] h < N-1
[0010] In the formula, h represents the number of nodes in the hidden layer; m represents the number of nodes in the input layer; p represents the number of nodes in the output layer; α is an integer in the range of 1 to 10; and N represents the number of training samples.
[0011] Furthermore, the transfer function includes a hidden layer function and an output layer function, wherein the hidden layer function is an Ansig nonlinear excitation function and the output layer function is a Purelin linear function.
[0012] Furthermore, the prediction error is calculated using the Mean Absolute Percentage Error (MAPE) method, where the MAPE value is a percentage value, and its calculation formula is as follows:
[0013]
[0014] In the formula, N is the total number of data points, and p f p is the predicted value. a is the measured value, and i is the data sequence number.
[0015] Furthermore, the algorithm of the BP neural network model specifically includes the following steps:
[0016] 1. Initialize the network so that the network connection weights ω and the threshold b are random numbers between [-1, +1];
[0017] 2. Input vector P, where P is the sample dataset and the expected output T is the parameter input network;
[0018] 3. Calculate the output value of each layer;
[0019] 4. Optimize network connection weights ω and threshold b;
[0020] 5. Calculate the total error of the BP neural network;
[0021] 6. Determine whether the accuracy requirement ε has been met. If yes, output the result. If no, go to step 2 and continue sequentially until E < ε is met or the maximum number of training iterations is reached, at which point the network stops running.
[0022] Furthermore, the calculation of the output values of each layer includes:
[0023] The formula for the output value of the hidden layer is:
[0024]
[0025] The formula for the output value of the output layer is:
[0026]
[0027] Furthermore, the expression for calculating the total error of the BP neural network is as follows:
[0028]
[0029] The beneficial effects of this invention are as follows: Using historical power generation data from photovoltaic power plants and meteorological data as experimental samples, the prediction time is set to the period of best sunlight from 05:00 to 19:00, and the prediction interval is set to 1 hour. An algorithm based on backpropagation (BP) neural networks is used to predict and analyze the global output power of the photovoltaic power generation system, achieving network tracking and prediction of the global output power, effectively preventing excessive power fed back from residential photovoltaic power generation systems from burning out the distribution network transformer. Attached Figure Description
[0030] Figure 1 This is a flowchart of the neural network algorithm of the present invention;
[0031] Figure 2 This is a schematic diagram of the neural network model of the present invention;
[0032] Figure 3 This is an error diagram corresponding to the number of hidden layer nodes in this invention. Detailed Implementation
[0033] The present invention will now be described in further detail with reference to the accompanying drawings. It should be noted that all directional terms such as up, down, front, back, left, and right appearing in the present invention are not intended to limit the present invention, but are only used to more clearly explain and interpret the present invention.
[0034] like Figure 1-3 As shown, this embodiment discloses a photovoltaic inverter output power control algorithm based on predictive control, including collecting historical data and establishing a BP neural network model. Due to the influence of daily weather and specific numerical values, inputting this data would result in an overly broad search, reducing prediction accuracy. This invention uses the `premnmx` function, processing the data into a range of [-1, +1], before inputting it into the neural network to ensure the accuracy of power prediction. The function conversion formula is as follows:
[0035]
[0036] P n P represents the normalized data; P represents the original data; P max P represents the maximum value of the original data. min This is the minimum value of the original data.
[0037] The basic implementation steps of the BP neural network model algorithm are as follows:
[0038] (1) Initialize the network so that the network connection weights ω and the threshold b are random numbers between [-1, +1];
[0039] (2) Input parameters such as input vector P (sample dataset) and expected output T into the network;
[0040] (3) Calculate the output value of each layer;
[0041] The formula for the output value of the hidden layer is:
[0042]
[0043] The formula for the output value of the output layer is:
[0044]
[0045] (4) Optimize network connection weights ω and thresholds b; generally, the gradient descent algorithm is used, which iteratively solves the problem step by step by descending the gradient vector. The adjustment formulas for weights ω and thresholds b in this algorithm are as follows:
[0046] x(k+1)=x(k)+αD(k)
[0047] In the formula, x(k+1) and x(k) represent the network connection weights and thresholds at the (k+1)th and kth iterations, respectively, α represents the learning speed, and D(k) is the fastest direction of gradient descent when the network performs the kth iteration.
[0048] (5) Calculate the total error of the BP neural network;
[0049]
[0050] (6) If the accuracy requirement ε is met, output the result if yes; otherwise, proceed to step (2) and continue sequentially until E < ε is met or the maximum number of training iterations is reached, at which point the network stops running. The specific steps of the BP neural network are shown in the figure.
[0051] BP neural network model establishment: When the number of hidden layers and nodes is appropriately selected, the BP neural network can simulate the characteristics of any nonlinear system. Based on this, the steps for establishing a photovoltaic power generation system power prediction model based on the BP neural network algorithm are as follows:
[0052] Determine the network structure. This paper selects a three-layer BP neural network model consisting of an input layer, an output layer, and a single hidden layer.
[0053] Input layer design. Given the diverse types of network input samples, this paper uses historical output power data, temperature, and light intensity as inputs based on actual conditions. The input layer nodes are selected as follows: temperature at the prediction time, temperature at the same time the day before the prediction time, light intensity at the prediction time, light intensity at the same time the day before the prediction time, and historical output power data at the same time the day before the prediction time, totaling five input layer nodes.
[0054] Output layer design. Since the goal is to predict the output power of the photovoltaic system, a single output layer node is sufficient and can make the model more concise.
[0055] Hidden layer design. If a single hidden layer has a sufficient number of nodes, it can fit any nonlinear curve and handle various problems in the network. The number of hidden layer nodes determines the prediction accuracy of the network model. Insufficient nodes result in an overly simple network structure, leading to prediction errors; excessive nodes make the network structure redundant, resulting in excessively long neural network training time. Since there is no uniform standard for setting the number of hidden layer nodes, it is generally chosen based on experience and usually conforms to the Kolmogorow theorem.
[0056]
[0057] h < N-1
[0058] In the formula, h represents the number of nodes in the hidden layer; m represents the number of nodes in the input layer; and p represents the number of nodes in the output layer.
[0059] α is an integer between 1 and 10; N represents the number of training samples. Substituting the number of nodes in each layer into the above formula, the possible range of the number of nodes can be calculated to be 3 to 12. Within this range, the specific number of nodes is generally selected by substituting different numbers of nodes into the model and comparing the root mean square error (RMSE) of the results under the same prediction conditions. The model accuracy is highest when the RMSE value is the smallest. Therefore, the number of hidden layer nodes with the smallest error value is the optimal number of hidden layer nodes. This is also a trial-and-error method commonly used in engineering. After calculation, the error corresponding to some hidden layer node numbers was finally selected as the number of hidden layer nodes with the smallest target error, which is 4.
[0060] Transfer Functions. Common transfer functions for BP neural networks include three frequently used functions: logsig and tansig, both sigmoid nonlinear activation functions. Both can transform data into a nonlinear form, but the logsig function returns values in the (0,1) interval, while the tansig function returns values in the (-1,+1) interval. The purelin function, on the other hand, is a linear activation function, returning a random value in the (-1,+1) interval. Since nonlinear functions are more suitable for hidden layers, and the tansig function's return value range covers both positive and negative values, making it more applicable than the logsig function, the tansig nonlinear activation function was ultimately chosen as the transfer function for the hidden layers. The purelin linear function was chosen as the transfer function for the output layer.
[0061] Calculate the prediction error. The Mean Absolute Percentage Error (MAPE) method is used to evaluate the prediction performance of the BP neural network power generation prediction model. The MAPE value is a percentage. The calculation formula is as follows:
[0062]
[0063] In the formula, N is the total number of data points, and p f p is the predicted value. a is the measured value, and i is the data sequence number.
[0064] A BP neural network prediction model was established using MATLAB. The data was collected from the historical power generation data and weather data of a photovoltaic power station, as well as the weather forecast for the predicted day. The sample information of the predicted day and the day before the predicted day was input, and after learning and training by the BP neural network, the power generation on the predicted day was output.
[0065] With the increasing prevalence of residential photovoltaic (PV) power generation equipment, the active power output and generation capacity of PV systems fluctuate significantly due to environmental factors such as sunlight conditions and solar radiation angle. This invention presents a predictive control-based algorithm for the output power of PV inverters. Using historical power generation data from PV power plants and meteorological data as experimental samples, the prediction time is set to the period of best sunlight from 05:00 to 19:00, with a prediction interval of 1 hour. An algorithm based on backpropagation (BP) neural networks is used to predict and analyze the global output power of the PV power generation system, achieving network tracking and prediction of the global output power. The output power of the PV inverter is dynamically controlled according to the local transformer capacity, thereby preventing excessive power fed back from residential PV power generation systems and the potential damage to the distribution network transformer.
[0066] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A photovoltaic inverter output power control algorithm based on predictive control algorithm, comprising establishing a BP neural network model, characterized in that: The BP neural network model includes determining the grid structure, input layer design, output layer design, hidden layer design, transfer function, and calculating prediction error.
2. The photovoltaic inverter output power control algorithm based on predictive control algorithm according to claim 1, characterized in that: The input layer design includes taking variables such as historical output power, data, temperature, and light intensity as inputs based on actual conditions. The input layer nodes are selected as the temperature at the prediction time, the temperature at the same time the day before the prediction time, the light intensity at the prediction time, the light intensity at the same time the day before the prediction time, and the historical output power data at the same time the day before the prediction time, for a total of five input layer nodes.
3. The photovoltaic inverter output power control algorithm based on predictive control algorithm according to claim 1, characterized in that: The output layer design includes predicting the output power of the target photovoltaic system. A single output layer node can meet the requirements, making the model more concise.
4. The photovoltaic inverter output power control algorithm based on predictive control algorithm according to claim 1, characterized in that: The expression for the hidden layer design is: h < N-1 In the formula, h represents the number of nodes in the hidden layer; m represents the number of nodes in the input layer; p represents the number of nodes in the output layer; α is an integer in the range of 1 to 10; and N represents the number of training samples.
5. The photovoltaic inverter output power control algorithm based on predictive control algorithm according to claim 1, characterized in that: The transfer function includes a hidden layer function and an output layer function. The hidden layer function is an Ansig nonlinear excitation function, and the output layer function is a Purelin linear function.
6. The photovoltaic inverter output power control algorithm based on predictive control algorithm according to claim 1, characterized in that: The prediction error is calculated using the Mean Absolute Percentage Error (MAPE) method. The MAPE value is a percentage value, and its calculation formula is as follows: In the formula, N is the total number of data points, and p f p is the predicted value. a is the measured value, and i is the data sequence number.
7. The photovoltaic inverter output power control algorithm based on predictive control algorithm according to claim 1, characterized in that: The algorithm of the BP neural network model specifically includes the following steps:
1. Initialize the network so that the network connection weights ω and the threshold b are random numbers between [-1, +1]; 2. Input vector P, where P is the sample dataset and the expected output T is the parameter input network; 3. Calculate the output value of each layer; 4. Optimize network connection weights ω and threshold b; 5. Calculate the total error of the BP neural network; 6. Determine whether the accuracy requirement ε has been met. If yes, output the result. If no, go to step 2 and continue sequentially until E < ε is met or the maximum number of training iterations is reached, at which point the network stops running.
8. The photovoltaic inverter output power control algorithm based on predictive control algorithm according to claim 7, characterized in that: The calculation of the output values for each layer includes: The formula for the output value of the hidden layer is: The formula for the output value of the output layer is:
9. The photovoltaic inverter output power control algorithm based on predictive control algorithm according to claim 7, characterized in that: The expression for calculating the total error of the BP neural network is as follows: