Robot control method, device, equipment and storage medium

The Koopman operator is used to convert the robot's nonlinear system into a linear system, and the reinforcement learning optimization strategy is used to solve the problem that traditional control methods are difficult to adapt to complex environments and achieve efficient control of the robot system in complex environments.

CN118034038BActive Publication Date: 2024-10-29LANZHOU UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410080319.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-19
Publication Date
2024-10-29
Estimated Expiration
2044-01-19

AI Technical Summary

Technical Problem

The traditional linear quadratic control method is difficult to apply to robot systems in complex working environments, especially due to nonlinearity and uncertainty in the working environment, which makes it difficult to achieve effective control.

Method used

The pre-built robot nonlinear system is globally linearized through the Koopman operator and converted into a linear system, and the reinforcement learning method is used to optimize the initial strategy according to the value of the target state to obtain the target strategy to control the robot.

Benefits of technology

It realizes the control of the robot system in a complex working environment and converts it into a linear quadratic control problem, which improves the efficiency and stability of the control and can effectively cope with the complexity of the nonlinear system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118034038B_ABST
    Figure CN118034038B_ABST
Patent Text Reader

Abstract

The present invention discloses a robot control method, device, equipment and storage medium. The robot control method includes performing global linearization processing on a pre-constructed robot nonlinear system according to a Koopman operator to obtain a robot linear system, defining a robot state value according to the robot linear system to obtain a target state value, and performing reinforcement learning on a preset initial strategy according to the target state value to obtain a target strategy. The present invention can convert a robot's nonlinear system into a linear system based on a Koopman operator to realize control of the robot system in a complex working environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and in particular to a robot control method, device, equipment and storage medium. Background Art

[0002] With the vigorous development of the robotics industry, robots with various functions have been applied to more and more fields. However, due to problems such as nonlinearity and complex working environment, the construction and control of robot system models face great challenges, making traditional linear quadratic control methods difficult to apply to robot systems. Summary of the invention

