Photovoltaic single-stage inverter control method and device based on dynamic DDPG

By introducing a dynamic DDPG algorithm into the photovoltaic single-stage inverter and optimizing the control strategy, the problems of large power loss and low efficiency in the existing technology are solved, achieving more efficient energy transmission and extending the life of the inverter.

CN118783801APending Publication Date: 2024-10-15UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410749310.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

The control methods of existing photovoltaic single-stage inverters are complex, resulting in large power losses, low efficiency, reduced energy transmission efficiency, and easy damage to components, resulting in economic losses.

Method used

Introduce the dynamic DDPG algorithm, establish a dynamic DDPG model by setting the state, action and reward function, and conduct offline training to optimize the control strategy of the photovoltaic single-stage inverter and improve the energy conversion efficiency.

Benefits of technology

It realizes intelligent optimization of photovoltaic single-stage inverter control strategy, reduces power loss, improves energy transmission efficiency, extends the service life of the inverter, solves the problem of difficult boundary convergence of the traditional DDPG algorithm, and improves training stability and model lightness. Quantitative.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118783801A_ABST
    Figure CN118783801A_ABST
Patent Text Reader

Abstract

The invention discloses a photovoltaic single-stage inverter control method and device based on a dynamic DDPG, and the method comprises the steps: setting the state, action and reward function of a dynamic DDPG model, enabling the state to comprise the input voltage, input current, output voltage and output current of a photovoltaic single-stage inverter, enabling the action to comprise a carrier frequency signal and dead time of the photovoltaic single-stage inverter, and enabling the reward function to be a reward function of the dynamic DDPG model; the dynamic DDPG model is set and trained offline, the input voltage, the input current, the output voltage and the output current of the photovoltaic single-stage inverter are collected in real time, a carrier frequency signal and dead time are obtained by adopting a strategy network in the trained dynamic DDPG model, a driving signal is generated according to the carrier frequency signal and the dead time, and the driving signal is used for driving the photovoltaic single-stage inverter. And switching elements in the photovoltaic single-stage inverter are controlled. According to the method, a delay updating and dynamic adjusting strategy is introduced into a traditional DDPG algorithm, the optimization problems that parameter adjustment is difficult and boundary convergence is poor are solved, the structure of the photovoltaic single-stage inverter is improved, and the energy conversion efficiency of photovoltaic power generation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of photovoltaic inverters, and more specifically, relates to a photovoltaic single-stage inverter control method and device based on dynamic DDPG. Background Art

[0002] Photovoltaic power generation is an important part of the field of new energy power generation and the main direction for expanding the scale of new energy power generation. The inverter is one of the core components of photovoltaic power generation, and its performance is directly related to the energy transmission efficiency of the entire photovoltaic power generation process. Improving the performance of the inverter is of great significance to the development of the new energy industry.

[0003] At present, the control method of single-stage photovoltaic inverters in practical applications is complex, with problems such as large power loss and low efficiency. These problems will lead to a significant increase in power loss in the entire photovoltaic power generation process, reduced energy transmission efficiency, and easy damage to components, resulting in huge economic losses.

[0004] In recent years, with the rapid development of artificial intelligence technology, reinforcement learning, as a machine learning direction, has become a new research paradigm in the control field of circuits, robots, etc., which trains an intelligent agent to interact with the environment to learn the optimal strategy to achieve a specific goal. In addition, the existing reinforcement learning algorithm can autonomously learn and adjust according to environmental changes and feedback signals, and has stronger adaptability. It can learn the state-action mapping relationship of complex nonlinear control systems, and has greater potential and advantages in solving complex system control problems compared to traditional control methods. Summary of the invention

