Flexible robot end arrival control method, electronic device and storage medium

The deep neural network is established through the deep reinforcement learning method to replace the flexible robot dynamics model, which solves the problems of model uncertainty and external disturbance in the flexible robot control system, improves the terminal control accuracy, and provides technical support for operating tasks.

CN111783250BActive Publication Date: 2024-09-10SHANGHAI AEROSPACE CONTROL TECH INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010635603.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-03
Publication Date
2024-09-10
Estimated Expiration
2040-07-03

AI Technical Summary

Technical Problem

Due to its complex control system, strong nonlinearity, time variation and uncertainty, flexible robots are difficult to establish accurate dynamics modeling, resulting in uncertainty in the control system model and external interference, resulting in inaccurate trajectory tracking control and even instability of the control system. .

Method used

A method based on deep reinforcement learning is used to establish a deep neural network. The initial parameters are obtained through preliminary training, and a second training is performed to improve accuracy. It replaces the dynamic model for adaptive control and weakens the problems caused by unknown and inaccurate dynamic models. error.

Benefits of technology

It improves the accuracy of flexible robot end control, eliminates the influence of dynamic model uncertainty and external disturbances, and provides technical support for operational tasks such as on-orbit module replacement and sailboard deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111783250B
    Figure CN111783250B
Patent Text Reader

Abstract

The present invention discloses a flexible robot terminal arrival control method, electronic device and storage medium, the method comprising: establishing a dynamic model of the flexible robot; establishing a deep neural network according to the dynamic model, the deep neural network is used to fit the dynamic model; performing preliminary training of the deep neural network in the first flexible robot terminal arrival process to obtain the initial parameters of the deep neural network; performing preliminary training of the deep neural network in the second flexible robot arrival process to obtain the final parameters of the deep neural network. The present invention reduces the uncertainty of the flexible robot's dynamic model or the influence of external disturbances on the control system, and improves the terminal control accuracy of the flexible robot.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a flexible robot terminal arrival control method based on deep reinforcement learning, an electronic device and a storage medium. Background Art

[0002] The control goal of the flexible robot based on variable-length cable drive is to achieve accurate arrival of the end of the flexible robot while avoiding collision with the surrounding environment. The following problems will occur during the control process of the flexible robot's safe arrival: First, it is difficult to establish an accurate dynamic model of the flexible robot due to the complexity, strong nonlinearity, time-varying and uncertainty of its control system; second, during the movement of the flexible robot, there will be external disturbances such as friction between the cable and the reel and disc. Therefore, the classical feedback control method based on a completely known model is difficult to effectively suppress the problem of inaccurate trajectory tracking control of the flexible robot caused by uncertainty in the control system model and external interference, and even leads to instability of the control system. Summary of the invention

[0003] The purpose of the present invention is to provide a flexible robot terminal arrival control method, electronic device and storage medium based on deep reinforcement learning, so as to reduce the uncertainty of the flexible robot's dynamic model or the influence of external disturbances on the control system and improve the terminal control accuracy of the flexible robot.

[0004] In order to achieve the above objectives, the present invention is implemented by the following technical solutions:

[0005] A flexible robot terminal arrival control method, comprising:

[0006] Step S1, establishing a dynamic model of the flexible robot;

[0007] Step S2, establishing a deep neural network according to the kinetic model, wherein the deep neural network is used to fit the kinetic model;

[0008] Step S3, performing preliminary training on the deep neural network for the first flexible robot terminal arrival process to obtain initial parameters of the deep neural network;

[0009] Step S4: Perform preliminary training of the second flexible robot arrival process on the deep neural network to obtain final parameters of the deep neural network.

[0010] Preferably, the step S1 comprises:

[0011] The flexible robot is regarded as a continuous model with arc coordinates as independent variables, and the spatial posture of the flexible robot can be regarded as the rotation or movement of the cross section around the center line;

[0012] Establishing a dynamic model of the flexible robot based on the Cosserat rod model;

[0013] The kinetic model is expressed by the following formula:

[0014]

[0015] Where F is the internal force on the cross section; M is the principal moment on the cross section; f is the uniformly distributed force on the single-section rod of the flexible robot; m is the uniform moment on the single-section rod of the flexible robot; J = J (s, t) is the inertia tensor of the unit length rod; ρ is the density of the unit length rod of the flexible robot; S is the cross-sectional area of ​​the unit length rod of the flexible robot; Ω is the angular velocity of point P in the section principal axis coordinate system P-xyz in the inertial coordinate system with respect to the time variable t.

[0016] Preferably, the step S2 comprises: using a laboratory external calibration measurement camera to collect random trajectory data of the flexible robot's terminal arrival process in real time;

[0017] The random trajectory data is converted into training data according to the dynamic model to obtain a random trajectory data set D rand =(s 1 ,a 1 ,r 1 ,s 2 ,a 2 ,r 2 ,...s T ,a T ,r T ), where s t represents the state of the flexible robot at the current time t; a t represents the action of the flexible robot at the current time t; r t represents the reward of the predicted environment at the current time t; t = 1, 2, ..., T;

[0018] The state s at the current time t t and the action a t As input, it can predict the state s at the next moment t+1 The state transformation prediction model P(s t+1 |s t ,a t ) is expressed as follows:

[0019] s t+1 ~P(s t+1 |s t ,a t )

[0020] The state s at the current time t t and the action a t As input, the reward r of the predicted environment at the next moment can be t+1 The reward prediction model R(r t+1 |s t ,a t ) is expressed as follows:

[0021] r t+1 ~R(r t+1 |s t ,a t )

[0022] According to the state conversion prediction model P(s t+1 |s t ,a t ) and the reward prediction model R(r t+1 |s t ,a t ) The random trajectory dataset D rand =(s 1 ,a 1 ,r 1 ,s 2 ,a 2 ,r 2 ,...s T ,a T ,r T ) are respectively converted into a density estimation model training set and a regression model training set containing T-1 groups of training samples;

[0023] The density estimation model training set is represented as follows:

[0024] (s 1 ,a 1 ) → s 2 ,(s 2 ,a 2 ) → s 3 ,...(s T-1 ,a T-1 ) → s T

[0025] The regression model training set is represented as follows:

[0026] (s 1 ,a 1 )→r 2 ,(s 2 ,a 2 )→r 3 ,...(s T-1 ,a T-1 )→r T .

[0027] Preferably, step S3.1, preset optimal control trajectory data set D RL , which is an empty set state at this time; and randomly initialize a first action value function of the deep neural network based on model-based reinforcement learning training Represent the parameters of the deep neural network corresponding to the first action-value function, and proceed to step S3.2;

[0028] Step S3.2: Preset a first training round number M 1 , record the current first training round number m 1 , determine the current first training round number m 1 Is it less than the preset first training round number M? 1 , if yes, go to step S3.3; if no, go to step S3.6;

[0029] Step S3.3: Determine the optimal control trajectory data set D RL Is it an empty set? If so, go to step S3.3.1; if not, go to step S3.3.2;

[0030] Step S3.3.1: Based on the random trajectory dataset D rand , using stochastic gradient descent to make the loss function To reach the minimum,

[0031]

[0032] Where D 1 Indicates D rand Medium t ,a t ,s t+1 ) is a set consisting of t and a t Respectively represent the state and action at the current time t; s t+1 Indicates the state at the subsequent time t+1;

[0033] Then use the loss function The random trajectory dataset D that reaches the minimum rand The parameters of the deep neural network are obtained from the set of data in At this time, the first action value function of the deep neural network It is a known state, and goes to step S3.4;

[0034] Step S3.3.2: Based on the optimal control trajectory data set D RL , using stochastic gradient descent to make the loss function To reach the minimum,

[0035]

[0036] Where s t and a t Respectively represent the current state and action; s t+1 Indicates the state at the subsequent time;

[0037] Then use the loss function The optimal control trajectory dataset D that achieves the minimum RL A set of data in the deep neural network is used to find the parameters of the deep neural network. At this time, the first action value function of the deep neural network It is a known state, and goes to step S3.4;

[0038] Step S3.4: When the number of training times is less than the number of training sample groups T, the number of training sample groups T is equal to the random trajectory data set D rand The total number of training data contained in is T; then execute step S3.5;

[0039] Step S3.5, obtaining the state s of the flexible robot at the current time t corresponding to the current training number t , proceed to step S3.5.1;

[0040] Step S3.5.1: Using the first action-value function of the deep neural network Estimate the optimal action sequence of a package containing T actions

[0041]

[0042] In the formula T is an integer;

[0043] Go to step S3.5.2; Step S3.5.2, execute the optimal action sequence A t (T) The first action in a t , the first action a t The state s of the flexible robot at the current time t corresponding to the current training number t Combine to get the optimal control trajectory (s t , a t ), execute step S3.5.3;

[0044] Step S3.5.3: Obtain the optimal control trajectory (s t , a t ) is added to the optimal control trajectory data set D RLGo to step S3.5.4;

[0045] Step S3.5.4, determine whether the number of training times is equal to the number of training sample groups T; if not, return to step S3.5; if yes, return to step S3.2;

[0046] Step S3.6, end the training; finally obtain the first action value function of the deep neural network And the corresponding initial parameters

[0047] Preferably, the step S4 comprises:

[0048] Step S4.1, initialize a state transition prediction model P(s t+1 |s t ,a t ), reward prediction model R(r t+1 |s t ,a t ) and a second action-value function of the deep neural network trained based on model-free reinforcement learning The corresponding parameter θ, and at this time, the parameter θ=0; go to step S4.2;

[0049] Step S4.2: From the initial state s 0 Start an attempt to initialize the first action-value function of the deep neural network The corresponding parameters make Go to step S4.3;

[0050] Step S4.3, preset a qualification trace z, set z=0; go to step S4.4;

[0051] Step S4.4: For each training round, the initial state s 0 , perform a model-based reinforcement learning training simulation, update the first action value function, and the updated first action value function is The initial parameters obtained Go to step S4.5;

[0052] Step S4.5: based on the state s at the current time t t And combine the first action value function and the second action value function to obtain a joint action value function Use the ε-greedy method to select an action a t ; Go to step S4.6;

[0053] Step S4.6: If the current state s t With the known desired terminal state sq The error of err =||s t -s q || is greater than the constant value Δ, then proceed to step S4.6.1, otherwise, return to step S4.2;

[0054] Step S4.6.1. Execute the action a selected from step S4.5. t , based on the state transformation prediction model P(s t+1 |s t ,a t ) to get the successor state s t+1 , based on the reward prediction model R(r t+1 |s t ,a t ) to get reward r, using the successor state s t+1 、Action a t and reward r, update the state transition prediction model P(s t+1 |s t ,a t ) and the reward prediction model R(r t+1 |s t ,a t ); proceed to step S4.6.2;