[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a robot control method, which can convert the robot system into a linear system based on the Koopman operator to achieve control of the robot system in a complex working environment.

[0004] The invention also provides a robot control device.

[0005] The invention also provides a robot control device.

[0006] The present invention also provides a computer-readable storage medium.

[0007] In a first aspect, an embodiment of the present invention provides a robot control method, comprising:

[0008] The pre-built robot nonlinear system is globally linearized according to the Koopman operator to obtain the robot linear system;

[0009] Define the state value of the robot according to the robot linear system to obtain the target state value;

[0010] Reinforcement learning is performed on a preset initial strategy according to the target state value to obtain a target strategy, so as to control the robot according to the target strategy.

[0011] The robot control method of the embodiment of the present invention has at least the following beneficial effects: a pre-constructed robot nonlinear system is globally linearized according to the Koopman operator to upgrade the robot nonlinear system to a linear space to obtain a robot linear system, a robot state value is defined according to the robot linear system to obtain a target state value, so as to convert the robot nonlinear system control problem into a linear quadratic control problem, a preset initial strategy is evaluated according to the target state value, and the initial strategy is improved according to the evaluation result to realize reinforcement learning of the initial strategy to obtain a target strategy, and the robot is controlled according to the target strategy. The robot linear system is obtained by globally optimizing the robot nonlinear system through the Koopman operator, the robot nonlinear system control problem is converted into a linear quadratic control problem according to the robot linear system to obtain a target state value, the initial strategy is reinforced according to the target state value to obtain a target strategy, and the robot is controlled according to the target strategy, and the robot system can be converted into a linear system based on the Koopman operator to realize the control of the robot system in a complex working environment.

[0012] According to some other embodiments of the robot control method of the present invention, before performing global linearization processing on the pre-constructed robot nonlinear system according to the Koopman operator to obtain the robot linear system, the robot control method further includes:

[0013] Acquire the state of the robot collected by the built-in sensor to obtain state data;

[0014] Obtain an input vector pre-entered by the user to obtain a control input vector;

[0015] Acquire the noise of the robot during the operation of the system to obtain the system noise;

[0016] A system is constructed according to the state data, the control input vector and the system noise to obtain the robot nonlinear system.

[0017] According to some other embodiments of the robot control method of the present invention, the pre-built robot nonlinear system is globally linearized according to the Koopman operator to obtain the robot linear system, including:

[0018] Acquire target state data from the robot nonlinear system;

[0019] constructing a set of observation data according to the Koopman operator and the target state data;

[0020] The robot nonlinear system is subjected to dimensionality upscaling processing according to a preset conversion matrix and the observation data to obtain the robot linear system.

[0021] According to some other embodiments of the robot control method of the present invention, the step of defining the state value of the robot according to the robot linear system to obtain the target state value includes:

[0022] Defining the cost of the robot according to a preset weighting matrix and the robot linear system to obtain a target cost;

[0023] defining a strategy average cost according to the target cost, and defining a strategy value according to the target cost and the strategy average cost;

[0024] The state value of the robot is defined according to the target cost, the strategy average cost and the strategy value to obtain the target state value.

[0025] According to some other embodiments of the robot control method of the present invention, the weighted matrix includes a state weighted matrix and a control weighted matrix, and the cost of the robot is defined according to the preset weighted matrix and the robot linear system to obtain the target cost, including:

[0026] Acquire target observation data from the observation data, and acquire a target control input vector from the robot nonlinear system;

[0027] Weighting the target observation data according to the state weighting matrix to obtain weighted observation data;

[0028] Weighting the target control input vector according to the control weighting matrix to obtain a weighted control input vector;

[0029] The cost of the robot is defined according to the weighted observation data and the weighted control input vector to obtain the target cost.

[0030] According to other embodiments of the robot control method of the present invention, the step of performing reinforcement learning on a preset initial strategy according to the target state value to obtain a target strategy includes:

[0031] Performing a preliminary optimization on the initial strategy according to the target state value to obtain an initial optimization strategy;

[0032] The initial optimization strategy is iterated a preset number of times according to a preset greedy strategy until the iteration ends to obtain the target strategy.

[0033] According to some other embodiments of the robot control method of the present invention, the initial optimization strategy is iterated for a preset number of times according to the preset greedy strategy until the iteration ends to obtain the target strategy, including:

[0034] Obtaining the state value of the initial optimization strategy to obtain an optimized state value;

[0035] Calculate an estimated value based on the optimized state value and a pre-constructed target data set to obtain a target estimated value;

[0036] The initial optimization strategy is improved according to the greedy strategy and the target estimated value to obtain the target strategy.

[0037] In a second aspect, an embodiment of the present invention provides a robot control device, comprising:

[0038] A linear conversion module is used to perform global linearization processing on the pre-built robot nonlinear system according to the Koopman operator to obtain the robot linear system;

[0039] A state value definition module, used to define the state value of the robot according to the robot linear system to obtain a target state value;

[0040] The reinforcement learning module is used to perform reinforcement learning on a preset initial strategy according to the target state value to obtain a target strategy so as to control the robot according to the target strategy.

[0041] The robot control device of the embodiment of the present invention has at least the following beneficial effects: the linear conversion module performs global linearization processing on the pre-constructed robot nonlinear system according to the Koopman operator to upgrade the robot nonlinear system to a linear space to obtain the robot linear system; the state value definition module defines the state value of the robot according to the robot linear system to obtain the target state value to convert the robot nonlinear system control problem into a linear quadratic control problem; the reinforcement learning module evaluates the preset initial strategy according to the target state value, and improves the initial strategy according to the evaluation result to realize reinforcement learning of the initial strategy to obtain the target strategy, and controls the robot according to the target strategy. The robot linear system is obtained by globally optimizing the robot nonlinear system through the Koopman operator, the robot nonlinear system control problem is converted into a linear quadratic control problem according to the robot linear system, the target state value is obtained, the initial strategy is reinforced according to the target state value to obtain the target strategy, and the robot is controlled according to the target strategy, and the robot system can be converted into a linear system based on the Koopman operator to realize the control of the robot system in a complex working environment.

[0042] In a third aspect, an embodiment of the present invention provides a robot control device, comprising:

[0043] at least one processor, and

[0044] a memory communicatively connected to the at least one processor; wherein,

[0045] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the robot control method as described in the first aspect.

[0046] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are used to enable a computer to execute the robot control method as described in the first aspect.

[0047] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained through the structures particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 is a schematic flow chart of a specific embodiment of the robot control method in an embodiment of the present invention;

[0049] Figure 2 is a flowchart of another specific embodiment of the robot control method in an embodiment of the present invention;

[0050] Figure 3 yes Figure 1 A schematic flow chart of a specific embodiment of step S101;

[0051] Figure 4 yes Figure 1 A schematic flow chart of a specific embodiment of step S102;

[0052] Figure 5 yes Figure 4 A schematic flow chart of a specific embodiment of step S401;

[0053] Figure 6 yes Figure 1 A schematic flow chart of a specific embodiment of step S103;

[0054] Figure 7 yes Figure 6 A schematic flow chart of a specific embodiment of step S603;

[0055] Figure 8 It is a module block diagram of a specific embodiment of the robot control device of the embodiment of the present invention.

[0056] Description of reference numerals:

[0057] Linear conversion module 801, state value definition module 802, reinforcement learning module 803. DETAILED DESCRIPTION

[0058] The following will be combined with the embodiments to clearly and completely describe the concept of the present invention and the technical effects produced, so as to fully understand the purpose, characteristics and effects of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, other embodiments obtained by those skilled in the art without creative work are all within the scope of protection of the present invention.

[0059] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0060] It should be noted that although the system diagram is divided into functional modules and the flow chart shows a logical order, in some cases, the steps shown or described may be performed in a manner different from the module division in the system or the order in the flow chart.

