Application method for realizing and simulating rocket recovery controller based on DDPG reinforcement learning

Through the improved DDPG reinforcement learning algorithm and the MindSpore framework, the problem of automatic trajectory planning and simulation verification of the domestic framework in the rocket recovery controller has been solved, the effect of the rocket's vertical return and soft landing has been achieved, and the domestic artificial intelligence has been promoted in deep reinforcement learning. field of application.

CN118550207APending Publication Date: 2024-08-27BEIJING AEROSPACE AUTOMATIC CONTROL RES INST
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311634804.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-01
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

There is a lack of deep reinforcement learning implementation based on domestic frameworks in China, especially in the application of rocket recovery controllers. It is difficult to achieve automatic trajectory planning and simulation verification with existing technology, which affects the construction of an ecological environment for the development of domestic artificial intelligence in this field.

Method used

An improved DDPG reinforcement learning algorithm is used combined with the MindSpore framework to perform simplified dynamics modeling and reward function design of the rocket's falling process. The MindSpore framework is introduced for simulation to achieve trajectory planning and control effects of the rocket recovery controller.

Benefits of technology

Successfully achieved a rocket vertical return soft landing in digital simulation. Through network structure improvement and reward function design, a better rocket recovery control effect was achieved, providing a feasible method for subsequent rocket recovery missions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550207A
    Figure CN118550207A
Patent Text Reader

Abstract

The embodiment of the invention provides a rocket recovery controller implementation and simulation application method based on DDPG reinforcement learning, and relates to the technical field of aircraft guidance control, and the method comprises the following steps: carrying out the simplified dynamic modeling and reward design of a rocket falling process, and carrying out the training through a DDPG which outputs a mean value and a standard deviation after improvement; trajectory planning and guidance are carried out on the rocket falling trajectory in a reinforcement learning mode; the method mainly comprises the steps of defining a state quantity for describing a trajectory, designing a corresponding return function according to terminal constraints, performing trajectory planning and guidance of continuous behaviors by adopting DDPG, and introducing a Mindore localization framework for simulation. According to the application, a better effect is achieved through the improvement of the network structure and the design of the reward function, and the vertical return soft landing of the rocket can be realized based on mathematical simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of aircraft guidance and control technology, and in particular, to an application method for realizing and simulating a rocket recovery controller based on DDPG reinforcement learning. Background Art

[0002] After more than half a century of development, artificial intelligence has made great progress and entered a new stage of development, especially driven by new theories and technologies such as the Internet, big data, supercomputing, sensor networks, brain science, and strong demands for economic and social development. However, there are still some problems in the domestic artificial intelligence development ecosystem. They are mainly reflected in the lack of end-to-end engineering experience, the lack of an international ecosystem, and the lack of a full-stack artificial intelligence software and hardware integrated platform, which is not conducive to the development, debugging, and simulation verification integration of deep learning and reinforcement learning control programs.

[0003] In response to this situation, Huawei has proposed a full-stack, full-scenario strategic solution. Figure 2 MindSpore is a full-scenario AI computing framework launched by Huawei, which can significantly reduce training time and cost (development state), run with fewer resources and the highest energy efficiency ratio (operation state), and adapt to all scenarios including end, edge and cloud (deployment state).

[0004] The MindSpore framework architecture supports large or small scales to adapt to independent deployment in all scenarios for different operating environments. The MindSpore framework achieves cross-scenario collaboration while ensuring the protection of user privacy data by collaborating processed gradients and model information without privacy information, rather than the data itself. In addition to privacy protection, MindSpore also builds model protection into the framework to ensure the security and reliability of the model.

[0005] MindSpore makes the development environment more friendly by implementing AI algorithms as code, which can significantly reduce model development time. Figure 3 As shown in the figure, the MindSpore framework architecture is generally divided into three layers: MindSpore front-end presentation layer, MindSpore computational graph engine, and MindSpore back-end runtime. With self-developed AI chips, it can produce more powerful computing efficiency. Using MindSpore can significantly reduce training time and cost, and achieve the highest performance with the least resources. MindSpore natively supports Ascend AI processors, making AI model development more concise and efficient.