[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a photovoltaic single-stage inverter control method and device based on dynamic DDPG, introduce a dynamic DDPG (Deep Deterministic Policy Gradient) algorithm into the control strategy of the photovoltaic single-stage inverter, introduce a delayed update and dynamic adjustment strategy into the traditional DDPG algorithm, improve its parameter adjustment difficulty and poor boundary convergence optimization problems, and improve the structure of the photovoltaic single-stage inverter to improve the energy conversion efficiency of photovoltaic power generation.

[0006] In order to achieve the above-mentioned object of the invention, the photovoltaic single-stage inverter control method based on dynamic DDPG of the present invention comprises the following steps:

[0007] S1: Set the state, action and reward functions of the dynamic DDPG model as follows:

[0008] state in They represent the input voltage and input current of the photovoltaic single-stage inverter at time t, They represent the output voltage and output current of the photovoltaic single-stage inverter at time t, respectively, and S represents the state space;

[0009] action in represents the carrier frequency signal at time t, represents the dead time at time t, and A represents the action space;

[0010] Reward function r t The calculation formula is as follows:

[0011]

[0012] Where δ represents the zero voltage turn-on penalty factor, G goal represents the optimization efficiency parameter, ζ represents the output power error penalty factor, and p0 represents the expected output power;

[0013] S2: Set the four neural networks in the dynamic DDPG model according to actual needs, including the evaluation network Q(s,a|θ Q ), policy network μ(s|θ μ ), target evaluation network Q′ and target policy network μ′, and perform offline training on the dynamic DDPG model; the specific steps of offline training include:

[0014] S2.1: Randomly initialize the parameters of the evaluation network Q and the policy network μ, and copy them to obtain two identical target evaluation networks Q′ and target policy networks μ′;

[0015] S2.2: Establish an experience replay cache pool C and initialize it;

[0016] S2.3: Let training round m = 1;

[0017] S2.4: Get the initial state s1;

[0018] S2.5: Let time t = 1;

[0019] S2.6: The policy network μ is used to calculate each state s t With a t =μ(s t |θ μ ) strategy to select actions and add noise to the selected actions as state s t The corresponding action a t ; According to the state s t and action a t Get the state s at the next moment t+1 and reward r t , then (s t ,a t ,rt ,s t+1 ) are stored as experience samples in the experience replay buffer pool C; if the number of experience samples in the experience replay buffer pool C exceeds its predetermined capacity, the redundant experience samples are deleted according to the predetermined rules;

[0020] S2.7: Randomly extract a sample set of N in the experience replay buffer pool C to form a training set, and use the target evaluation network Q′ to estimate the action to obtain the value y of the action i , the calculation formula is as follows:

[0021] y i =r i +Q′(s i+1 ,μ′(s i+1 |θ μ′ )|θ Q′ )

[0022] Where, i = 1, 2, ..., N;

[0023] Calculate the loss function L(θ Q ) and evaluate the parameters θ of the network Q Make updates;

[0024] S2.8: Determine whether t<T, where T represents the preset maximum time step. If so, proceed to step S2.9; otherwise, proceed to step S2.10;

[0025] S2.9: Set t=t+1, and return to step S2.7;

[0026] S2.10: Calculate the gradient of the policy network μ and update the parameters of the policy network μ. The calculation formula of the policy network gradient is as follows:

[0027]

[0028] in, represents the gradient of the policy network, β represents the sampling strategy, and ρ β The state distribution under sampling strategy β, Represents the policy function for the current policy θ μ The partial guide, represents the partial derivative of the action value function under the strategy obtained by the strategy network μ, where the action value function Q μ (s t ,a|θ Q ) is calculated as follows:

[0029]

[0030] Among them, s t 、s t+1Respectively represent the state at time t and time t+1, a t 、a t+1 denote the actions at time t and time t+1 respectively, E μ [] represents the expected return of following the strategy of the policy network μ, G(s) represents the current value of future rewards that can be obtained by following the strategy of the policy network μ for a series of actions starting from time step t+1. t ,a t ) indicates state s t and action a t The cumulative reward under , the calculation formula is as follows:

[0031]

[0032] Where λ represents the discount factor, ranging from [0,1];

[0033] S2.11: Determine whether m < M, where M represents the preset maximum number of training rounds. If so, proceed to step S2.12, otherwise, the offline training ends;

[0034] S2.12: Determine whether m%η, η represents two target network soft update cycles, if yes, proceed to step S2.13, otherwise proceed to step S2.14;

[0035] S2.13: Dynamically soft update the two target networks using the following formula:

[0036]

[0037] Wherein, τ(t) represents the soft update coefficient, τ(t)<<1, and its value is a negative correlation function of the training round t;

[0038] Then proceed to step S2.14;

[0039] S2.14: Set m=m+1, and return to step S2.4;

[0040] S3: Collect the current input voltage v of the photovoltaic single-stage inverter pv 、Input current i pv , output voltage e g and the output current i g , construct state S = [v pv ,i pv ,e g ,i g ], and then use the strategy network trained in step S2 to determine the optimal action A = [f c ,T d ], according to the carrier frequency signal f c and dead time Td Generate control signals to control switching elements in a photovoltaic single-stage inverter.

[0041] The present invention also proposes a photovoltaic single-stage inverter control device based on dynamic DDPG, including a V / I sensor, a microprogram controller, an SPWM modulation circuit and a drive circuit, wherein:

[0042] The V / I sensor is used to collect the input voltage v of the photovoltaic single-stage inverter pv 、Input current i pv , output voltage e g and the output current i g And convert it into digital signal and transmit it to microprogram controller;

[0043] The dynamic DDPG model is deployed on the microcontroller and trained offline in advance. The state, action and reward functions of the dynamic DDPG model are set as follows:

[0044] state in They represent the input voltage and input current of the photovoltaic single-stage inverter at time t, They represent the output voltage and output current of the photovoltaic single-stage inverter at time t, respectively, and S represents the state space;

[0045] action in represents the carrier frequency signal at time t, represents the dead time at time t, and A represents the action space;

[0046] Reward function r t The calculation formula is as follows:

[0047]

[0048] Where δ represents the zero voltage turn-on penalty factor, G goal represents the optimization efficiency parameter, ζ represents the output power error penalty factor, and p0 represents the expected output power;