[0061] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.

[0062] In the description of the embodiments of the present invention, if "several" is involved, it means more than one, if "multiple" is involved, it means more than two, if "greater than", "less than" or "exceed" is involved, it should be understood as not including the number itself, if "above", "below" or "within" is involved, it should be understood as including the number itself. If "first" or "second" is involved, it should be understood as being used to distinguish technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0063] With the vigorous development of the robotics industry, robots with various functions have been applied to more and more fields. However, due to problems such as nonlinearity and complex working environment, the construction and control of robot system models face great challenges, making traditional linear quadratic control methods difficult to apply to robot systems.

[0064] In recent years, reinforcement learning has shown excellent performance in many challenging control tasks. Among them, model-free reinforcement learning can find the optimal control strategy without modeling the unknown dynamic system. The model-free reinforcement learning method is an "end-to-end" method that directly optimizes the cost function, avoids the difficulty of modeling and is easy to implement. Linear quadratic problems obey linear dynamics. Theoretical guarantees and practicality make it one of the most studied problems in the field of control, and it has also been widely used in practice. The use of model-free reinforcement learning for linear quadratic control has good development prospects and can even achieve performance comparable to that of model-based methods.

[0065] The current model-free reinforcement learning algorithms used for robot control often learn value functions through Q-value tables or neural networks, which have problems such as few theoretical guarantees and slow convergence. The nonlinearity of the robot system and the uncertainty interference in its working environment make it difficult to use traditional linear quadratic control methods. Therefore, it is necessary to propose a method that can convert the nonlinear system control problem into a linear quadratic control problem and use linear quadratic control based on model-free reinforcement learning.

[0066] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a robot control method, which can convert the robot system into a linear system based on the Koopman operator to achieve control of the robot system in a complex working environment.

[0067] Please refer to Figure 1 , Figure 1 The flowchart of the robot control method in the embodiment of the present invention is shown. In some embodiments, the robot control method specifically includes but is not limited to steps S101 to S103.

[0068] Step S101, performing global linearization processing on a pre-built robot nonlinear system according to a Koopman operator to obtain a robot linear system;

[0069] Step S102, defining the state value of the robot according to the robot linear system to obtain the target state value;

[0070] Step S103, reinforcement learning is performed on the preset initial strategy according to the target state value to obtain the target strategy, and the robot is controlled according to the target strategy.

[0071] In steps S101 to S103 shown in this embodiment, the pre-constructed robot nonlinear system is globally linearized according to the Koopman operator to upgrade the robot nonlinear system to a linear space to obtain a robot linear system, define the robot state value according to the robot linear system, obtain the target state value, convert the robot nonlinear system control problem into a linear quadratic control problem, evaluate the preset initial strategy according to the target state value, and improve the initial strategy according to the evaluation result to achieve reinforcement learning of the initial strategy to obtain the target strategy, and control the robot according to the target strategy. The robot linear system is obtained by globally optimizing the robot nonlinear system through the Koopman operator, converting the robot nonlinear system control problem into a linear quadratic control problem according to the robot linear system to obtain the target state value, and reinforcing the initial strategy according to the target state value to obtain the target strategy, and controlling the robot according to the target strategy, and the robot system can be converted into a linear system based on the Koopman operator to achieve control of the robot system in a complex working environment.

[0072] Please refer to Figure 2 , Figure 2 The flowchart of the robot control method in the embodiment of the present invention is shown. In some embodiments, before the pre-built robot nonlinear system is globally linearized according to the Koopman operator to obtain the robot linear system, the robot control method further includes but is not limited to steps S201 to S204.

[0073] Step S201, obtaining the status of the robot collected by the built-in sensor to obtain status data;

[0074] Step S202, obtaining an input vector pre-input by a user to obtain a control input vector;

[0075] Step S203, obtaining the noise of the robot during the operation of the system to obtain the system noise;

[0076] Step S204, constructing a system according to the state data, the control input vector and the system noise to obtain a robot nonlinear system.

[0077] In steps S201 to S204 shown in this embodiment, the built-in sensor inside the robot collects the state of the robot in real time, obtains the data collected by the built-in sensor, obtains the state data, obtains the input vector pre-entered into the system by the user, obtains the control input vector, obtains the noise generated by the robot during the operation of the system, obtains the system noise, and constructs the nonlinear system of the robot according to the state data, the control input vector and the system noise to obtain the nonlinear system of the robot. By obtaining the state data of the robot, the control input vector input by the user and the system noise during the operation of the system to construct the nonlinear system of the robot, the operation process of the nonlinear system of the robot can be simulated in real time.