[0006] Huawei's Mindspore has achieved good overall performance by adopting a strategy of optimizing both software and hardware. It is expected to change the current situation where Pytorch and TensorFlow dominate the academic and industry circles respectively, thus breaking the monopoly of foreign countries in the AI ​​R&D ecosystem.

[0007] Another major advantage of Mindspore is the visual training environment. Similar to TensorFlow, MindInsight supports visualization of the training process. The training dashboard supports viewing the training process on the page. The training dashboard includes modules such as training scalar information, parameter distribution graph, calculation graph, data graph, data sampling, etc. The training dashboard is an innovation of MindInsight in presenting the training process. Figure 4 As shown, by integrating multiple types of data on one page, users only need to open the training dashboard to get an overview of the training status.

[0008] How such an effective and user-friendly domestic framework can be truly integrated into the process of algorithm development, debugging, and simulation testing is of great significance to the subsequent upgrade and development of the AI ​​framework. Although MindSpore has been applied in some simple classification tasks, due to the complex structure and large number of components of deep reinforcement learning, there is still no implementation based on MindSpore. The present invention takes the trajectory planning of the rocket descent as the application scenario, and uses MindSpore to design an improved DDPG model, which better realizes the reinforcement learning trajectory planning function, and has realized the soft landing of the rocket vertical return in digital simulation.

[0009] Despite its great potential, MindSpore is still rarely used in academia and industry. In particular, there is no implementation of deep reinforcement learning algorithms based on the MindSpore framework. As a promising field in artificial intelligence research, deep reinforcement learning has shown great promise in dealing with complex, multifaceted and sequential decision-making problems. It is not only useful for industrial systems and games, but also for marketing, education and even data science itself. The lack of implementation of reinforcement learning processes based on domestic frameworks will affect the future development of the domestic artificial intelligence ecological environment in this field. Summary of the invention

[0010] An embodiment of the present application provides an application method for the implementation and simulation of a rocket recovery controller based on DDPG reinforcement learning, so as to realize a reinforcement learning DDPG rocket recovery controller based on the domestic MindSpore, complete the practical application of the implementation and simulation of the domestic framework in the field of deep learning, and achieve better control effects of the rocket recovery controller by improving the DDPG algorithm, providing a method for subsequent rocket recovery tasks.

[0011] In order to achieve the above objectives, this application provides the following technical solutions:

[0012] An application method for implementing and simulating a rocket recovery controller based on DDPG reinforcement learning is provided in an embodiment of the present application. The method comprises the following steps:

[0013] The rocket falling process was simplified by dynamic modeling and reward design, and the improved DDPG with output mean and standard deviation was used for training.

[0014] The rocket's falling trajectory is planned and guided by reinforcement learning. The trajectory planning includes: defining the state quantity of the trajectory and designing the reward function according to the terminal constraints, using DDPG for continuous behavior trajectory planning, and introducing the Mindspore framework for simulation.

[0015] Preferably, the state quantity describing the trajectory includes the position state quantity x t ,y t 、z t and velocity state v x_t 、v y_t 、v z_t .

[0016] Preferably, the designing of the reward function according to the terminal constraint specifically includes:

[0017] D1: Define the initial position as [0m,50m,0m], the initial speed as [0m,0m,0m], the target position as the origin on the ground [0m,0m,0m], and the expected speed when reaching the origin as [0m,0m,0m];

[0018] D2: Define the action space using thrust as P and pitch angle as The yaw angle is ψ, and the value range of P is 600N~1000N. The value range of is 80°~100°, and the value range of ψ is -10°~10°;

[0019] D3: When rolling is removed, the conversion relationship from the arrow system to the ground system is:

[0020]

[0021] This matrix is ​​not used for attitude calculation, but only for representing the direction of the arrow body movement;

[0022] D4: The differential equation of motion of the simplified aircraft particle model under the ground system is:

[0023] and

[0024] D5: Based on the above differential equation, the fixed-step fourth-order Runge-Kutta method is used for numerical integration to solve the state quantity of each beat;

[0025] D6: Based on the conversion relationship, differential equation and state quantity, the combined velocity and displacement of the model are obtained as follows:

[0026]

[0027] D7: The reward function is designed as:

[0028]