[0049] According to actual needs, set up four neural networks in the dynamic DDPG model, including the evaluation network Q(s,a|θ Q ), policy network μ(s|θ μ ), target evaluation network Q′ and target strategy network μ′, and then conduct offline training. The specific steps include:

[0050] 1) Randomly initialize the parameters of the evaluation network Q and the policy network μ, and copy them to obtain two identical target evaluation networks Q′ and target policy networks μ′;

[0051] 2) Establishing and initializing the experience replay buffer pool C;

[0052] 3) Let training round m = 1;

[0053] 4) Get the initial state s1;

[0054] 5) Let time t = 1;

[0055] 6) The policy network μ is used to calculate each state s t With a t =μ(s t |θ μ ) strategy to select actions and add noise to the selected actions as state s t The corresponding action a t ; According to the state s t and action a t Get the state s at the next moment t+1 and reward r t , then (s t ,a t ,r t ,s t+1 ) are stored as experience samples in the experience replay buffer pool C; if the number of experience samples in the experience replay buffer pool C exceeds its predetermined capacity, the redundant experience samples may be deleted according to the established rules;

[0056] 7) Randomly extract a sample set of N in the experience replay buffer pool C to form a training set, and use the target evaluation network Q′ to estimate the action to obtain the value y of the action i , the calculation formula is as follows:

[0057] y i =r i +Q′(s i+1 ,μ′(s i+1 |θ μ′ )|θ Q′ )

[0058] Where, i = 1, 2, ..., N;

[0059] Calculate the loss function L(θ Q ) and evaluate the parameters θ of the network Q Make updates;

[0060] 8) Determine whether t<T, where T represents the preset maximum time step. If so, proceed to step S9), otherwise proceed to step 10);

[0061] 9) Let t=t+1, and return to step 7);

[0062] 10): Calculate the gradient of the policy network μ and update the parameters of the policy network μ. The calculation formula of the policy network gradient is as follows:

[0063]

[0064] in, represents the gradient of the policy network, β represents the sampling strategy, and ρ β The state distribution under sampling strategy β, Represents the policy function for the current policy θ μ The partial guide, represents the partial derivative of the action value function under the strategy obtained by the strategy network μ, where the action value function Q μ (s t ,a|θ Q ) is calculated as follows:

[0065]

[0066] Among them, s t 、s t+1 Respectively represent the state at time t and time t+1, a t 、a t+1 denote the actions at time t and time t+1 respectively, E μ [] represents the expected return of following the strategy of the policy network μ, G(s) represents the current value of future rewards that can be obtained by following the strategy of the policy network μ for a series of actions starting from time step t+1. t ,a t ) indicates state s t and action a t The cumulative reward under , the calculation formula is as follows:

[0067]

[0068] Where λ represents the discount factor, ranging from [0,1];

[0069] 11) Determine whether m<M, where M represents the preset maximum number of training rounds. If so, proceed to step 12), otherwise, the offline training ends;

[0070] 12) Determine whether m%η, η represents two target network soft update cycles, if yes, proceed to step 13), otherwise proceed to step 14);

[0071] 13) Use the following formula to dynamically soft update the two target networks:

[0072]

[0073] Wherein, τ(t) represents the soft update coefficient, τ(t)<<1, and its value is a negative correlation function of the training round t;

[0074] Then proceed to step 14);

[0075] 14) Let m=m+1, and return to step S4);

[0076] The microcontroller receives the input voltage v uploaded by the V / I sensor pv 、Input current i pv , output voltage e g and the output current i g After that, construct the state S = [v pv ,i pv ,e g ,i g ], and then use the trained strategy network to determine the optimal action A = [f c ,T d ], thus obtaining the carrier frequency signal f c and dead time T d And sent to the SPWM modulation circuit;

[0077] The SPWM modulation circuit is used to modulate the received carrier frequency signal f c With dead time T d , generate PWM pulse signals p1 and p2 and send them to the drive circuit;

[0078] The driving circuit is used to generate a driving signal according to the PWM pulse signals p1 and p2. Then, it acts on the four switch elements S1, S2, S3, and S4 in the photovoltaic single-stage inverter respectively to achieve orderly control of the four switch elements of the photovoltaic single-stage inverter.

[0079] The present invention provides a photovoltaic single-stage inverter control method and device based on dynamic DDPG, sets the state, action and reward function of the dynamic DDPG model, wherein the state includes the input voltage, input current, output voltage and output current of the photovoltaic single-stage inverter, and the action includes the carrier frequency signal and dead time of the photovoltaic single-stage inverter. The dynamic DDPG model is set and trained offline, and the input voltage, input current, output voltage and output current of the photovoltaic single-stage inverter are collected in real time. The strategy network in the trained dynamic DDPG model is used to obtain the carrier frequency signal and dead time, and a drive signal is generated according to the carrier frequency signal and the dead time to control the switching elements in the photovoltaic single-stage inverter.

[0080] The present invention has the following beneficial effects:

[0081] 1) The present invention introduces a dynamic DDPG model into the photovoltaic single-stage inverter control strategy, realizing the intelligent optimization of the photovoltaic single-stage inverter control strategy. Its advantage is that it solves the problem of boundary convergence difficulty of the traditional DDPG algorithm, and takes into account the lightweight and immediacy of the model while achieving optimal efficiency improvement;

[0082] 2) With the help of the dynamic DDPG model, the present invention can quickly obtain the optimal angle of the photovoltaic single-stage inverter control strategy, thereby effectively reducing the power loss of the photovoltaic single-stage inverter and improving the energy transmission efficiency of the photovoltaic single-stage inverter; at the same time, it can effectively avoid the occurrence of extreme currents in switching devices, effectively adjust the switching frequency, reduce damage to switching elements, and greatly increase the service life of the inverter.

[0083] 3) The dynamic DDPG model of the present invention introduces the idea of ​​delayed update, which ensures the consistency of the strategy when evaluating network updates, improves the stability of the reinforcement learning algorithm training process, ensures that each optimization of the policy gradient can make the network better, and reduces the average training time required for the model.

[0084] 4) The dynamic DDPG model of the present invention also innovates the dynamic soft update parameters, ensuring that during the network training process, the parameter changes are radical at first and then stable, reducing the probability of gradient vanishing and gradient explosion of the training parameters, and solving the problem that the traditional DDPG algorithm is prone to stagnation at the action boundary, resulting in non-convergence of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] Figure 1 It is a flowchart of a specific implementation method of a photovoltaic single-stage inverter control method based on dynamic DDPG of the present invention;

[0086] Figure 2 It is a schematic diagram of the structure and offline training process of the dynamic DDPG model in the present invention;

[0087] Figure 3 It is a flowchart of offline training of the dynamic DDPG model in the present invention;

[0088] Figure 4 It is a structural diagram of a specific implementation of a photovoltaic single-stage inverter control device based on dynamic DDPG of the present invention. DETAILED DESCRIPTION

[0089] The specific implementation of the present invention is described below in conjunction with the accompanying drawings so that those skilled in the art can better understand the present invention. It should be noted that in the following description, when the detailed description of known functions and designs may dilute the main content of the present invention, these descriptions will be omitted here.

[0090] Example

[0091] Figure 1 FIG. 1 is a flow chart of a specific implementation of a photovoltaic single-stage inverter control method based on dynamic DDPG of the present invention. Figure 1 As shown, the specific steps of the photovoltaic single-stage inverter control method based on dynamic DDPG of the present invention include:

[0092] S101: Determine the parameters related to the dynamic DDPG model:

[0093] The dynamic DDPG algorithm can essentially be regarded as a Markov decision process (MDP), so it is necessary to pre-set the relevant parameters of the dynamic DDPG model. In the present invention, the state, action and reward functions are set as follows:

[0094] Status: For a photovoltaic single-stage inverter, its component environmental characteristics include the DC-AC circuit input voltage v pv , input current i pv , the output voltage e of the first-order filter circuit g With the output current i g Therefore, the present invention sets the state in They represent the input voltage and input current of the DC-AC circuit in the photovoltaic single-stage inverter at time t, They represent the output voltage and output current of the first-order filter circuit in the photovoltaic single-stage inverter respectively, and S represents the state space, which is determined according to the actual value range of each parameter in the state.

[0095] Action: Since the inverter efficiency and performance of the photovoltaic single-stage inverter depends on the carrier frequency signal f c With dead time T d Therefore, the present invention sets the action in represents the carrier frequency signal at time t, represents the dead time at time t, and A represents the action space, which is determined according to the actual value range of each parameter in the action.

[0096] Reward function: The reward function r in this invention t The calculation formula is as follows:

[0097]

[0098] Where δ represents the zero-voltage switching (ZVS) penalty factor, G goal represents the optimization efficiency parameter, which can be set to loss, RMS current, peak current, etc. according to actual needs. Through the above two parameters, the intelligent agent can avoid learning the situation of ZVS loss. ζ represents the output power error penalty factor, and p0 represents the expected output power.

[0099] S102: Dynamic DDPG model offline training:

[0100] In order to use the dynamic DDPG model to make control decisions for a photovoltaic single-stage inverter, it is necessary to first set the dynamic DDPG model according to actual needs. Figure 2 Schematic diagram of the structure and offline training process of the dynamic DDPG model in the present invention. Figure 2 As shown, the dynamic DDPG model in the present invention includes four neural networks, including the evaluation network Q(s,a|θ Q ), policy network μ(s|θ μ ), target evaluation network Q′ and target strategy network μ′, and perform offline training on the dynamic DDPG model. In this embodiment, the number of hidden layers and the number of neurons in each hidden layer of each neural network in the dynamic DDPG model are selected by cross-validation method.

