A method to accelerate the training process of reinforcement learning for inverter control
By constructing an inverter circuit simulation model and using the DDPG algorithm to train reinforcement learning agents, the output voltage frequency is increased, which solves the problem of too long inverter control training process and achieves faster learning and higher current regulation accuracy. .
Patent Information
- Application Number
- CN202410509486.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-04-23
AI Technical Summary
The reinforcement learning training process in inverter control takes too long, resulting in a decrease in voltage and current regulation accuracy, and cannot effectively cope with the uncertainty and interference factors of circuit parameter changes and load changes.
By constructing an inverter circuit simulation model, the deep deterministic policy gradient (DDPG) reinforcement learning algorithm is used to train reinforcement learning agents, increase the output voltage frequency, shorten the training cycle, and extract convergence parameters for actual circuit control.
It speeds up the time for the reinforcement learning agent to learn the optimal strategy, shortens the training cycle, increases the inverter output voltage frequency, enhances the current regulation accuracy, and solves the problem of too long training process.
Smart Images

Figure CN118381368B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of DC-AC converter intelligent control, and in particular to a method for accelerating a reinforcement learning training process of inverter control. Background Art
[0002] With the rapid advancement of power electronics and smart grid technologies, various distributed renewable energy systems have been integrated into existing power systems. In this context, DC-AC converters have attracted extensive research attention as a low-cost, simple and efficient solution. These converters have been widely used in uninterruptible power supplies, variable frequency power supplies, and motor drives, and have shown great potential in future industrial, transportation, and military applications.
[0003] However, in the actual application of the converter, various uncertainties and interference factors will be encountered, such as changes in circuit parameters, changes in loads, and fluctuations in supply voltage. These factors have an adverse effect on the performance of the converter, resulting in a significant decrease in the accuracy of voltage and current regulation. Reinforcement learning control is one of the control methods to overcome the above obstacles. However, during the inverter training process, the agent needs to go through a complete inverter working cycle in a stable state. This requirement restricts the training speed of the reinforcement learning agent for inverter control. Therefore, it is necessary to propose a reinforcement learning training process acceleration method for inverter control to solve the above problems. Summary of the invention
[0004] The purpose of the present invention is to provide a method for accelerating the reinforcement learning training process of inverter control, which increases the output voltage frequency of the inverter during the training process, shortens the training time under the number of cycles required for training, enables the reinforcement learning agent to learn the optimal strategy more quickly, and effectively solves the problem of too long reinforcement learning training process for inverter control.
[0005] To achieve the above object, the present invention provides a method for accelerating the reinforcement learning training process of inverter control, comprising the following steps:
[0006] S1. Construction of reinforcement learning control model: Establish an inverter circuit simulation model as a reinforcement learning training environment, and build a reinforcement learning controller model based on the reinforcement learning algorithm;
[0007] S2. Reinforcement learning algorithm design, updating the neural network parameters of the reinforcement learning agent based on immediate rewards;
[0008] S3. Immediately reward and update the neural network parameters of the reinforcement learning agent until the parameters converge, and extract the converged reinforcement learning agent parameters for application in the control of the actual circuit.
[0009] Preferably, in step S1, the output voltage alternating frequency of the inverter simulation model is 1 / 4 of the output voltage alternating frequency of the actual circuit. n times.
[0010] Preferably, in step S1, the reinforcement learning control model includes a reinforcement learning controller model, a reward module and a state observation vector.
[0011] Preferably, in step S1, the state observation vector is input into the reinforcement learning agent to obtain a behavioral action, which acts on the inverter and forms a new state observation vector; the reward module obtains an immediate reward based on the feedback of the inverter under the control action.
[0012] Preferably, in step S3, the output voltage alternating frequency of the inverter simulation model is equal to the actual circuit. n The neural network parameters obtained by training under multiple conditions are applied to the control of actual circuits.
[0013] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 A schematic diagram of inverter reinforcement learning training of an inverter-controlled reinforcement learning training process acceleration method of the present invention;
[0015] Figure 2 This is the overall process of a method for accelerating a reinforcement learning training process controlled by an inverter of the present invention. DETAILED DESCRIPTION
[0016] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.
[0017] For the sake of clarity and simplicity, not all features of the actual implementation are described in the specification. However, it should be understood that many implementation-specific decisions must be made in the process of developing any such actual implementation in order to achieve the specific goals of the developer, for example, to meet those restrictions related to the system and business, and these restrictions may change with different implementations. In addition, it should be understood that although the development work may be very complex and time-consuming, it is only a routine task for those skilled in the art who benefit from the disclosure of the present invention. For the sake of clarity and simplicity, not all features of the actual implementation are described in the specification. However, it should be understood that many implementation-specific decisions must be made in the process of developing any such actual implementation in order to achieve the specific goals of the developer, for example, to meet those restrictions related to the system and business, and these restrictions may change with different implementations. In addition, it should be understood that although the development work may be very complex and time-consuming, it is only a routine task for those skilled in the art who benefit from the disclosure of the present invention.
[0018] Embodiment 1
[0019] like Figure 1-2 As shown, a method for accelerating the reinforcement learning training process of inverter control increases the output voltage frequency of the inverter during the training process, shortens the training time under the number of cycles required for training, enables the reinforcement learning agent to learn the optimal strategy more quickly, and effectively solves the problem of too long reinforcement learning training process for inverter control.
[0020] The following steps are involved:
[0021] S1, reinforcement learning control model construction;
[0022] like Figure 1-2 As shown in Figure 1, a three-phase two-level inverter circuit simulation model is established as a reinforcement learning training environment, where the output voltage frequency of the actual circuit is 50Hz, and the output voltage alternating frequency of the inverter simulation model is the actual circuit. n times, that is, 50nHz, where the inverter is a three-phase two-level inverter, and is trained using a reinforcement learning algorithm based on deep deterministic policy gradient (DDPG).
[0023] Using current sensors to measure three-phase alternating current in inverter simulation models I a , I b , I c , after Clarke transformation of formula (1), it becomes I α, I β , and then through the Parker transformation of formula (2), we can get the d and q axis coordinate system I d , I q When the d-axis coincides with the a-axis, the inverter control target is that the d-axis component of the current is a fixed reference value and the q-axis component is zero.
[0024] (1)
[0025] (2)
[0026] in w Equal to 100π is d, q axis rotation angular velocity, n It is a multiple of the inverter output voltage frequency during the training process.
[0027] A reinforcement learning controller model is constructed based on the reinforcement learning algorithm, wherein the reinforcement learning control model includes a reinforcement learning agent, a reward module and a state observation vector.
[0028] Reinforcement learning control is achieved through the interaction between the agent and the environment. t At this moment, the state observation vector is obtained from the environment S t Input the agent to get the action in this state a t Act on inverter topology to get instant rewards R t and the state observation vector at the next moment S t+1 Forming a Markov process with unlimited horizon, the weights of the neural network are continuously optimized based on the reinforcement learning algorithm, thereby continuously increasing the cumulative reward of each training process G t To enhance the control effect. According to the control target of the three-phase two-level inverter, the agent is given a greater reward when the reinforcement learning control is closer to the control target. t The reward function at the moment can be set as:
[0029] (3)
[0030] in, R t where represents an immediate reward, I dref is the reference value of the d-axis current component, I qref is the reference value of the q-axis current component.
[0031] Will tAt this moment, the inverter output current d, the component in the q-axis coordinate system I d , I q ,as well as I d , I q Error relative to reference value e The integral of the error As the state observation vector S t To indicate the state of the environment.
[0032] (4)
[0033] (5)
[0034] (6)
[0035] Will t The state observation vector represents the state of the environment at any moment S t Input reinforcement learning agent to get the action in this state a t , the control action of the three-phase two-level inverter in the example is set as U d , U q , the control action is obtained through Park inverse transform and Clark inverse transform U a , U b , U c , where the angular velocity of the coordinate system rotation used by the Parker inverse transform is still nw To ensure the actual circuit output voltage alternating frequency n times. U a , U b , U c The switching signals of the three upper bridge arms of the inverter can be obtained through pulse width modulation, and the switching signals of the three lower bridge arms are opposite to the switching signals of the corresponding upper bridge arms.
[0036] S2, reinforcement learning algorithm design;
[0037] First, based on reinforcement learning theory, the action value approximation function Q ( s,a|θ Q ) indicates that in the state s t By taking specific actionsa t Expected rewards G t , the calculation formula of this function is as follows:
[0038] (7)
[0039] (8)
[0040] In the formula, R t express t Instant rewards at all times, G t Indicates that the agent starts from the initial state during training s t The total reward accumulated to the end state; γ is the discount factor for calculating the cumulative reward of each training process; i Q Refers to the parameters of the Critic neural network.
[0041] Objective function of policy function iteration J ( i μ ) Approximation function by action value Q ( s,a|θ Q ), where i μ Represents the parameters of the Actor neural network:
[0042] (9)
[0043] During training, a Markov decision process is formed by the interaction between the agent and the DC-AC inverter. The policy approximation function m ( s|θ μ ) i μ Update via gradient ascent in the direction that produces the highest expected return and maximum cumulative reward. J ( i μ ) is as follows:
[0044] (10)
[0045] During training, a one-step temporal difference is used to minimize the loss function L ( i Q ) to iteratively update the action value approximation function Q ( s,a|θ Q ) i Q , so that the action value function gradually approaches the true value in the environment, and the loss function L ( i Q ) is defined as:
[0046] (11)
[0047] (12)
[0048] Both the Actor and Critic neural networks are backed up by a set of neural networks with the same initial parameters (called target networks). The target networks can make the training process more stable and use the parameter τ to soft-update the target networks. i Q’ and i μ’ are the network parameters of the Critic and Actor target neural networks respectively. The update method of the target network is as follows:
[0049] (13)
[0050] S3, Inverter reinforcement learning training process and acceleration process
[0051] After setting up the training environment, reinforcement learning control model, and designing the reinforcement learning algorithm, you need to set parameters for training the reinforcement learning agent, including the learning rate of the Actor and Critic networks, the discount factor γ, and the training time of each training process. T f etc., where the training time is 100ms to ensure that the reinforcement learning agent experiences a complete inverter working cycle in a stable state. T f In the case of no acceleration, the inverter is set to two working cycles, i.e. 0.04s, so that the inverter reaches a stable state in the first cycle.
[0052] The stable state is maintained for another cycle. Figure 2 As shown, when using the acceleration method of the present invention, setting n =2, the inverter output alternating voltage cycle becomes twice as long as before, and the training time T f It is still set to two working cycles of the inverter, but the simulation time is shortened to half of the original, that is, 0.02s, which speeds up the training and saves computing resources.
[0053] After setting the parameters, during the training process, the reinforcement learning agent receives the state observation vector of the inverter s t and immediate rewards for actionsa t , use the above DDPG algorithm to continuously optimize the parameters of the Actor and Critic neural networks, so that the cumulative reward of each training process continues to increase until the cumulative reward no longer increases and the network parameters converge. After the training is completed, the Actor network parameters are extracted, and the Actor network is used as a controller to input the inverter state observation vector s t , output control action a t , thereby controlling the actual circuit of the inverter.
[0054] Therefore, the present invention adopts the above-mentioned structure to accelerate the reinforcement learning training process of inverter control, which increases the output voltage frequency of the inverter during the training process, shortens the training time under the number of cycles required for training, enables the reinforcement learning agent to learn the optimal strategy more quickly, and effectively solves the problem of too long reinforcement learning training process for inverter control.
[0055] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for accelerating the reinforcement learning training process of inverter control, characterized in that: The following steps are involved: S1. Construct a reinforcement learning control model; establish an inverter circuit simulation model as a reinforcement learning training environment, and construct a reinforcement learning controller model based on the reinforcement learning algorithm; The three-phase alternating current Ia, Ib, and Ic of the inverter simulation model are measured using a current sensor, and are transformed into Iα and Iβ in the α and β coordinate systems through Clarke transformation according to formula (1); Then, the Id and Iq in the d-axis and q-axis coordinate systems are obtained by Parker transformation of formula (2). When the d-axis and the q-axis coincide, the control target of the inverter is that the d-axis component of the current is a fixed reference value and the q-axis component is 0; Where w is equal to 100π for d, q-axis rotation angular velocity, and n is the multiple of the inverter output voltage frequency during the training process; Reinforcement learning control is achieved by the interaction between the agent and the environment, that is, at time t, the state observation vector S is obtained from the environment t Input the agent to get the action a in this state t Acting on inverter topology to get instant reward R t and the state observation vector S at the next moment t+1 Forming an infinite-horizon Markov process, the neural network weights are continuously optimized based on the reinforcement learning algorithm, thereby continuously increasing the cumulative reward G of each training process t To enhance the control effect, according to the control target of the three-phase two-level inverter, the agent is given a greater reward when the reinforcement learning control is closer to the control target. The reward function at time t can be set as: Among them, R t Indicates immediate reward, I dref is the reference value of the d-axis current component, I dref is the reference value of the q-axis current component; At time t, the inverter output current d, the components Id, Iq in the q-axis coordinate system, and the errors e of Id, Iq relative to the reference values and the integral of the error ∫|e|dt are used as the state observation vector St to represent the environmental state; e1=I dref -I d (4) e2=I qref -I q (5) s t ={I d ,d1∫|e1|dt,I q ,e2,∫|e2|dt,} (6) The state observation vector S representing the state of the environment at time t t Input the reinforcement learning agent to obtain the action at in this state, set the control action Ud, Uq for the three-phase two-level inverter in the example, and obtain Ua, Ub, Uc through Park inverse transformation and Clark inverse transformation. The angular velocity of the coordinate system rotation used by Park inverse transformation is still nw to ensure that the output voltage alternating frequency is n times of the actual circuit. Ua, Ub, Uc can obtain the switching signals of the three upper bridge arms of the inverter through pulse width modulation, and the switching signals of the three lower bridge arms are opposite to the switching signals of the corresponding upper bridge arms. S2. Reinforcement learning algorithm design, updating the neural network parameters of the reinforcement learning agent based on immediate rewards; Based on reinforcement learning theory, the action value approximation function Q(s, a|θ Q ) means in state s t By taking a specific action a t The expected reward G t , the calculation formula of this function is as follows: Q(s,a|θ Q )≈E[G t |s=s,a=a t ] (7) In the formula, R t represents the immediate reward obtained at time t, G t represents the total reward accumulated by the agent from the starting state st to the end state during the training process; γ is the discount factor for calculating the cumulative reward of each training process; θ Q Refers to the parameters of the Critic neural network; The objective function J(θ) of the policy function iteration μ ) is approximated by the action value function Q(s,a|θ Q ), where θμ represents the parameters of the Actor neural network: During training, the Markov decision process is formed by the interaction between the agent and the DC-AC inverter; the strategy approximation function μ(s|θ μ ) parameter θ μ Update via gradient ascent in the direction that produces the highest expected return and maximum cumulative reward; the update equation for J(θμ) is as follows: During the training process, a one-step temporal difference is used to minimize the loss function L(θ Q ) to iteratively update the action value approximation function Q(s,a|θ Q ) parameter θ Q , so that the action value function gradually approaches the true value in the environment, and the loss function L(θ Q ) is defined as: y t =R t +γθ(s t+1 ,a t+1 |θ Q ) (12) Both the Actor and Critic neural networks are backed up with a set of neural networks with the same initial parameters, and the target network is soft-updated using parameters τ, θ Q’ and θ μ’ are the network parameters of the Critic and Actor target neural networks respectively. The update method of the target network is as follows: S3. Immediately reward and update the neural network parameters of the reinforcement learning agent until the parameters converge, and extract the converged reinforcement learning agent parameters for application in the control of the actual circuit.
2. The method for accelerating the reinforcement learning training process of inverter control according to claim 1, characterized in that: In step S1 , the output voltage alternating frequency of the inverter simulation model is n times the output voltage alternating frequency of the actual circuit.
3. The method for accelerating the reinforcement learning training process of inverter control according to claim 1, characterized in that: In step S1, the reinforcement learning control model includes a reinforcement learning controller model, a reward module and a state observation vector.
4. The method for accelerating the reinforcement learning training process of inverter control according to claim 3, characterized in that: The state observation vector is input into the reinforcement learning agent to obtain the behavior action, which acts on the inverter and forms a new state observation vector; the reward module obtains instant reward based on the feedback of the inverter under the control action.
5. The method for accelerating the reinforcement learning training process of inverter control according to claim 2, characterized in that: In step S3, the neural network parameters obtained by training when the output voltage alternating frequency of the inverter simulation model is n times that of the actual circuit are applied to the control of the actual circuit.
Citation Information
Patent Citations
Photovoltaic inverter low voltage ride through detection method and system
CN111463829A
Inverter controller based on deep reinforcement learning
CN112187074A