[0055] Step S4.6.2: Using the state transition prediction model P(s) obtained in step S4.6.1 t+1 |s t ,a t ) and the reward prediction model R(r t+1 |s t ,a t ), from the successor state s t+1 Start model-based reinforcement learning training simulation and update the first action value function Get the corresponding parameters Go to step S4.6.3;

[0056] Step S4.6.3, based on the successor state s t+1 and the joint action-value function Use the ε-greedy method to select the next actual action a t+1 ; Go to step S4.6.4;

[0057] Step S4.6.4: obtain the deviation δ of the corresponding second action-value function based on the model-free reinforcement learning training simulation, where And use the deviation δ of the second action-value function to update the second action-value function corresponding to the model-free reinforcement learning training Parameter θ, θ←θ+αδz, where α represents the learning rate, which is a constant between 0 and 1; proceed to step S4.6.5;

[0058] Step S4.6.5, update the qualification trace z, Where λ represents the discount factor, which is a constant between 0 and 1; proceed to step S4.6.6;

[0059] Step S4.6.6: Transfer the acquisition state of the flexible robot to the subsequent state, i.e., s t =s t+1 ,a t =a t+1 ; Go to step S4.6.7;

[0060] Step S4.6.7: Preset the second training round number M 2 , record the current second training round number m 2 , determine the current second training round number m 2 Is it less than the preset second training round number M? 2 If yes, return to step S4.2; if no, proceed to step S4.7;

[0061] Step S4.7, end the training; finally obtain the second action value function of the deep neural network And the final parameters corresponding thereto

[0062] On the other hand, the present invention further provides an electronic device, including a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method described above is implemented.

[0063] In other aspects, the present invention further provides a readable storage medium, wherein the readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0064] Compared with the prior art, the present invention has the following advantages:

[0065] The present invention provides a method for controlling the terminal arrival of a flexible robot, comprising: step S1, establishing a dynamic model of the flexible robot; step S2, establishing a deep neural network according to the dynamic model, the deep neural network being used to fit the dynamic model; step S3, performing preliminary training of the deep neural network during the first flexible robot terminal arrival process to obtain the initial parameters of the deep neural network; step S4, performing preliminary training of the deep neural network during the second flexible robot arrival process to obtain the final parameters of the deep neural network. It can be seen that the present invention first establishes a dynamic model of the flexible robot, at which time the dynamic model is not very accurate, and then establishes a deep neural network in combination with the dynamic model, the function of the deep neural network is equivalent to the dynamic model, and the principle is similar to using the deep neural network to replace the dynamic model; after the first training, the initial parameters of the deep neural network can be obtained, so that the deep neural network becomes known, but at this time the accuracy of the deep neural network is still insufficient, so the known deep neural network is trained for the second time to improve the accuracy of the deep neural network. That is, the present invention does not need to establish a precise mathematical model (dynamic model) of the flexible robot. By performing reward and punishment feedback on the operation process, adaptive control is achieved, which can eliminate or reduce the inherent control error caused by the unknown or inaccurate dynamic model and the control error caused by the dimensionality reduction and simplification of the dynamic model, thereby improving the terminal control accuracy of the flexible robot and providing technical support for operational tasks such as on-orbit module replacement of failed targets and auxiliary deployment of sailboards. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 A flowchart of a flexible robot terminal arrival control method provided by one embodiment of the present invention;

[0067] Figure 2 A schematic diagram of various coordinate systems involved in an embodiment of the present invention;

[0068] Figure 3 A simple structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0069] The following is combined with Figures 1 to 3The main flexible robot terminal arrival control method, electronic device and storage medium proposed in the present invention are further described in detail with specific implementation methods. According to the following description, the advantages and features of the present invention will be clearer. It should be noted that the drawings are in a very simplified form and use non-precise proportions, which are only used to conveniently and clearly assist in explaining the purpose of the implementation method of the present invention. In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, please refer to the drawings. It should be noted that the structure, proportion, size, etc. illustrated in the drawings of this specification are only used to match the content disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the limiting conditions for the implementation of the present invention, so they have no technical substantive significance. Any modification of the structure, change of the proportional relationship or adjustment of the size, without affecting the effect that the present invention can produce and the purpose that can be achieved, should still fall within the scope of the technical content disclosed by the present invention.

[0070] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0071] like Figure 1 As shown, this embodiment provides a flexible robot end arrival control method, including:

[0072] Step S1, establishing a dynamic model of the flexible robot;

[0073] Step S2, establishing a deep neural network according to the kinetic model, wherein the deep neural network is used to fit the kinetic model;

[0074] Step S3, performing preliminary training of the deep neural network for the first flexible robot terminal arrival process to obtain initial parameters of the deep neural network;

[0075] Step S4: Perform preliminary training of the second flexible robot arrival process on the deep neural network to obtain final parameters of the deep neural network.

[0076] Further, combined with Figure 2As shown, the step S1 includes: regarding the flexible robot as a continuous model with arc coordinates as independent variables, the spatial posture of the flexible robot can be regarded as the rotation or movement of the cross section around the center line;

[0077] Establishing a dynamic model of the flexible robot based on the Cosserat rod model;

[0078] The kinetic model is expressed by the following formula:

[0079]

[0080] Where F is the internal force on the cross section; M is the principal moment on the cross section; f is the uniformly distributed force on the single-section rod of the flexible robot; m is the uniform moment on the single-section rod of the flexible robot; J = J (s, t) is the inertia tensor of the unit length rod; ρ is the density of the unit length rod of the flexible robot; S is the cross-sectional area of ​​the unit length rod of the flexible robot; Ω is the angular velocity of point P in the section principal axis coordinate system P-xyz in the inertial coordinate system with respect to the time variable t.