[0078] It should be noted that the robot nonlinear system is known, and the robot nonlinear system is x k+1 =f(x k ,u k ,w k ), f(x k ,u k ,w k ) is a known nonlinear function.

[0079] Please refer to Figure 3 , Figure 3 The flowchart of the robot control method in the embodiment of the present invention is shown. In some embodiments, the pre-built robot nonlinear system is globally linearized according to the Koopman operator to obtain the robot linear system, which specifically includes but is not limited to steps S301 to S303.

[0080] Step S301, obtaining target state data from the robot nonlinear system;

[0081] Step S302, constructing a set of observation data according to the Koopman operator and the target state data;

[0082] Step S303, performing dimensionality upscaling processing on the robot nonlinear system according to the preset transformation matrix and the observation data to obtain the robot linear system.

[0083] In steps S301 to S303 shown in this embodiment, the current state data of the robot is obtained in the robot nonlinear system to obtain the target state data, the Koopman operator and the target state data are input into the observation function for solution, and a set of observation data is constructed from the solution result, the robot nonlinear system is globally linearized to upgrade the robot nonlinear system to a linear space, and the preset conversion matrix and the observation data are input into the upgraded system to obtain the robot linear system. By inputting the robot state and the preset Koopman operator into the observation function to solve a set of data, obtaining the observation data, and constructing the robot linear system according to the observation data and the conversion matrix, the operation process of the robot linear system can be simulated in real time.

[0084] It should be noted that the observation function is selected according to the nonlinear system of the robot, or obtained by direct user input, or by optimization construction or neural network and other methods. The robot linear system in linear space is represented by z k+1 =Az k +Bu k +Cw k However, there is no need to solve A and B. Instead, the state of the robot's nonlinear system is upgraded by using the observation function Φ, so that model-free reinforcement learning linear quadratic control can be achieved through the upgraded state data.

[0085] Among them, the robot nonlinear system is x k+1 =f(x k ,u k ,w k ), where xk is the state vector that can be obtained by sensors, etc., and u k is the control input vector entered by the user according to the control strategy, w k represents the system process noise, and f() is a nonlinear function.

[0086] The robot linear system is z k+1 =Az k +Bu k +Cw k , which represents the linear representation of the robot nonlinear system in the linear space after dimensionality increase based on Koopman theory. Among them, the preset transformation matrix includes matrix A, matrix B and matrix C. Matrix A, matrix B and matrix C do not need to be solved here. Matrix A is the unknown state transfer matrix, matrix B is the unknown control transfer matrix, matrix C is the unknown noise transfer matrix, and k represents the sampling time.

[0087] The observation function is z k =Φ(x k), which means that the state vector of the robot nonlinear system is upgraded by using the observation function to obtain the state vector in the linear space, and Φ is the observation function input by the user.

[0088] Control input vector u k It refers to the control vector input by the user to the system. The robot system gets the next state from the current state according to the input control input vector. Among them, the robot linear system obtains the control input vector according to the learned strategy, so that the robot linear system reaches the target state to achieve optimal control.

[0089] In the process of controlling the robot linear system, the interference caused by factors such as devices or environment affects the robot linear system during the state transition process. Assuming that the robot linear system follows the Gaussian distribution during the transition process, Where W w is the covariance matrix of the system process noise of the robot linear system, and W w is unknown.

[0090] According to the Koopman operator theory, the robot nonlinear system x k+1 =f(x k ,u k ,w k ) for global linearization, where x k Indicates the state of the robot, u k represents the control input vector, w k Represents the system process noise. The observation function can be used to upgrade the robot nonlinear system to a linear space, and obtain the robot linear system. The robot linear system is shown in the following formula (1):

[0091] z k+1 =Az k +Bu k +Cw k

[0092] z k =Φ(x k ) (1)

[0093] Where Φ represents a set of Koopman observation functions of the robot nonlinear system, as shown in the following formula (2):

[0094]

[0095] In practical applications, the observation functions that can be selected according to the actual situation of the robot's nonlinear system include: the system state itself, the quadratic state, and radial basis functions.

[0096] For example: a set of observation functions includes: φ1=x1, φ2=x2, The subscript of the observation function x represents the state variable, for example, the two-dimensional state vector x = [x1 x2]). The radial basis function of the thin plate spline centered at x0 is φ(x) = ||x-x0|| 2 log(||x-x0||), the center can be randomly selected within a certain range.

[0097] Please refer to Figure 4 , Figure 4 The flowchart of the robot control method in the embodiment of the present invention is shown. In some embodiments, the state value of the robot is defined according to the robot linear system, and the target state value is obtained, specifically including but not limited to steps S401 to S403.