[0101] according to Figure 2 It can be seen from the offline training process shown that the training process of the conventional DDPG model is improved in the present invention. Figure 3 This is the offline training flow chart of the dynamic DDPG model in the present invention. Figure 3 As shown, the specific steps of offline training of the dynamic DDPG model in the present invention include:

[0102] S301: Initialize the dynamic DDPG model:

[0103] The parameters of the evaluation network Q and the policy network μ are randomly initialized, and two identical target evaluation networks Q′ and target policy networks μ′ are obtained by copying them respectively.

[0104] S302: Initialize the experience replay cache pool:

[0105] During training, the dynamic DDPG model needs to maintain an experience replay cache pool C to store experience samples, so it is necessary to establish the experience replay cache pool C and initialize it.

[0106] S303: Set training round m=1.

[0107] S304: Acquire initial state s1.

[0108] S305: Set time t=1.

[0109] S306: Generate experience samples:

[0110] The policy network μ is used to calculate each state s t With a t =μ(s t |θ μ) strategy to select actions and add noise to the selected actions as state s t The corresponding action a t According to the state s t and action a t Get the state s at the next moment t+1 and reward r t , then (s t ,a t ,r t ,s t+1 ) are stored as experience samples in the experience replay buffer pool C. If the number of experience samples in the experience replay buffer pool C exceeds its predetermined capacity, the redundant experience samples may be deleted according to a predetermined rule, for example, a first-in-first-out rule may be adopted.

[0111] S307: Evaluation network parameter update:

[0112] A sample set of N is randomly selected from the experience replay buffer pool C to form a training set, and the target evaluation network Q′ is used to estimate the action to obtain the value y of the action i , the calculation formula is as follows:

[0113] y i =r i +Q′(s i+1 ,μ′(s i+1 |θ μ′ )|θ Q′ )

[0114] Among them, i=1,2,…,N.

[0115] Calculate the loss function L(θ Q ) and evaluate the parameters θ of the network Q Update, in this embodiment, the loss function L(θ Q ) uses mean square error, and the specific calculation formula is as follows:

[0116] L(θ Q )=Ε (s,a) [(Q(s i ,a i |θ Q )-y i ) 2 ]

[0117] Among them, (s,a) [] indicates seeking expectation.

[0118] S308: Determine whether t<T, where T represents the preset maximum time step. If so, proceed to step S309; ​​otherwise, proceed to step S310.

[0119] S309: Let t=t+1, and return to step S307.

[0120] S310: Policy network parameter update:

[0121] The parameter θ in the strategy network in this embodiment μ The delayed update idea is adopted, that is, the policy network parameters will be fixed at the beginning of each round of training, and the gradient provided by the evaluation network will be used for optimization after the end of the round of training. Therefore, it is necessary to calculate the gradient of the policy network μ and update the parameters of the policy network μ. The calculation formula of the policy network gradient is as follows:

[0122]

[0123] in, represents the gradient of the policy network, β represents the sampling strategy, and ρ β The state distribution under sampling strategy β, Represents the policy function for the current policy θ μ The partial guide, represents the partial derivative of the action value function under the strategy obtained by the strategy network μ, where the action value function Q μ (s t ,a|θ Q ) is calculated as follows:

[0124]

[0125] Among them, s t 、s t+1 Respectively represent the state at time t and time t+1, a t 、a t+1 denote the actions at time t and time t+1 respectively, E μ [] represents the expected return of following the strategy of the policy network μ, G(s) represents the current value of future rewards that can be obtained by following the strategy of the policy network μ for a series of actions starting from time step t+1. t ,a t ) indicates state s t and action a t The cumulative reward under , the calculation formula is as follows:

[0126]

[0127] Where λ represents the discount factor, ranging from [0,1];

[0128] S311: Determine whether m<M, where M represents the preset maximum number of training rounds. If so, proceed to step S312, otherwise, the offline training ends.

[0129] S312: Determine whether m%η, η represents two target network soft update cycles, if so, proceed to step S313, otherwise proceed to step S314.

[0130] S313: Dynamic soft update target network parameters:

[0131] The following formula is used to dynamically soft update the two target networks:

[0132]

[0133] Wherein, τ(t) represents the soft update coefficient, τ(t)<<1, and its value is a negative correlation function of the training round t. In this embodiment, the maximum value of the soft update coefficient τ(t) is set to 0.01, and the minimum value is set to 0.001, so as to achieve an aggressive initial stage and a conservative later stage intelligent agent training strategy.

[0134] S314: Let m=m+1, and return to step S304.

[0135] S103: Obtaining the optimal control strategy:

[0136] Collect the current input voltage v of the photovoltaic single-stage inverter pv 、Input current i pv , output voltage e g and the output current i g , construct state S = [v pv ,i pv ,e g ,i g ], and then use the strategy network trained in step S102 to determine the optimal action A = [f c ,T d ], according to the carrier frequency signal f c and dead time T d Generate control signals to control the DC-AC circuit in the photovoltaic single-stage inverter.