[0029] Since the rocket body is recovered vertically from an initial velocity of 0, and the terminal state requires a velocity of 0, it needs to accelerate first and then decelerate. Therefore, a certain speed increase should be allowed at the beginning of the trajectory, while a speed reduction should be encouraged at the terminal. This design can make the penalty for speed increase greater the closer the rocket body is to the ground.

[0030] Preferably, in the numerical integration of the fixed-step fourth-order Runge-Kutta method to solve the state quantity of each beat, the simulation start time is defined as t0=0s, and the integration step is Δt=0.01s. All real numbers are double-precision floating point numbers.

[0031] Preferably, the method of using a fixed-step fourth-order Runge-Kutta method to numerically integrate and solve the state quantity of each beat also includes:

[0032] Normalize the state quantities in the environment.

[0033] Preferably, the design reward function further includes:

[0034] D8: Add a proportional coefficient in the speed direction so that the rocket's speed decreases faster as it gets closer to the landing point.

[0035] Preferably, the trajectory planning of continuous behavior using DDPG specifically includes:

[0036] S1: Improve the DDPG algorithm. The improvement steps include:

[0037] S11: Determine the concept point of the DDPG algorithm, the concept point includes s t 、a t , r(s(t),a(t)) and Among them, s t is: the state of the environment observed by the rocket particle at time t, at which time s t Expressed as [x t ,y t ,z t ,v x_t ,v y_t ,vz_t ], and, after execution through the environment, the state of the environment is changed from s t Convert to s t+1 ; a t is: the behavior of the rocket particle at time t; r(s(t), a(t)) is: the environment in state s t Execute a t After that, the single-step reward value is returned; It is the weighted sum of the reward values ​​obtained from all behaviors from the current state to a certain state in the future;

[0038] S12: Determine the key points of the DDPG algorithm, including the deterministic behavior strategy μ, the strategy network θ μ and behavior strategy β, where the deterministic behavior strategy μ is defined as: t =μ(s t ) is calculated; strategy network θ μ is: Use a convolutional neural network to simulate the μ function; the behavior strategy β is: During the reinforcement learning training process, DDPG usually adds noise to the deterministic strategy to increase the diversity of actions in order to balance exploration and exploitation;

[0039] S13: By changing the original deterministic action output to a probabilistic output, the generation method of the behavior strategy β is improved to expand the exploration. First, a convolutional neural network is used to simulate the state value function V to obtain the simulation parameter w v , the simulation parameter w v Used to make the behavior of the sample consistent with the distribution of the network output, by simulating the parameter w v , the value of the current action can be estimated and the time difference error can be calculated. When calculating the policy loss, the original DDPG deterministic policy is changed to a probabilistic output, but the characteristics of DDPG using two sets of action networks (Actor) and two sets of critic networks (Critic) for fitting are retained to encourage exploration while obtaining more accurate values ​​and policy function fitting. The policy loss function that encourages exploration is:

[0040] loss A =-log(prob)*(r+γ*V(s'|w v )-V(s|w v ))

[0041] The loss function of the critic network is defined as the square of the time difference value, that is:

[0042] loss C =(r+γ*V(s'|wv )-V(s|w v )) 2

[0043] Therefore, the update of the state value function is:

[0044]

[0045] The update of the policy network parameters is:

[0046]

[0047] S14: Improve the network structure of the two groups of actors and two groups of critics in DDPG;

[0048] S15: adopt priority value sampling for the improved DDPG algorithm;

[0049] S2: Use the improved DDPG algorithm for trajectory planning of continuous behavior.

[0050] Preferably, the DDPG network structure improvement specifically includes:

[0051] S14: Adjust the network structure of Actor and Critic, wherein the network structure is a three-layer residual structure.

[0052] Preferably, the improved step further comprises:

[0053] S14: Set the actors into two groups so that the distribution of the two groups of network outputs gradually becomes similar over time; the actor network is:

[0054]

[0055] The critic network is:

[0056]

[0057] The soft-replacement used is Soft-update, and the Soft-update expression is:

[0058]

[0059] Preferably, the introduction of the Mindspore framework for simulation specifically includes:

[0060] Introduce Mindspore's Parameter, Tensor, ops, nn, and parallel modules;

[0061] Eight classes are constructed using the introduced modules to combine and implement the complete functions of the DDPG algorithm, including: DenseLayer, Actor, Critic for realizing full connection, DDPG for connecting the network with the loss function, IthOutputCell for outputting network predictions, TrainStepWrap for connecting the loss function with the gradient calculation process and realizing gradient update once, and Action for outputting actions; the structure within the class includes: initial for initializing the layers and variables used in the class, and construct for connecting the elements in initial together, executing specific steps, realizing specific functions and outputting results.

[0062] Compared with the prior art, the application method of implementing and simulating a rocket recovery controller based on DDPG reinforcement learning provided in the embodiment of the present application has the following technical effects:

[0063] A rocket recovery algorithm model based on DDPG, one of the main network frameworks of reinforcement learning, was implemented and successfully simulated. Good results were achieved through the improvement of the network structure and the design of the reward function, and the rocket's vertical return and soft landing can be achieved based on mathematical simulation. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0065] Figure 1 A schematic diagram of the overall framework of the algorithm provided in the embodiment of the present application;

[0066] Figure 2 This is a schematic diagram of Huawei's full-stack, full-scenario AI strategy in existing technologies;

[0067] Figure 3 It is a schematic diagram of the MindSpore framework structure in the prior art;

[0068] Figure 4 A schematic diagram of MindSpore visualization training in the prior art;

[0069] Figure 5 It is a schematic diagram of the interaction between DDPG and the environment in the prior art;

[0070] Figure 6 A schematic diagram of the training process provided in an embodiment of the present application;

[0071] Figure 7 The five trajectory effect diagrams of the network design during the test provided in the embodiment of the present application;

[0072] Figure 8 A schematic diagram of the convergence effect of mu and sigma representing the action probability when training for 100,000 steps provided in an embodiment of the present application;

[0073] Fig. 9 This is a schematic diagram of the Actor network structure;

[0074] Fig.10 A schematic diagram of the Critic’s network structure. DETAILED DESCRIPTION

[0075] The embodiment of the present invention discloses an application method for realizing and simulating a rocket recovery controller based on DDPG reinforcement learning, so as to realize a reinforcement learning DDPG rocket recovery controller based on MindSpore and complete the practical application of the realization and simulation of the localization framework in the field of deep learning.

[0076] In order to make the technical solutions and advantages in the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0077] Based on the background technology, the applicant concluded that: due to the complex structure of deep reinforcement learning and the large number of components, there is still no implementation and simulation method for rocket recovery based on MindSpore, and the rocket recovery controller based on classical control theory is difficult to realize the automatic trajectory planning function. When disturbance occurs, it needs to be redesigned, and the process is complicated. However, the network structure, hyperparameters and reward functions of deep reinforcement learning are difficult to design, and there is still no more effective implementation.

[0078] In this regard, the applicant provides an application method for implementing and simulating a rocket recovery controller based on DDPG reinforcement learning through this embodiment, and simulates it in the scenario of trajectory planning for the descent phase of a launch vehicle.

[0079] In general, the application method of the rocket recovery controller based on DDPG reinforcement learning and simulation in this embodiment includes the following steps:

[0080] The rocket falling process was simplified by dynamic modeling and reward design, and trained using DDPG with improved output mean and variance.

[0081] The trajectory of the rocket is planned and guided by reinforcement learning. The trajectory planning and guidance includes: defining the state quantity describing the trajectory and designing the reward function according to the terminal constraints, using DDPG for trajectory planning and guidance of continuous behavior, and introducing the Mindspore framework for simulation.

[0082] Below, based on the specific algorithm flow and implementation process, the application method of the DDPG reinforcement learning rocket recovery controller implementation and simulation of this embodiment is introduced in detail.

[0083] See also Figure 1 , Figure 5-8

[0084] One method is to use Figure 1 The algorithm shown is based on DDPG reinforcement learning rocket recovery controller implementation and simulation application method, including the following technical solutions:

[0085] A simplified dynamic modeling of the rocket falling process was carried out, reward design was performed, and DDPG with improved output mean and variance was used for training.

[0086] Instead of tracking the trajectory, we use reinforcement learning to plan the trajectory. 1) Set the trajectory planning result as a six-dimensional state quantity: position x t ,y t 、z t , speed v x_t 、v y_t 、v z_t Under normal circumstances, the mass of the rocket is 88.6kg, the acceleration of gravity is 9.8m / s2, the initial position is [0m,50m,0m], the speed is [0m,0m,0m], the target position is the ground origin (flag point) [0m,0m,0m], and the expected speed when reaching the origin is [0m,0m,0m]. Because it is simplified to a particle model, there is no attitude angle, but the pitch, yaw angle and the force direction of the particle can still be used to define the position of the particle in space. The action space uses thrust P, pitch angle Yaw angle ψ. The value ranges are [600N, 1000N], [80°, 100°], [-10°, 10°].

[0087] According to the conversion relationship from arrow system to ground system (excluding roll), we have:

[0088]

[0089] The differential equations of motion of the simplified aircraft particle model under the ground system are:

[0090] After establishing the differential equation, the fixed-step fourth-order Runge-Kutta method is used to numerically integrate the state quantity of each beat. The simulation start time is t0=0s, and the integration step is Δt=0.01s. All real numbers are double-precision floating point numbers.

[0091] The state quantities are normalized in the environment to facilitate subsequent network training.

[0092] The combined velocity and displacement of the model can be expressed as:

[0093]

[0094] The reward function is designed as:

[0095]

[0096] A proportional coefficient is added in the speed direction so that the closer to the standard landing point, the faster the speed decreases.

[0097] 2) Improved DDPG algorithm:

[0098] This scenario is suitable for being modeled as a Markov chain, and therefore suitable for being solved using reinforcement learning methods. The goal is to allow the simplified rocket particle agent to learn and plan a path that allows the rocket to obtain the maximum total reward value through continuous action and exploration in the environment model built in this article. Among them, actions can be divided into continuous and discrete. In order to achieve better and more accurate control effects, the present invention models it as a continuous control problem and uses DDPG to plan the trajectory of the continuous behavior.

[0099] DDPG contains the following key concepts: 1)s t : At time t, the state of the environment observed by the agent, here is the six-dimensional [x t ,y t ,z t ,v x_t ,v y_t ,v z_t ]; 2)a t : At time t, after the action selected by the agent is executed by the environment, the state of the environment is changed from s t Convert to s t+1 ; 3) r(s(t), a(t)): the environment is in state s t Execute a t After that, the single-step reward value is returned; 4): It is the weighted sum of the reward values ​​obtained by all behaviors from the current state to a certain state in the future, and the discounted future reward:

[0100] The three key points of DDPG include: 1) Deterministic behavior strategy μ: defined as a function, each step of behavior can be t =μ(s t ) calculated; 2) Strategy network: Use a convolutional neural network to simulate the μ function with the parameter θ μ ;3) Behavior strategy β: During the reinforcement learning training process, DDPG takes into account both exploration and exploitation. Exploration explores potential better strategies, so random noise is added to the output action, changing the action decision from a deterministic process to a random process, and then sampling the action from this random process and issuing it to the environment for execution. This strategy is off-policy. Among them, the original DDPG program structure is as follows Figure 5 shown.

[0101] Because the off-policy β is not the final strategy μ during our test and evaluation, but only the action generated during the training process and sent to the environment, so that we can obtain more and richer data sets, here is the agent's walking path. Then use this data set to train the strategy μ to obtain the optimal strategy. Therefore, how to choose the off-policy is very critical to the stability and convergence of the training process.

[0102] Therefore, the present invention improves this part. The actor action output is originally composed of three-dimensional control quantities. Add noise and sample from the noise, which is improved to a six-dimensional output Sample from the resulting joint Gaussian distribution.

[0103] At this point, our judgment network changes from a Q network to a V network, that is, we use a convolutional neural network to simulate the state value function V, whose parameter is w v The ultimate optimization goal of the network is to minimize the td-error. The optimization goal of the policy network is to make the sample action match the distribution of the network output as much as possible, while maximizing the td-error (this sample can bring greater surprises). That is,