[0098] Step S401, defining the cost of the robot according to a preset weighting matrix and the robot linear system to obtain a target cost;

[0099] Step S402, defining the strategy average cost according to the target cost, and defining the strategy value according to the target cost and the strategy average cost;

[0100] Step S403, defining the state value of the robot according to the target cost, the strategy average cost and the strategy value, and obtaining the target state value.

[0101] In steps S401 to S403 shown in this embodiment, the cost function of the cost required in the operation process of the robot linear system is defined according to the preset weighting matrix, and the data of the robot linear system is input into the cost function for cost calculation to obtain the target cost, the average cost function of the strategy is defined according to the target cost, and the target cost is input into the average cost function for average cost calculation to obtain the strategy average cost, the value function of the strategy is defined according to the target cost and the strategy average cost, the target cost and the strategy average cost are input into the value function for value calculation to obtain the strategy value, the state value function of the robot is defined according to the target cost, the strategy average cost and the strategy value, the target cost, the strategy average cost and the strategy value are input into the state value function for state value calculation to obtain the target state value. The cost is defined by the preset weighting matrix to obtain the target cost, the average cost of the strategy is defined according to the target cost to obtain the strategy average cost, the value of the strategy is defined according to the target cost and the strategy average cost to obtain the strategy value, the state value is defined according to the target cost, the strategy average cost and the strategy value to obtain the target state value, and the state value of the strategy can be defined according to the parameters of the robot linear system.

[0102] It should be noted that in fact, the robot system cannot usually be described by a linear model, because the state transfer equation is usually described by a nonlinear equation. The control problem of a robot nonlinear system means that it is usually difficult to directly control the robot nonlinear system. Therefore, it is necessary to linearly approximate the robot nonlinear system and then use a linear control method to control it. The linear quadratic optimal control problem obeys linear dynamics, and the state feedback controller is designed to minimize the cost function. The cost function to be minimized is quadratic.

[0103] Please refer to Figure 5 , Figure 5 The flowchart of the robot control method in the embodiment of the present invention is shown. In some embodiments, the weighting matrix includes a state weighting matrix and a control weighting matrix, and the cost of the robot is defined according to the preset weighting matrix and the robot linear system, and the target cost is obtained, including but not limited to steps S501 to S504.

[0104] Step S501, obtaining target observation data from the observation data, and obtaining a target control input vector from the robot nonlinear system;

[0105] Step S502, weighting the target observation data according to the state weighting matrix to obtain weighted observation data;

[0106] Step S503, weighting the target control input vector according to the control weighting matrix to obtain a weighted control input vector;

[0107] Step S504, defining the cost of the robot according to the weighted observation data and the weighted control input vector to obtain the target cost.

[0108] In the steps S501 to S504 shown in the present embodiment, the required observation data is obtained from the observation data of the robot linear system to obtain the target observation data, and the required control input vector is obtained in the robot linear system to obtain the target control input vector, the target observation data is weighted according to the preset state weighting matrix to calculate the weighted value of the target observation data to obtain the weighted observation data, the target control input vector is weighted according to the preset control weighting matrix to calculate the weighted value of the target control input vector to obtain the weighted control input vector, the function of the cost required during the operation of the robot linear system is defined according to the weighted observation data and the weighted control input vector, and the weighted observation data and the weighted control input vector are input into the cost function for cost calculation to obtain the target cost. By obtaining the target observation data and the target control input vector, weighting the target observation data according to the state weighting matrix to obtain the weighted observation data, and weighting the target control input vector according to the control weighting matrix to obtain the weighted control input vector, defining the cost of the robot according to the weighted observation data and the weighted control input vector to obtain the target cost, the cost of the strategy can be defined according to the parameters of the robot linear system.

[0109] It should be noted that the control input vector is obtained according to the control strategy. The control input vector is input into the robot linear system, and the robot linear system obtains the next state according to the current state of the robot, the control input vector and the system process noise interference.

[0110] Assume that the system process noise follows a Gaussian distribution Where W w is the system process noise covariance matrix and is unknown.

[0111] The cost function is defined according to the robot linear system obtained after dimensionality increase, as shown in the following formula (3):

[0112] r(z k ,u k )=z k Τ R z z k +u k Τ R u u k ,z k =Φ(x k ) (3)

[0113] Among them, R z is the state weight matrix, R u is the control weight matrix, the state weight matrix is ​​the weight matrix set by the user according to the state of the robot, and the control weight matrix is ​​the weight matrix set by the user according to the importance of control. For example, the control input vector is uk =π(z k )=Kz k , where the control strategy is the coefficient π.

[0114] In step S402 of some embodiments, for example, the average cost function defined according to the control strategy π is shown in the following formula (4):