[0137] In order to better implement the practical application of the photovoltaic single-stage inverter control method based on dynamic DDPG, the present invention also proposes a photovoltaic single-stage inverter control device based on dynamic DDPG. Figure 4 : is a specific implementation structure diagram of the photovoltaic single-stage inverter control device based on dynamic DDPG of the present invention. Figure 4 As shown, the photovoltaic single-stage inverter control device based on dynamic DDPG of the present invention comprises a V / I sensor 1, a microprogram controller (MCU) 2, an SPWM modulation circuit 3 and a drive circuit 4. Next, each component is described in detail.

[0138] V / I sensor 1 is used to collect the input voltage v of the photovoltaic single-stage inverterpv 、Input current i pv , output voltage e g and the output current i g And then convert it into digital signal and transmit it to microprogram controller 2.

[0139] A dynamic DDPG model is deployed on the microprogram controller 2 and offline training is performed in advance, wherein the state, action and reward function of the dynamic DDPG model are set using the method in step S101 of the photovoltaic single-stage inverter control method, and the specific method of offline training is the method in step S102 of the photovoltaic single-stage inverter control method.

[0140] The microcontroller 2 receives the input voltage v uploaded by the V / I sensor 1 pv 、Input current i pv , output voltage e g and the output current i g After that, construct the state S = [v pv ,i pv ,e g ,i g ], and then use the trained strategy network to determine the optimal action A = [f c ,T d ], thus obtaining the carrier frequency signal f c and dead time T d And sent to the SPWM modulation circuit 3.

[0141] The SPWM modulation circuit 3 is used to modulate the received carrier frequency signal f c With dead time T d , generating PWM pulse signals p1 and p2 and sending them to the driving circuit 4. In this embodiment, the SPWM modulation circuit 3 converts the carrier frequency signal f into c With the modulation signal (the frequency in this embodiment is 50Hz) considering the dead time T d Modulation is performed under the condition of generating PWM pulse signals p1 and p2.

[0142] The driving circuit 4 is used to generate driving signals q1, q1, q3, q3 according to the PWM pulse signals p1 and p2, and then act on the four switching elements S1, S2, S3, S4 in the photovoltaic single-stage inverter respectively to achieve orderly control of the four switching elements of the photovoltaic single-stage inverter.

[0143] Figure 4 A typical single-stage inverter circuit diagram for photovoltaics is drawn in Figure 3 As shown, the photovoltaic single-stage inverter includes an input voltage source v pv, voltage stabilizing capacitor C, first switch element S1, first diode D1, second switch element S2, second diode D2, third switch element S3, third diode D3, fourth switch element S4, fourth diode D4, filter inductor L i , filter capacitor C i , resistor R d , freewheeling inductor L g , output power e g The voltage stabilizing capacitor C and the input voltage source v pv The first switch element S1 is connected in anti-parallel with the first diode D1, and then connected in series with the module formed by the second switch element S2 and the second diode D2 in anti-parallel, forming bridge arm 1. The third switch element S3 is connected in anti-parallel with the third diode D3, and then connected in series with the module formed by the fourth switch element S4 and the fourth diode D4 in anti-parallel, forming bridge arm 2. Bridge arm 1 is connected in parallel with the voltage stabilizing capacitor C, and bridge arm 2 is connected in parallel with bridge arm 1. Filter inductor L i , filter capacitor C i With resistor R d phases in series, and connect one end to point A and the other end to point B. g One end is connected to the filter inductor L i The other end is connected to the output power supply e g The positive pole of the output power supply g The negative pole of is connected to point B. The DC-AC inverter circuit realizes the voltage inversion from DC to AC.

[0144] It can be seen that the photovoltaic single-stage inverter control device based on dynamic DDPG of the present invention collects the input voltage v pv 、Input current i pv , output voltage e g and the output current i g , the dynamic DDPG model is used to obtain the optimal carrier frequency signal f of the photovoltaic single-stage inverter in the current working state c With dead time T d , and then generate corresponding driving signals to control the first switch element S1, the second switch element S2, the third switch element S3, and the fourth switch element S4, thereby timely and effectively realizing the control of the photovoltaic single-stage inverter.

[0145] Although the above describes the illustrative specific embodiments of the present invention to facilitate those skilled in the art to understand the present invention, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.

Claims