[0104] loss A =-log(prob)*(r+γ*V(s'|w v )-V(s|w v ))

[0105] The loss function of the judgment network is defined as the square of the time difference value, that is,

[0106] loss C =(r+γ*V(s'|w v)-V(s|w v )) 2

[0107] Therefore, the update of the value function network is:

[0108]

[0109] The update of the policy network parameters is:

[0110]

[0111] In addition, the improved DDPG adopts priority value sampling, adjusts the network structure of Actor and Critic, and optimizes hyperparameters.

[0112] The network structure is adjusted to a three-layer residual structure, and the residual learning makes network training easier. Fig. 9 .

[0113] The network structure of Critic is as follows Fig.10 .

[0114] Although the network output has been adjusted, the improved DDPG still sets up two groups of networks for the policy network and the judge network, because using only a single neural network will cause the v network parameters to be frequently updated while outputting inference results and updating the actor network. Although unlike the Q network, the output of the actor network is not used when updating the v network, we still set the actor to two groups in order to make the distribution of the outputs of the two groups of networks as close as possible over time, which indicates that the training has converged.

[0115] The four groups of networks included are as follows:

[0116]

[0117] The soft-replacement used is Soft-update:

[0118]

[0119] 3) Implementation of the localized framework mindspore

[0120] The program implementation introduces Mindspore's Parameter, Tensor, ops, nn, parallel and other modules. The ops module is divided into operations, composite, and functional, and contains many operators for implementing functions such as back propagation. The parallel module is introduced to facilitate the use of data parallelism, embedded parallelism and other modes when calculating back propagation.

[0121] Compared with Tensorflow, a distinct feature of the Mindspore framework is that program writing is very structured. Therefore, the training process is complicated, and reinforcement learning programs containing multiple network structures must strictly distinguish modules, which is relatively difficult.

[0122] This program builds 8 classes to combine and implement the complete functions of DDPG: DenseLayer (for full connection), Actor, Critic (for creating two groups of AC), DDPG (for connecting the network with the loss function), IthOutputCell for outputting network predictions, TrainStepWrap (for connecting the loss function with the gradient calculation process to achieve gradient update once), Action (for outputting actions). DDPG's access process to Memory is placed in TrainStepWrap in this program, because access to the experience pool is originally accompanied by each training step and is part of the training process.

[0123] The structure within the class is also very clear. The main body of the class is divided into initial and construct. Initial is to initialize the layers and variables used in the class, and construct is to connect the elements in initial together, execute specific steps, implement specific functions, and output results. In order to facilitate the naming of the fully connected layer by scope, this project rewrites the DenseLayer class.

[0124] The basic components of the DDPG class include two sets of AC networks and the operators necessary to construct the loss function. The main function is to connect actor_ori and critic_ori to their loss functions respectively, and output delta_t of the priority value experience playback.

[0125] TrainStepWrap depicts the overall picture of the training process. It is used to update the parameters of Actor_ori and Critic_ori according to the results of the loss function, and to implement the access to Memory transition during the training process. Unlike the more unstructured Tensorflow, where the optimizer can be directly applied to the network's loss function, in mindspore, the gradients of the parameters must be explicitly calculated and applied to the parameters. Therefore, for a complex process like DDPG, all trainable and non-trainable parameters must be extracted in TrainStepWrap and classified into four networks to facilitate parameter updating and soft_replacement. When updating parameters, the F.depend function is used to correspond the loss function to the parameters and apply the optimizer. Each time TrainStepWrap is executed, a transition is stored in Memory. When it is full, sample training is extracted, and soft_replacement is executed.

[0126] When the training is completed, when testing, you only need to call the Action class and output the action value of each step corresponding to the state. Figure 6 shown.

[0127] It should be noted that when implementing this plan, the following points should be noted:

[0128] 1) Set necessary hyperparameter values ​​in Python simulation, such as actor, critic learning rate, memory size, soft-update parameters, whether to use priority memory, noise coefficient, how often to save the model, etc. Then start the DDPG program, let the agent interact with the environment, collect data and train until the mu, sigma and td-error curves tend to be flat and converge.

[0129] 2) If it converges to a suboptimal position, an early stopping strategy is adopted to remove the model with the largest episode-reward.

[0130] 3) Read the saved optimal model for testing and online inference to obtain the current trajectory effect.