[0115]

[0116] The value function defined by the control strategy π is shown in the following formula (5):

[0117]

[0118] Among them, the average cost is a function of the system process noise covariance, and the average cost is non-zero when the system process noise exists. Therefore, the value-based Bellman equation can be obtained as follows (6):

[0119] V(z k ,Kz k )=r(z k ,Kz k )-λ(K)+Ε[V(z k+1 ,K)|z k ] (6)

[0120] In step S403 of some embodiments, a state value function Q(z k ,u k ,K), the state value function satisfies the Bellman equation shown in the following formula (7):

[0121] Q(z k ,u k ,K)=r(z k ,u k )-λ(K)+Ε[V(z k+1 ,K)|d k ] (7)

[0122] in,

[0123] Please refer to Figure 6 , Figure 6 The flowchart of the robot control method in the embodiment of the present invention is shown. In some embodiments, the preset initial strategy is reinforced learned according to the target state value, and the target strategy is obtained, including but not limited to steps S601 to S602.

[0124] Step S601, performing a preliminary optimization on the initial strategy according to the target state value to obtain an initial optimization strategy;

[0125] Step S602, iterating the initial optimization strategy for a preset number of times according to the preset greedy strategy until the iteration ends to obtain the target strategy.

[0126] In steps S601 to S602 shown in this embodiment, the initial strategy is subjected to model-free reinforcement learning according to the target state value, so as to optimize the initial strategy for the first time according to the target state value to obtain the initial optimization strategy, and the initial optimization strategy is iterated a preset number of times according to the greedy strategy, so as to perform reinforcement learning on the initial optimization strategy for a preset number of times according to the greedy strategy until the iteration ends to obtain the target strategy. The initial strategy is subjected to initial reinforcement learning by the target state value to obtain the initial optimization strategy, and the initial optimization strategy is subjected to reinforcement learning according to the greedy strategy to iteratively update the initial optimization strategy to obtain the target strategy, so that the obtained strategy has a more stable strategy gain.

[0127] In step S601 of some embodiments, the initial optimization strategy is u k =π(x k )=K 1 x k The solution method of the initial optimization strategy includes: using DMD and other methods to simply solve the state transfer matrix A and the control transfer matrix B, and then solving the modified discrete time algebraic Riccati equation through the state transfer matrix A and the control transfer matrix B to set the initial stable strategy gain K 1 Other general nonlinear system control methods such as iLQR can also be used to solve and set the initial stability strategy gain. The discrete time algebraic Riccati equation is: DARE(A,B,200R z ,R u ).

[0128] Please refer to Figure 7 , Figure 7 The flowchart of the robot control method in the embodiment of the present invention is shown. In some embodiments, the initial optimization strategy is iterated for a preset number of times according to the preset greedy strategy until the iteration ends, and the target strategy is obtained, including but not limited to steps S701 to S703.

[0129] Step S701, obtaining the state value of the initial optimization strategy to obtain the optimized state value;

[0130] Step S702, performing estimated value calculation according to the optimized state value and the pre-constructed target data set to obtain a target estimated value;

[0131] Step S703, improving the initial optimization strategy according to the greedy strategy and the target estimated value to obtain the target strategy.

[0132] In steps S701 to S703 shown in this embodiment, the iteration process includes: obtaining the state value after the initial optimization strategy is optimized to obtain the optimized state value, inputting the optimized state value and the pre-constructed target data set into the Bellman equation based on the state value to calculate the estimated value according to the optimized state value and the target data set to obtain the target estimated value, substituting the greedy strategy and the target estimated value into the initial optimization strategy for calculation, and improving the strategy of the initial optimization strategy according to the greedy strategy and the target estimated value until the target strategy is obtained after the iteration. By obtaining the optimized state value of the initial optimization strategy, calculating the target estimated value according to the optimized state value and the target data set, and improving the initial optimization strategy according to the greedy strategy and the target estimated value until the target strategy is obtained after the iteration, the obtained strategy can have a more stable strategy gain.

[0133] It should be noted that according to the above definition, the model-free reinforcement learning strategy iteration is implemented, and the initial optimization strategy u is given k =π(x k )=K 1 x k , and then the policy evaluation and policy improvement steps are iterated N times.

[0134] In some embodiments, the process of strategy evaluation includes: for a stable strategy gain K i Get the optimized status value: Thus, the value-based Bellman equation is obtained, as shown in the following formula (8):

[0135]

[0136] in, r k = r(z k ,K i z k ), average cost λ i The estimated value of is the empirical average cost For the i-th iteration, perform τ rounds K on the robot nonlinear system i z k , using cameras, sensors, etc. to collect τ x k Sample, use the observation function to get the sample z after dimension increase k =Φ(x k ) and further obtain in, is a data set, data set According to the initial strategy, the control input is obtained and the state is collected after execution. After the state is upgraded, the state is The data set is used to estimate P ivecv is a matrix operation, as shown in the following formulas (9) and (10):