1. A photovoltaic single-stage inverter control method based on dynamic DDPG, characterized in that: The following steps are involved: S1: Set the state, action and reward functions of the dynamic DDPG model as follows: state in They represent the input voltage and input current of the photovoltaic single-stage inverter at time t, They represent the output voltage and output current of the photovoltaic single-stage inverter at time t, respectively, and S represents the state space; action in represents the carrier frequency signal at time t, represents the dead time at time t, and A represents the action space; Reward function r t The calculation formula is as follows: Where δ represents the zero voltage turn-on penalty factor, G goal represents the optimization efficiency parameter, ζ represents the output power error penalty factor, and p0 represents the expected output power; S2: Set the four neural networks in the dynamic DDPG model according to actual needs, including the evaluation network Q(s,a|θ Q ), policy network μ(s|θ μ ), target evaluation network Q′ and target policy network μ′, and perform offline training on the dynamic DDPG model; the specific steps of offline training include: S2.1: Randomly initialize the parameters of the evaluation network Q and the policy network μ, and copy them to obtain two identical target evaluation networks Q′ and target policy networks μ′; S2.2: Establish an experience replay cache pool C and initialize it; S2.3: Let training round m = 1; S2.4: Get the initial state s1; S2.5: Let time t = 1; S2.6: The policy network μ is used to calculate each state s t With a t =μ(s t |θ μ ) strategy to select actions and add noise to the selected actions as state s t The corresponding action a t ; According to the state s t and action a t Get the state s at the next moment t+1 and reward r t , then (s t ,a t ,r t ,s t+1 ) are stored as experience samples in the experience replay buffer pool C; if the number of experience samples in the experience replay buffer pool C exceeds its predetermined capacity, the redundant experience samples are deleted according to the predetermined rules; S2.7: Randomly extract a sample set of N in the experience replay buffer pool C to form a training set, and use the target evaluation network Q′ to estimate the action to obtain the value y of the action i , the calculation formula is as follows: y i =r i +Q′(s i+1 ,μ′(s i+1 |θ μ′ )|θ Q′ ) Where, i = 1, 2, ..., N; Calculate the loss function L(θ Q ) and evaluate the parameters θ of the network Q Make updates; S2.8: Determine whether t<T, where T represents the preset maximum time step. If so, proceed to step S2.9; otherwise, proceed to step S2.10; S2.9: Set t=t+1, and return to step S2.7; S2.10: Calculate the gradient of the policy network μ and update the parameters of the policy network μ. The calculation formula of the policy network gradient is as follows: in, represents the gradient of the policy network, β represents the sampling strategy, and ρ β The state distribution under sampling strategy β, Represents the policy function for the current policy θ μ The partial guide, represents the partial derivative of the action value function under the strategy obtained by the strategy network μ, where the action value function Q μ (s t ,a|θ Q ) is calculated as follows: Among them, s t 、s t+1 Respectively represent the state at time t and time t+1, a t 、a t+1 denote the actions at time t and time t+1 respectively, E μ [] represents the expected return of following the strategy of the policy network μ, G(s) represents the current value of future rewards that can be obtained by following the strategy of the policy network μ for a series of actions starting from time step t+1. t ,a t ) indicates state s t and action a t The cumulative reward under , the calculation formula is as follows: Where λ represents the discount factor, ranging from [0,1]; S2.11: Determine whether m<M, where M represents the preset maximum number of training rounds. If so, proceed to step S2.12, otherwise, the offline training ends; S2.12: Determine whether m%η, η represents two target network soft update cycles, if yes, proceed to step S2.13, otherwise proceed to step S2.14; S2.13: Dynamically soft update the two target networks using the following formula: Wherein, τ(t) represents the soft update coefficient, τ(t)<<1, and its value is a negative correlation function of the training round t; Then proceed to step S2.14; S2.14: Set m=m+1, and return to step S2.4; S3: Collect the current input voltage v of the photovoltaic single-stage inverter pv 、Input current i pv , output voltage e g and the output current i g , construct state S = [v pv ,i pv ,e g ,i g ], and then use the strategy network trained in step S2 to determine the optimal action A = [f c ,T d ], according to the carrier frequency signal f c and dead time T d Generate control signals to control switching elements in a photovoltaic single-stage inverter.

2. The photovoltaic single-stage inverter control method according to claim 1, characterized in that: The loss function L(θ Q ) is calculated as follows: L(θ Q )=E (s,a) [(Q(s i ,a i |θ Q )-y i ) 2 ] Among them, (s,a) [] indicates seeking expectation.

3. The photovoltaic single-stage inverter control method according to claim 1, characterized in that: The maximum value of the soft update coefficient τ(t) in step S2.13 is 0.01, and the minimum value is 0.

001.