[0081] The specific establishment process is as follows: In view of the characteristics of flexible robots such as high compliance, high degree of freedom and strong nonlinearity, the dynamic equation based on the Cosserat rod model is established. The basic idea is to regard the flexible robot as a continuous model with arc coordinates as independent variables, and the robot's spatial posture can be regarded as the rotation or movement of the cross section around the center line.

[0082] Please continue to refer to Figure 2 , the Frenet coordinates are used as the spatial geometric description method of the target. The T axis of the Frenet coordinate system (P-NBT) is the tangent vector of the cable centerline at point P, the N axis is the normal vector of the cable centerline at point P, and the B axis is the binormal vector of the cable centerline at point P (B = T × N). The three coordinate axes N, B, and T are orthogonal to each other. Introducing the vector ω F , defined as

[0083] ω F (s)=κ(s)B+τ(s)T (2)

[0084] Where ω F (s) is called the Darboux vector of the curve. Its physical meaning can be understood as the angular velocity of the Frenet coordinate system relative to the inertial coordinate system (O-ξηζ) when point P moves along the curve C at a unit speed toward the positive direction of the arc coordinate s.

[0085] The variation of vectors N, B, T with arc coordinate s is determined by the following differential equations:

[0086]

[0087] because Then the flexible robot curve r(s) is

[0088]

[0089] On the basis of considering the centerline deformation and the cross-sectional dimensions, the torsional deformation around the Z axis is written as χ at the axis of the flexible robot, and the cross-sectional principal axis coordinate system (P-xyz) is established. According to the geometric form, the kinematic equation is:

[0090]

[0091] Where the wavy line represents the local derivative of the cross-section principal axis coordinate system (P-xyz); Ω is the angular velocity of point P in the inertial coordinate system with respect to the time variable t;

[0092] Using the discrete element method, the continuous robotic arm is discretized into micro-element segments. According to Newton's law and the conservation theorem of the moment of momentum of the center of mass, the cable dynamics equation can be obtained as follows:

[0093]

[0094] Where ρ is the density of the rod per unit length of the flexible robot; S is the cross-sectional area of ​​the rod per unit length of the flexible robot; J = J(s, t) is the inertia tensor of the rod per unit length; F is the internal force on the cross section; M is the principal moment (internal action moment) on the cross section; f is the uniformly distributed force on the rod; m is the uniform moment on the single-section rod of the flexible robot; Δs represents the infinitesimal element of arc length; ΔF and ΔM represent the changes in internal force and principal moment corresponding to the change in Δs on the cross section, respectively.

[0095] Dividing both sides of equation (6) by Δs yields equation (1),

[0096]

[0097] Based on this, the dynamic model of the single-section rod of the flexible robotic arm (dynamic model of the flexible robot) was established.

[0098] Furthermore, the step S2 includes: using a laboratory external calibration measurement camera to collect random trajectory data of the flexible robot's terminal arrival process in real time;

[0099] The random trajectory data is converted into training data according to the dynamic model to obtain a random trajectory data set D rand =(s 1 ,a 1 ,r 1 ,s 2 ,a 2 ,r 2 ,...s T ,aT ,r T ), where s t represents the state of the flexible robot at the current time t; a t represents the action of the flexible robot at the current time t; r t represents the reward of the predicted environment at the current time t; t = 1, 2, ..., T;

[0100] The state s at the current time t t and the action a t As input, it can predict the state s at the next moment t+1 The state transformation prediction model P(s t+1 |s t ,a t ) is expressed as follows:

[0101] s t+1 ~P(s t+1 |s t ,a t ) (7)

[0102] The state s at the current time t t and the action a t As input, the reward r of the predicted environment at the next moment can be t+1 The reward prediction model R(r t+1 |s t ,a t ) is expressed as follows:

[0103] r t+1 ~R(r t+1 |s t ,a t ) (8)

[0104] According to the state conversion prediction model P(s t+1 |s t ,a t ) and the reward prediction model R(r t+1 |s t ,a t ) The random trajectory dataset D rand =(s 1 ,a 1 ,r 1 ,s 2 ,a 2 ,r 2 ,...s T ,a T ,r T ) are respectively converted into a density estimation model training set and a regression model training set containing T-1 groups of training samples;

[0105] The density estimation model training set (equivalent to the state transformation prediction model P (s t+1 |s t ,a t )) means as follows:

[0106] (s 1 ,a 1 ) → s 2 ,(s 2 ,a 2 ) → s 3 ,...(s T-1 ,a T-1 ) → s T (9)

[0107] The regression model training set (equivalent to the reward prediction model R (r t+1 |s t ,a t )) means as follows:

[0108] (s 1 ,a 1 )→r 2 ,(s 2 ,a 2 )→r 3 ,...(s T-1 ,a T-1 )→r T (10).

[0109] That is, the basic idea of ​​step S2 is to use a deep neural network to fit the dynamic model of the flexible robot, adopt a model-based reinforcement learning method (model-based reinforcement learning training), and use the learned neural network model within the model predictive control framework. Before selecting the actual execution action, the flexible robot first executes a simulation based on the dynamic model starting from the current state. The simulation will simulate the completed trajectory in order to evaluate the current action value function and realize the preliminary training of the flexible robot's arrival process.

[0110] Furthermore, the step S3 includes: step S3.1, presetting the optimal control trajectory data set D RL , which is an empty set state at this time; and randomly initialize a first action value function of the deep neural network based on model-based reinforcement learning training Represent the parameters of the deep neural network corresponding to the first action-value function, and proceed to step S3.2.