[0131] This article provides an example based on the above scheme: with an initial horizontal displacement of 20m and a height of 50m, vertical recovery close to the origin is achieved. The aircraft needs to learn the process of accelerating first and then decelerating in parallel on the three coordinate axes, that is, the instantaneous speed of the three axes is 0 and the displacement is 0 when landing, so as to achieve a soft landing of the aircraft, and try to ensure that the output control signal change rate is small and the curve is gentle.

[0132] from Figure 7It can be seen that all five trajectories ensure that the speed converges to 0 when landing at the origin. The trajectory curve designed by the network is a cubic function, and the speed change curve is a quadratic function, which increases smoothly first and then decreases. Because the displacement proportional coefficient is added to the speed in the reward, the acceleration process is shorter and the deceleration process is longer to ensure a smooth landing.

[0133] from Figure 8 It can be seen that the method of using mu and sigma as outputs and sampling from them is effective. As the variance changes, the agent explores in different change intervals. The fact that Sigma finally converges to close to 0 shows that as the training progresses, the network is more and more certain about the output action, which is equivalent to the process of the noise in the OU noise becoming smaller and smaller. However, a very small exploration rate is still retained, indicating that even the best strategy may still have a local extreme value. This is to retain a certain amount of exploration to help continuously find better strategies.

[0134] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0135] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. An application method for realizing and simulating a rocket recovery controller based on DDPG reinforcement learning, characterized in that: The method comprises the following steps: The rocket falling process was simplified by dynamic modeling and reward design, and the improved DDPG with output mean and standard deviation was used for training. Reinforcement learning is used to plan and guide the rocket's falling trajectory; the trajectory planning and guidance includes: defining the state quantity that describes the trajectory and designing the reward function according to the terminal constraints, using DDPG for trajectory planning and guidance of continuous behavior, and introducing the domestic deep learning framework Mindspore for simulation.

2. The application method of implementing and simulating a rocket recovery controller based on DDPG reinforcement learning according to claim 1 is characterized in that: The state quantity defining the trajectory includes the position state quantity x t ,y t 、z t and velocity state v x_t 、v y_t 、v z_t .

3. The application method of realizing and simulating a rocket recovery controller based on DDPG reinforcement learning according to claim 2 is characterized in that: The design of the reward function according to the terminal constraint specifically includes: D1: Define the initial position as [0m,50m,0m], the initial speed as [0m,0m,0m], the target position as the origin on the ground [0m,0m,0m], and the expected speed when reaching the origin as [0m,0m,0m]; D2: Define the action space using thrust as P and pitch angle as The yaw angle is ψ, and the value range of P is 600N~1000N. The value range of is 80°~100°, and the value range of ψ is -10°~10°; D3: When rolling is removed, the conversion relationship from the arrow system to the ground system is: This matrix is ​​not used for attitude calculation, but only for representing the direction of the arrow body movement; D4: The differential equation of motion of the simplified aircraft particle model under the ground system is: and D5: Based on the above differential equation, the fixed-step fourth-order Runge-Kutta method is used for numerical integration to solve the state quantity of each beat; D6: Based on the conversion relationship, differential equation and state quantity, the combined velocity and displacement of the model are obtained as follows: D7: The reward function is designed as: Since the rocket body is recovered vertically from an initial velocity of 0, and the terminal state requires a velocity of 0, it needs to accelerate first and then decelerate. Therefore, a certain speed increase should be allowed at the beginning of the trajectory, while a speed reduction should be encouraged at the terminal. This design can make the penalty for speed increase greater the closer the rocket body is to the ground.

4. The application method of realizing and simulating a rocket recovery controller based on DDPG reinforcement learning according to claim 3 is characterized in that: In the numerical integration of the fourth-order Runge-Kutta method with a fixed step size to solve the state quantity of each beat, the simulation start time is defined as t0=0s, and the integration step size is Δt=0.01s. All real numbers are double-precision floating point numbers.

5. The application method for realizing and simulating a rocket recovery controller based on DDPG reinforcement learning according to claim 3 or 4, characterized in that: The method of using the fixed-step fourth-order Runge-Kutta method for numerical integration to solve the state quantity of each beat also includes: Normalize the state quantities in the environment.