4. A photovoltaic single-stage inverter control device based on dynamic DDPG, characterized in that: It includes a V / I sensor, a microprogram controller, an SPWM modulation circuit and a drive circuit, wherein: The V / I sensor is used to collect the input voltage v of the photovoltaic single-stage inverter pv 、Input current i pv , output voltage e g and the output current i g And convert it into digital signal and transmit it to microprogram controller; The dynamic DDPG model is deployed on the microcontroller and trained offline in advance. The state, action and reward functions of the dynamic DDPG model are set as follows: state in They represent the input voltage and input current of the photovoltaic single-stage inverter at time t, They represent the output voltage and output current of the photovoltaic single-stage inverter at time t, respectively, and S represents the state space; action in represents the carrier frequency signal at time t, represents the dead time at time t, and A represents the action space; Reward function r t The calculation formula is as follows: Where δ represents the zero voltage turn-on penalty factor, G goal represents the optimization efficiency parameter, ζ represents the output power error penalty factor, and p0 represents the expected output power; According to actual needs, set up four neural networks in the dynamic DDPG model, including the evaluation network Q(s,a|θ Q ), policy network μ(s|θ μ ), target evaluation network Q′ and target strategy network μ′, and then conduct offline training. The specific steps include: 1) Randomly initialize the parameters of the evaluation network Q and the policy network μ, and copy them to obtain two identical target evaluation networks Q′ and target policy networks μ′; 2) Establishing and initializing the experience replay buffer pool C; 3) Let training round m = 1; 4) Get the initial state s1; 5) Let time t = 1; 6) The policy network μ is used to calculate each state s t With a t =μ(s t |θ μ ) strategy to select actions and add noise to the selected actions as state s t The corresponding action a t ; According to the state s t and action a t Get the state s at the next moment t+1 and reward r t , then (s t ,a t ,r t ,s t+1 ) are stored as experience samples in the experience replay buffer pool C; if the number of experience samples in the experience replay buffer pool C exceeds its predetermined capacity, the redundant experience samples may be deleted according to the established rules; 7) Randomly extract a sample set of N in the experience replay buffer pool C to form a training set, and use the target evaluation network Q′ to estimate the action to obtain the value y of the action i , the calculation formula is as follows: y i =r i +Q′(s i+1 ,μ′(s i+1 |θ μ′ )|θ Q′ ) Where, i = 1, 2, ..., N; Calculate the loss function L(θ Q ) and evaluate the parameters θ of the network Q Make updates; 8) Determine whether t<T, where T represents the preset maximum time step. If so, proceed to step S9), otherwise proceed to step 10); 9) Let t=t+1, and return to step 7); 10): Calculate the gradient of the policy network μ and update the parameters of the policy network μ. The calculation formula of the policy network gradient is as follows: in, represents the gradient of the policy network, β represents the sampling strategy, and ρ β The state distribution under sampling strategy β, Represents the policy function for the current policy θ μ The partial guide, represents the partial derivative of the action value function under the strategy obtained by the strategy network μ, where the action value function Q μ (s t ,a|θ Q ) is calculated as follows: Among them, s t 、s t+1 Respectively represent the state at time t and time t+1, a t 、a t+1 denote the actions at time t and time t+1 respectively, E μ [] represents the expected return of following the strategy of the policy network μ, G(s) represents the current value of future rewards that can be obtained by following the strategy of the policy network μ for a series of actions starting from time step t+1. t ,a t ) indicates state s t and action a t The cumulative reward under , the calculation formula is as follows: Where λ represents the discount factor, ranging from [0,1]; 11) Determine whether m<M, where M represents the preset maximum number of training rounds. If so, proceed to step 12), otherwise, the offline training ends; 12) Determine whether m%η, η represents two target network soft update cycles, if yes, proceed to step 13), otherwise proceed to step 14); 13) Use the following formula to dynamically soft update the two target networks: Wherein, τ(t) represents the soft update coefficient, τ(t)<<1, and its value is a negative correlation function of the training round t; Then proceed to step 14); 14) Let m=m+1, and return to step S4); The microcontroller receives the input voltage v uploaded by the V / I sensor pv 、Input current i pv , output voltage e g and the output current i g After that, construct the state S = [v pv ,i pv ,e g ,i g ], and then use the trained strategy network to determine the optimal action A = [f c ,T d ], thus obtaining the carrier frequency signal f c and dead time T d And sent to the SPWM modulation circuit; The SPWM modulation circuit is used to modulate the received carrier frequency signal f c With dead time T d , generate PWM pulse signals p1 and p2 and send them to the drive circuit; The driving circuit is used to generate a driving signal according to the PWM pulse signals p1 and p2. Then, it acts on the four switch elements S1, S2, S3, and S4 in the photovoltaic single-stage inverter respectively to achieve orderly control of the four switch elements of the photovoltaic single-stage inverter.

5. The photovoltaic single-stage inverter control device according to claim 4, characterized in that: In step 7), the loss function L(θ Q ) is calculated as follows: L(θ Q )=E (s,a) [(Q(s i ,a i |θ Q )-y i ) 2 ] Among them, (s,a) [] indicates seeking expectation.

6. The photovoltaic single-stage inverter control device according to claim 4, characterized in that: The maximum value of the soft update coefficient τ(t) in step 13) is 0.01, and the minimum value is 0.

001.

7. The photovoltaic single-stage inverter control device according to claim 4, characterized in that: The SPWM modulation circuit converts the carrier frequency signal f c With the modulation signal taking into account the dead time T d Modulation is performed under the condition of generating PWM pulse signals p1 and p2.

Citation Information

Cited By

  • Inverter control method based on feature recognition model

    CN119543679A

  • Inverter control method based on feature recognition model

    CN119543679B

  • Coherent detection spatial light cooperative transmission method based on local oscillator elastic light splitting

    CN119853815A

  • Photovoltaic inverter total efficiency evaluation system and method thereof

    CN121933802A