[0137]

[0138] vecs(P)=[p 11 ,K,p 1n ,p 22 ,K,p 2n ,K p nn ] T (10)

[0139] From formulas (9) and (10), we can get P i LSTD estimation of As shown in the following formula (11):

[0140]

[0141] Then collect τ′ (z k ,u k ,z k+1 ) constitutes the data set In each acquisition, first run τ″ round K i z k Get the final output x k , using the observation function to upgrade the dimension to get z k =Φ(x k ). Then from Sampling to get η k , It refers to the control of the behavior strategy, and the exploration strategy is obtained by adding Gaussian noise to increase the randomness of the strategy. The exploration strategy is used here to adopt the idea of ​​different strategies (that is, the target strategy to be learned is different from the exploration strategy used for interaction) to avoid learning the local optimum. It means that it obeys the Gaussian distribution and is the exploration covariance set by the user.

[0142] Execute u k =K i z k +η k Get the output x k+1 , using the observation function to upgrade the dimension to get z k+1 =Φ(x k+1 ). For the stable strategy gain K i Stateful Value Function d k =[z k Τ ,u k Τ ] Τ, thus obtaining the Bellman equation based on state value, as shown in the following formula (12):

[0143]

[0144] Among them, D k =vecv(d k ). According to formula (13), the data set can be used Get G i Estimated value of

[0145]

[0146] In some embodiments, the process of policy improvement includes: setting the block matrix It is the following formula (14):

[0147]

[0148] in n and m are the dimensions of state and control input respectively. The improved target strategy is obtained by using the greedy strategy, as shown in the following formula (15):

[0149]

[0150] The target policy in the above formula is greedy for the average of the previously estimated value function rather than the last value function, which can obtain a more stable policy gain.

[0151] In addition, the present application also discloses a robot control device, please refer to Figure 8 , Figure 8 An embodiment of the present invention discloses a module block diagram of a robot control device. The robot control method can be implemented, and the robot control device includes: a linear conversion module 801, a state value definition module 802 and a reinforcement learning module 803. The linear conversion module 801, the state value definition module 802 and the reinforcement learning module 803 are all communication connected.

[0152] The linear conversion module 801 performs global linearization processing on the pre-built robot nonlinear system according to the Koopman operator to obtain the robot linear system. The state value definition module 802 defines the robot state value according to the robot linear system to obtain the target state value. The reinforcement learning module 803 performs reinforcement learning on the preset initial strategy according to the target state value to obtain the target strategy, and controls the robot according to the target strategy.

[0153] The linear conversion module 801 performs global linearization processing on the pre-built robot nonlinear system according to the Koopman operator to upgrade the robot nonlinear system to a linear space and obtain the robot linear system. The state value definition module 802 defines the state value of the robot according to the robot linear system to obtain the target state value to convert the robot nonlinear system control problem into a linear quadratic control problem. The reinforcement learning module 803 evaluates the preset initial strategy according to the target state value, and improves the initial strategy according to the evaluation result to realize reinforcement learning of the initial strategy to obtain the target strategy, and controls the robot according to the target strategy. The robot linear system is obtained by globally optimizing the robot nonlinear system through the Koopman operator, and the robot nonlinear system control problem is converted into a linear quadratic control problem according to the robot linear system to obtain the target state value. The initial strategy is reinforced according to the target state value to obtain the target strategy, and the robot is controlled according to the target strategy. The robot system can be converted into a linear system based on the Koopman operator to realize the control of the robot system in a complex working environment.

[0154] The operation process of the robot control device of this embodiment is specifically described as above. Figure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 5 , Figure 6 and Figure 7 The robot control method steps S101 to S103, steps S201 to S204, steps S301 to S303, steps S401 to S403, steps S501 to S504, steps S601 and S602, and steps S701 to S703 are not repeated here.

[0155] Another embodiment of the present invention discloses a robot control device, comprising: at least one processor, and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the following steps: Figure 1 The control method steps S101 to S103, Figure 2 The control method steps S201 to S204, Figure 3 The control method steps S301 to S303, Figure 4 The control method steps S401 to S403, Figure 5 The control method steps S501 to S504, Figure 6 The control method steps S601 and S602 and Figure 7The robot control method of the control method steps S701 to S703.

[0156] Another embodiment of the present invention discloses a computer-readable storage medium, the storage medium comprising: the storage medium stores computer-executable instructions, the computer-executable instructions are used to enable a computer to execute Figure 1 The control method steps S101 to S103, Figure 2 The control method steps S201 to S204, Figure 3 The control method steps S301 to S303, Figure 4 The control method steps S401 to S403, Figure 5 The control method steps S501 to S504, Figure 6 The control method steps S601 and S602 and Figure 7 The robot control method of the control method steps S701 to S703.