[0111] Step S3.2: Preset a first training round number M 1 , record the current first training round number m 1, determine the current first training round number m 1 Is it less than the preset first training round number M? 1 If yes, go to step S3.3; if no, go to step S3.6.

[0112] Step S3.3: Determine the optimal control trajectory data set D RL Is it an empty set? If so, go to step S3.3.1; if not, go to step S3.3.2.

[0113] Step S3.3.1: Based on the random trajectory dataset D rand , using stochastic gradient descent to make the loss function To reach the minimum,

[0114]

[0115] Where D 1 Indicates D rand Medium t ,a t ,s t+1 ) is a set consisting of t and a t Respectively represent the state and action at the current time t; s t+1 Indicates the state at the subsequent time t+1.

[0116] Then use the loss function The random trajectory dataset D that reaches the minimum rand The parameters of the deep neural network are obtained from the set of data in At this time, the first action value function of the deep neural network It is a known state, and goes to step S3.4.

[0117] Step S3.3.2: Based on the optimal control trajectory data set D RL , using stochastic gradient descent to make the loss function To reach the minimum,

[0118]

[0119] Where s t and a t Respectively represent the current state and action; s t+1 Indicates the state at the subsequent time;

[0120] Then use the loss function The optimal control trajectory dataset D that achieves the minimum RL A set of data in the deep neural network is used to find the parameters of the deep neural network. At this time, the first action value function of the deep neural network It is a known state, and goes to step S3.4.

[0121] Step S3.4: When the number of training times is less than the number of training sample groups T, the number of training sample groups T is equal to the random trajectory data set D rand The total number of training data contained in is T; then execute step S3.5.

[0122] Step S3.5, obtaining the state s of the flexible robot at the current time t corresponding to the current training number t , proceed to step S3.5.1.

[0123] Step S3.5.1: Using the first action-value function of the deep neural network Estimate the optimal action sequence of a package containing T actions

[0124]

[0125] In the formula T is an integer.

[0126] Go to step S3.5.2; Step S3.5.2, execute the optimal action sequence The first action in a t , the first action a t The state s of the flexible robot at the current time t corresponding to the current training number t Combine to get the optimal control trajectory (s t , a t ), execute step S3.5.3.

[0127] Step S3.5.3: Obtain the optimal control trajectory (s t , a t ) is added to the optimal control trajectory data set D RL ; go to step S3.5.4.

[0128] Step S3.5.4, determine whether the number of training times is equal to the number of training sample groups T; if not, return to step S3.5; if so, return to step S3.2.

[0129] Step S3.6, end the training; finally obtain the first action value function of the deep neural network And the corresponding initial parameters

[0130] It can be seen that the basic idea of ​​step S3 is to define a reward function that encodes the task in the model-based flexible arm end arrival reinforcement learning task, give rewards when approaching the expected end arrival trajectory, and move along the expected trajectory. The model predictive controller (MPC) is used to realize the optimal action sequence obtained in step S3.5.1 Select the first action a that ranks first t , and add the corresponding first action to the data set of the optimal control trajectory, thereby improving the robustness of this embodiment.

[0131] Furthermore, the step S4 includes: step S4.1, initializing a state transition prediction model P(s t+1 |s t ,a t ), reward prediction model R(r t+1 |s t ,a t ) and a second action-value function of the deep neural network trained based on model-free reinforcement learning The corresponding parameter θ, and at this time, let the parameter θ=0; go to step S4.2.

[0132] Step S4.2: From the initial state s 0 Start an attempt to initialize the first action-value function of the deep neural network The corresponding parameters make Go to step S4.3.

[0133] Step S4.3, preset a qualification trace z, set z=0; go to step S4.4.

[0134] Step S4.4: For each training round, the initial state s 0 , perform a model-based reinforcement learning training simulation, update the first action value function, and the updated first action value function is The initial parameters obtained Enter step S4.5; in this embodiment, step S4.4 can be understood as based on the initial state s 0 The parameters are calculated using the method in step S3 described above.

[0135] Step S4.5: based on the state s at the current time t t And combine the first action value function and the second action value function to obtain a joint action value function Use the ε-greedy method to select an action a t ; Go to step S4.6.

[0136] Step S4.6: If the current state s t With the known desired terminal state s q The error of err =||s t -s q When || is greater than the constant value Δ, proceed to step S4.6.1, otherwise, return to step S4.2.

[0137] Step S4.6.1. Execute the action a selected from step S4.5. t , based on the state transformation prediction model P(s t+1 |s t ,a t ) to get the successor state s t+1 , based on the reward prediction model R(r t+1 |s t ,a t ) to get reward r, using the successor state s t+1 、Action a t and reward r, update the state transition prediction model P(s t+1 |s t ,a t ) and the reward prediction model R(r t+1 |s t ,a t ); proceed to step S4.6.2.

[0138] Step S4.6.2: Using the state transition prediction model P(s) obtained in step S4.6.1 t+1 |s t ,a t ) and the reward prediction model R(r t+1 |s t ,a t ), from the successor state s t+1 Start model-based reinforcement learning training simulation and update the first action value function Get the corresponding parameters Go to step S4.6.3; the step S4.6.2 can be understood as calculating the parameters using the method of step S3 described above.

[0139] Step S4.6.3, based on the successor state s t+1 and the joint action-value function Use the ε-greedy method to select the next actual action a t+1 ; Go to step S4.6.4.