6. The application method of realizing and simulating a rocket recovery controller based on DDPG reinforcement learning according to claim 3 is characterized in that: The design reward function further includes: D8: Add a proportional coefficient in the speed direction so that the rocket's speed decreases faster as it gets closer to the landing point.

7. The application method of realizing and simulating a rocket recovery controller based on DDPG reinforcement learning according to claim 3 is characterized in that: The trajectory planning of continuous behavior using DDPG specifically includes: S1: Improve the DDPG algorithm. The improvement steps include: S11: Determine the concept point of the DDPG algorithm, the concept point includes s t 、a t , r(s(t),a(t)) and Among them, s t is: the state of the environment observed by the rocket particle at time t, at which time s t Expressed as [x t ,y t ,z t ,v x_t ,v y_t ,v z_t ], and, after execution through the environment, the state of the environment is changed from s t Convert to s t+1 ; a t is: the behavior of the rocket particle at time t; r(s(t), a(t)) is: the environment in state s t Execute a t After that, the single-step reward value is returned; It is the weighted sum of the reward values ​​obtained from all behaviors from the current state to a certain state in the future; S12: Determine the key points of the DDPG algorithm, including the deterministic behavior strategy μ, the strategy network θ μ and behavior strategy β, where the deterministic behavior strategy μ is defined as: t =μ(s t ) is calculated; strategy network θ μ is: Use a convolutional neural network to simulate the μ function; the behavior strategy β is: During the reinforcement learning training process, DDPG takes into account both exploration and exploitation; S13: Change the original deterministic action output to a probabilistic output. First, a convolutional neural network is used to simulate the state value function V to obtain the simulation parameter w v , the simulation parameter w v Used to make the behavior of the sample consistent with the distribution of the network output, by simulating the parameter w v , the value of the current action can be estimated and the time difference error can be calculated. When calculating the policy loss, the original DDPG deterministic policy is changed to a probabilistic output, but the characteristics of DDPG using two sets of action networks (Actor) and two sets of critic networks (Critic) for fitting are retained to encourage exploration while obtaining more accurate values ​​and policy function fitting. The policy loss function that encourages exploration is: loss A =-log(prob)*(r+γ*V(s'|w v )-V(s|w v )) The loss function of the critic network is defined as the square of the time difference value, that is: loss C =(r+γ*V(s'|w v )-V(s|w v )) 2 Therefore, the update of the state value function is: The update of the policy network parameters is: θ←θ+αδ▽ θ logπ(a t |s t ,i) S14: Improve the network structure of the two groups of actors and two groups of critics in DDPG; S15: adopt priority value sampling for the improved DDPG algorithm; S2: Use the improved DDPG algorithm for trajectory planning of continuous behavior.

8. The application method of realizing and simulating a rocket recovery controller based on DDPG reinforcement learning according to claim 7 is characterized in that: The improvements to the DDPG network structure specifically include: S14: Adjust the network structure of Actor and Critic, wherein the network structure is a three-layer residual structure.

9. The application method of realizing and simulating a rocket recovery controller based on DDPG reinforcement learning according to claim 8 is characterized in that: The improved steps further include: S14: Set the actors into two groups so that the distribution of the two groups of network outputs gradually becomes similar over time; the actor network is: The critic network is: The soft-replacement used is Soft-update, and the Soft-update expression is:

10. The application method of realizing and simulating a rocket recovery controller based on DDPG reinforcement learning according to claim 1 is characterized in that: The introduction of the Mindspore framework for simulation specifically includes: Introduce Mindspore's Parameter, Tensor, ops, nn, and parallel modules; Eight classes are constructed using the introduced modules to combine and implement the complete functions of the DDPG algorithm, including: DenseLayer, Actor, Critic for realizing full connection, DDPG for connecting the network with the loss function, IthOutputCell for outputting network predictions, TrainStepWrap for connecting the loss function with the gradient calculation process and realizing gradient update once, and Action for outputting actions; the structure within the class includes: initial for initializing the layers and variables used in the class, and construct for connecting the elements in initial together, executing specific steps, realizing specific functions and outputting results.

Citation Information

Cited By

  • Rocket landing control method based on multi-agent reinforcement learning

    CN120278007A