[0157] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0158] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0159] The embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in the relevant technical field without departing from the purpose of the present invention. In addition, the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.

Claims

1. A robot control method, It is characterized in that include: Acquire the state of the robot collected by the built-in sensor to obtain state data; Obtain an input vector pre-entered by the user to obtain a control input vector; Acquire the noise of the robot during the operation of the system to obtain the system noise; Performing system construction according to the state data, the control input vector and the system noise to obtain a robot nonlinear system; Performing global linearization processing on the pre-constructed robot nonlinear system according to the Koopman operator to obtain a robot linear system; Define the state value of the robot according to the robot linear system to obtain the target state value; Performing reinforcement learning on a preset initial strategy according to the target state value to obtain a target strategy, so as to control the robot according to the target strategy; The robot linear system is obtained by performing global linearization processing on the pre-built robot nonlinear system according to the Koopman operator, including: Acquire target state data from the robot nonlinear system; constructing a set of observation data according to the Koopman operator and the target state data; Performing dimension-upgrading processing on the robot nonlinear system according to a preset conversion matrix and the observation data to obtain the robot linear system; Defining the state value of the robot according to the robot linear system to obtain the target state value includes: Defining the cost of the robot according to a preset weighting matrix and the robot linear system to obtain a target cost; defining a strategy average cost according to the target cost, and defining a strategy value according to the target cost and the strategy average cost; The state value of the robot is defined according to the target cost, the strategy average cost and the strategy value to obtain the target state value.

2. The robot control method according to claim 1, It is characterized in that The weighted matrix includes a state weighted matrix and a control weighted matrix. The cost of the robot is defined according to the preset weighted matrix and the robot linear system to obtain the target cost, including: Acquire target observation data from the observation data, and acquire a target control input vector from the robot nonlinear system; Weighting the target observation data according to the state weighting matrix to obtain weighted observation data; Weighting the target control input vector according to the control weighting matrix to obtain a weighted control input vector; The cost of the robot is defined according to the weighted observation data and the weighted control input vector to obtain the target cost.

3. The robot control method according to claim 2, It is characterized in that The step of performing reinforcement learning on the preset initial strategy according to the target state value to obtain the target strategy includes: Performing a preliminary optimization on the initial strategy according to the target state value to obtain an initial optimization strategy; The initial optimization strategy is iterated a preset number of times according to a preset greedy strategy until the iteration ends to obtain the target strategy.

4. The robot control method according to claim 3, It is characterized in that The initial optimization strategy is iterated for a preset number of times according to the preset greedy strategy until the iteration ends to obtain the target strategy, including: Obtaining the state value of the initial optimization strategy to obtain an optimized state value; Calculate an estimated value based on the optimized state value and a pre-constructed target data set to obtain a target estimated value; The initial optimization strategy is improved according to the greedy strategy and the target estimated value to obtain the target strategy.

5. A robot control device, It is characterized in that include: A linear conversion module is used to perform global linearization processing on the pre-built robot nonlinear system according to the Koopman operator to obtain the robot linear system; A state value definition module, used to define the state value of the robot according to the robot linear system to obtain a target state value; A reinforcement learning module, used for performing reinforcement learning on a preset initial strategy according to the target state value to obtain a target strategy, so as to control the robot according to the target strategy; The robot control device is also used to: obtain the state of the robot collected by the built-in sensor to obtain state data; obtain the input vector pre-input by the user to obtain the control input vector; obtain the noise of the robot during the system operation to obtain the system noise; construct the system according to the state data, the control input vector and the system noise to obtain the nonlinear system of the robot; Acquire target state data from the robot nonlinear system; constructing a set of observation data according to the Koopman operator and the target state data; The robot nonlinear system is dimensionalized according to a preset conversion matrix and the observation data to obtain the robot linear system; the cost of the robot is defined according to a preset weighting matrix and the robot linear system to obtain the target cost; the strategy average cost is defined according to the target cost, and the strategy value is defined according to the target cost and the strategy average cost; the state value of the robot is defined according to the target cost, the strategy average cost and the strategy value to obtain the target state value.

6. A robot control device, It is characterized in that include: at least one processor, and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the robot control method according to any one of claims 1 to 4.

7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the robot control method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Omni-directional mobile mechanical arm data driving model prediction control method based on Koopman operator

    CN112016194A

  • Unmanned aerial vehicle multi-target optimal control method and equipment based on strategy gradient

    CN114384931A

  • Model training method and device, strategy optimization method, equipment and medium

    CN114939870A

  • Enhanced Koopman control method for hysteresis nonlinear system

    CN117055335A