[0140] Step S4.6.4: obtain the deviation δ of the corresponding second action-value function based on the model-free reinforcement learning training simulation, where And use the deviation δ of the second action-value function to update the second action-value function corresponding to the model-free reinforcement learning training Parameter θ, θ←θ+αδz, where α represents the learning rate, which is a constant between 0 and 1; go to step S4.6.5.

[0141] Step S4.6.5, update the qualification trace z, Where λ represents the discount factor, which is a constant between 0 and 1; proceed to step S4.6.6.

[0142] Step S4.6.6: Transfer the acquisition state of the flexible robot to the subsequent state, i.e., s t =s t+1 ,a t =a t+1 ; Go to step S4.6.7.

[0143] Step S4.6.7: Preset the second training round number M 2 , record the current second training round number m 2 , determine the current second training round number m 2 Is it less than the preset second training round number M? 2 If yes, return to step S4.2; if no, go to step S4.7.

[0144] Step S4.7, end the training; finally obtain the second action value function of the deep neural network And the final parameters corresponding thereto

[0145] It can be seen that the basic idea of ​​step S4 is that before the flexible robot selects the actual execution action, it first performs a model-based simulation starting from the current state to evaluate the current action value function, and then selects the actual action to be executed based on the action value function obtained by simulation and the action value function obtained through actual experience. t .

[0146] Therefore, this embodiment first establishes a flexible robot dynamics model based on Cosserat; then uses a deep neural network to fit the dynamics model of the flexible robot, and uses a model-based reinforcement learning method to achieve preliminary training of the flexible robot's arrival process; a method combining a model-based reinforcement learning method and a model-free reinforcement learning method is used to train the terminal arrival process, complete the optimization of the flexible robot's arrival action sequence, and achieve the safe arrival of the flexible robot's terminal, providing technical support for tasks such as on-orbit module replacement and sailboard auxiliary deployment. Thus, the problem of model uncertainty and external disturbance in dynamics modeling is solved because the flexible robot is different from the traditional articulated robot in that it is composed of rigid joints and connecting rods, and the flexible robot has the characteristics of high compliance, high degree of freedom, and strong nonlinearity.

[0147] On the other hand, based on the same inventive concept, the present invention also provides an electronic device, such as Figure 3 As shown, the electronic device includes a processor 301 and a memory 303, and the memory 303 stores a computer program. When the computer program is executed by the processor 301, the flexible robot end arrival control method described above is implemented.

[0148] The electronic device provided in this embodiment can solve the problem of model uncertainty and external disturbance in dynamic modeling caused by the fact that the flexible robot is different from the traditional articulated robot in structure composed of rigid joints and connecting rods, and the flexible robot has the characteristics of high flexibility, high degree of freedom and strong nonlinearity.

[0149] Continue to refer Figure 3 , the electronic device also includes a communication interface 302 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304. The communication bus 304 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 304 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface 302 is used for communication between the above-mentioned electronic device and other devices.

[0150] The processor 301 in this embodiment may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 301 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device.

[0151] The memory 303 may be used to store the computer program. The processor 301 implements various functions of the electronic device by running or executing the computer program stored in the memory 303 and calling the data stored in the memory 303 .

[0152] The memory 303 may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0153] In other aspects, based on the same inventive concept, the present invention also provides a readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the flexible robot end arrival control method as described above can be implemented.

[0154] The readable storage medium provided in this embodiment can solve the problem of model uncertainty and external disturbance in dynamic modeling caused by the fact that the flexible robot is different from the traditional articulated robot in structure composed of rigid joints and connecting rods, and the flexible robot has the characteristics of high flexibility, high degree of freedom and strong nonlinearity.

[0155] The readable storage medium provided in the present embodiment can adopt any combination of one or more computer-readable media. The readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer hard disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this article, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.

[0156] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0157] In the present embodiment, the computer program code for performing the operation of the present embodiment can be written in one or more programming languages ​​or a combination thereof, and the programming language includes an object-oriented programming language-such as Java, Smalltalk, C++, and also includes a conventional procedural programming language-such as "C" language or similar programming language. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network-including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0158] It should be noted that the devices and methods disclosed in the embodiments of this article can also be implemented in other ways. The device implementation described above is only schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of this article. In this regard, each box in the flowchart or block diagram can represent a part of a module, program or code, and the module, program segment or part of the code contains one or more executable instructions for implementing the specified logical function, and the module, program segment or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented by a dedicated hardware-based system for performing a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0159] In addition, the functional modules in the various embodiments of this document may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0160] In summary, the present invention provides a method for controlling the terminal arrival of a flexible robot, including: step S1, establishing a dynamic model of the flexible robot; step S2, establishing a deep neural network based on the dynamic model, the deep neural network is used to fit the dynamic model; step S3, performing preliminary training of the deep neural network in the first flexible robot terminal arrival process to obtain the initial parameters of the deep neural network; step S4, performing preliminary training of the deep neural network in the second flexible robot arrival process to obtain the final parameters of the deep neural network. It can be seen that the present invention first establishes a dynamic model of the flexible robot, at which time the dynamic model is not very accurate, and then establishes a deep neural network in combination with the dynamic model, the function of the deep neural network is equivalent to the dynamic model, and the principle is similar to using the deep neural network to replace the dynamic model; after the first training, the initial parameters of the deep neural network can be obtained, so that the deep neural network becomes known, but at this time the accuracy of the deep neural network is still insufficient, so the known deep neural network is trained for the second time to improve the accuracy of the deep neural network. That is, the present invention does not need to establish a precise mathematical model (dynamic model) of the flexible robot. By performing reward and punishment feedback on the operation process, adaptive control is achieved, which can eliminate or reduce the inherent control error caused by the unknown or inaccurate dynamic model and the control error caused by the dimensionality reduction and simplification of the dynamic model, thereby improving the terminal control accuracy of the flexible robot and providing technical support for operational tasks such as on-orbit module replacement of failed targets and auxiliary deployment of sailboards.

[0161] Although the content of the present invention has been described in detail through the above preferred embodiments, it should be appreciated that the above description should not be considered as a limitation of the present invention. After reading the above content, it will be apparent to those skilled in the art that various modifications and substitutions of the present invention will occur. Therefore, the protection scope of the present invention should be limited by the appended claims.

Claims

1. A flexible robot end arrival control method, characterized in that: include: Step S1, regarding the flexible robot as a continuous model with arc coordinates as independent variables, the spatial posture of the flexible robot can be regarded as the rotation or movement of the cross section around the center line; establishing a dynamic model of the flexible robot based on the Cosserat rod model; Step S2, establishing a deep neural network according to the kinetic model, wherein the deep neural network is used to fit the kinetic model; The random trajectory data of the flexible robot terminal arrival process is collected in real time using a laboratory external calibration measurement camera; the random trajectory data is converted into training data according to the dynamic model to obtain a random trajectory data set D rand =(s1,a1,r1,s2,a2,r2,...s T ,a T ,r T );s t represents the state of the flexible robot at the current time t; a t represents the action of the flexible robot at the current time t; r t represents the reward of the predicted environment at the current time t; t = 1, 2, ..., T; Step S3, performing preliminary training on the deep neural network for the first flexible robot terminal arrival process to obtain initial parameters of the deep neural network; Wherein, a first action-value function of the deep neural network trained based on model-based reinforcement learning is randomly initialized represents the parameters of the deep neural network corresponding to the first action-value function; T corresponds to the number of training sample groups; Preset optimal control trajectory dataset D RL , using stochastic gradient descent to make the loss function To minimize, use the loss function The optimal control trajectory dataset D that achieves the minimum RL A set of data in the deep neural network is used to find the parameters of the deep neural network. Afterwards, the first action-value function of the deep neural network is used To estimate an optimal action sequence containing T actions, and the first action a in the optimal action sequence t , the state s of the flexible robot at the current time t corresponding to the current training number t Combine to get the optimal control trajectory (s t , a t ), added to the optimal control trajectory data set D RL middle; After the training is completed, the final first action value function is obtained And the corresponding initial parameters M1 is the first training round number preset in step S3; Step S4, performing preliminary training of the second flexible robot arrival process on the deep neural network to obtain final parameters of the deep neural network; The step S4 comprises: Step S4.1, initialize a state transition prediction model P(s t+1 |s t ,a t ), reward prediction model R(r t+1 |s t ,a t ) and a second action-value function of the deep neural network trained based on model-free reinforcement learning The corresponding parameter θ, and at this time, the parameter θ=0; go to step S4.2; Step S4.2: Start an attempt from the initial state s0 to initialize the first action value function of the deep neural network The corresponding parameters make Go to step S4.3; Step S4.3, preset a qualification trace z, set z=0; go to step S4.4; Step S4.4: For the initial state s0 of each training round, perform a model-based reinforcement learning training simulation to update the first action value function. The updated first action value function is The initial parameters obtained Go to step S4.5; Step S4.5: based on the state s at the current time t t And combine the first action value function and the second action value function to obtain a joint action value function Use the ε-greedy method to select an action a t ; Go to step S4.6; Step S4.6: If the current state s t With the known desired terminal state s q The error of err =||s t -s q || is greater than the constant value Δ, then proceed to step S4.6.1, otherwise, return to step S4.2; Step S4.6.

1. Execute the action a selected from step S4.

5. t , based on the state transformation prediction model P(s t+1 |s t ,a t ) to get the successor state s t+1 , based on the reward prediction model R(r t+1 |s t ,a t ) to get reward r, using the successor state s t+1 、Action a t and reward r, update the state transition prediction model P(s t+1 |s t ,a t ) and the reward prediction model R(r t+1 |s t ,a t ); proceed to step S4.6.2; Step S4.6.2: Using the state transition prediction model P(s) obtained in step S4.6.1 t+1 |s t ,a t ) and the reward prediction model R(r t+1 |s t ,a t ), from the successor state s t+1 Start model-based reinforcement learning training simulation and update the first action value function Get the corresponding parameters Go to step S4.6.3; Step S4.6.3, based on the successor state s t+1 and the joint action-value function Use the ε-greedy method to select the next actual action a t+1 ; Go to step S4.6.4; Step S4.6.4: obtain the deviation δ of the corresponding second action-value function based on the model-free reinforcement learning training simulation, where And use the deviation δ of the second action-value function to update the second action-value function corresponding to the model-free reinforcement learning training Parameter θ, θ←θ+αδz, where α represents the learning rate, which is a constant between 0 and 1; proceed to step S4.6.5; Step S4.6.5, update the qualification trace z, Where λ represents the discount factor, which is a constant between 0 and 1; proceed to step S4.6.6; Step S4.6.6: Transfer the acquisition state of the flexible robot to the subsequent state, i.e., s t =s t+1 ,a t =a t+1 ; Go to step S4.6.7; Step S4.6.7, preset the second training round number M2, record the current second training round number m2, and determine whether the current second training round number m2 is less than the preset second training round number M2. If so, return to step S4.2; if not, proceed to step S4.7; Step S4.7, end the training; finally obtain the second action value function of the deep neural network And the final parameters corresponding thereto 2. The flexible robot terminal arrival control method according to claim 1, characterized in that: The step S1 comprises: The kinetic model is expressed by the following formula: Where F is the internal force on the cross section; M is the principal moment on the cross section; f is the uniformly distributed force on the single-section rod of the flexible robot; m is the uniform moment on the single-section rod of the flexible robot; J = J (s, t) is the inertia tensor of the unit length rod; ρ is the density of the unit length rod of the flexible robot; S is the cross-sectional area of ​​the unit length rod of the flexible robot; Ω is the angular velocity of point P in the section principal axis coordinate system P-xyz in the inertial coordinate system with respect to the time variable t.

3. The flexible robot terminal arrival control method according to claim 2, characterized in that: The step S2 comprises: The random trajectory data is converted into training data according to the dynamic model to obtain a random trajectory data set D rand =(s1,a1,r1,s2,a2,r2,...s T ,a T ,r T ), the state s at the current time t is t and the action a t As input, it can predict the state s at the next moment t+1 The state transformation prediction model P(s t+1 |s t ,a t ) is expressed as follows: s t+1 ~P(s t+1 |s t ,a t ) The state s at the current time t t and the action a t As input, the reward r of the predicted environment at the next moment can be t+1 The reward prediction model R(r t+1 |s t ,a t ) is expressed as follows: r t+1 ~R(r t+1 |s t ,a t ) According to the state conversion prediction model P(s t+1 |s t ,a t ) and the reward prediction model R(r t+1 |s t ,a t ) The random trajectory dataset D rand =(s1,a1,r1,s2,a2,r2,...s T ,a T ,r T ) are respectively converted into a density estimation model training set and a regression model training set containing T-1 groups of training samples; The density estimation model training set is represented as follows: <h2 style=";text-align:left;direction:ltr">(s1,a1)→s2,(s2,a2)→s3,...(s<h2 style=";text-align:left;direction:ltr"> T-1 <h2 style=";text-align:left;direction:ltr"> ,a<h2 style=";text-align:left;direction:ltr"> T-1 <h2 style=";text-align:left;direction:ltr"> )→s<h2 style=";text-align:left;direction:ltr"> T The regression model training set is represented as follows: <h2 style=";text-align:left;direction:ltr">(s1,a1)→r2,(s2,a2)→r3,...(s<h2 style=";text-align:left;direction:ltr"> T-1 <h2 style=";text-align:left;direction:ltr"> ,a<h2 style=";text-align:left;direction:ltr"> T-1 <h2 style=";text-align:left;direction:ltr"> )→r<h2 style=";text-align:left;direction:ltr"> T <h2 style=";text-align:left;direction:ltr"> 。 4. The flexible robot terminal arrival control method according to claim 3, characterized in that: The step S3 comprises: Step S3.1: Preset optimal control trajectory data set D RL , at this time it is an empty set state; and randomly initialize the first action value function Go to step S3.2; Step S3.2, preset the first training round number M1, record the current first training round number m1, and determine whether the current first training round number m1 is less than the preset first training round number M1. If so, proceed to step S3.3; if not, proceed to step S3.6; Step S3.3: Determine the optimal control trajectory data set D RL Is it an empty set? If so, go to step S3.3.1; if not, go to step S3.3.2; Step S3.3.1: Based on the random trajectory dataset D rand , using stochastic gradient descent to make the loss function To reach the minimum, In the formula, D1 represents Drand (s t ,a t ,s t+1 ) is a set consisting of t and a t Respectively represent the state and action at the current time t; s t+1 Indicates the state at the subsequent time t+1; Then use the loss function The random trajectory dataset D that reaches the minimum rand The set of data in finds the parameters of the deep neural network At this time, the first action value function of the deep neural network It is a known state, and goes to step S3.4; Step S3.3.2: Based on the optimal control trajectory data set D RL , using stochastic gradient descent to make the loss function To reach the minimum, Where s t and a t Respectively represent the current state and action; s t+1 Indicates the state at the subsequent time; Then use the loss function The optimal control trajectory dataset D that achieves the minimum RL A set of data in the deep neural network is used to find the parameters of the deep neural network. At this time, the first action value function of the deep neural network It is a known state, and goes to step S3.4; Step S3.4: When the number of training times is less than the number of training sample groups T, the number of training sample groups T is equal to the random trajectory data set D rand The total number of training data contained in is T; then execute step S3.5; Step S3.5, obtaining the state s of the flexible robot at the current time t corresponding to the current training number t , proceed to step S3.5.1; Step S3.5.1: Using the first action-value function of the deep neural network Estimate the optimal action sequence of a package containing T actions In the formula T is an integer; Go to step S3.5.2; Step S3.5.2, execute the optimal action sequence The first action in a t , the first action a t The state s of the flexible robot at the current time t corresponding to the current training number t Combine to get the optimal control trajectory (s t , a t ), execute step S3.5.3; Step S3.5.3: Obtain the optimal control trajectory (s t , a t ) is added to the optimal control trajectory data set D RL Go to step S3.5.4; Step S3.5.4, determine whether the number of training times is equal to the number of training sample groups T; if not, return to step S3.5; if yes, return to step S3.2; Step S3.6, end the training; get the final first action value function And the corresponding initial parameters 5. An electronic device, characterized in that: The method comprises a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method according to any one of claims 1 to 4 is implemented.

6. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.