A robotic arm control system based on reward weight
By integrating multiple reinforcement learning models into a reward-weighted robotic arm control system, the problem of insufficient adaptability of robotic arms in multi-task environments is solved, achieving efficient task decision-making and improved computational efficiency.
Patent Information
- Application Number
- CN202410560555.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-08
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-05-08
AI Technical Summary
Existing robotic arms struggle to adapt flexibly to changing tasks in multi-task environments, and existing multi-task reinforcement learning methods are computationally intensive and cannot be deployed in robotic arm control systems with limited computing power.
A reward-weight-based robotic arm control system is adopted. By integrating the reward weights of multiple reinforcement learning models, a fusion model is constructed to enable the robotic arm to make autonomous decisions and implement efficient strategies for different tasks.
It improves the intelligence and adaptability of robotic arms, reduces computational load, is suitable for systems with limited computing power, and can make efficient decisions in multi-tasking environments.
Smart Images

Figure CN118418125B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robot control technology, and in particular to a robot arm control system based on reward weight. Background Art
[0002] With the rapid development of robotic arm technology, robotic arms have been widely used in tasks such as grasping, handling, and assembly, which not only liberates manpower but also improves the efficiency and quality of industrial production.
[0003] In the traditional control field, the control and motion planning of mobile robotic arms usually involve kinematic modeling of the robotic arm and solving the end position and angle values of each joint. As the complexity of the actual application environment continues to increase, the traditional model- and rule-based control methods will become more and more complex in modeling the environment and solving the kinematics of the robotic arm.
[0004] Deep reinforcement learning is a new research hotspot in the field of artificial intelligence, with broad application prospects. It combines the perception ability of deep learning with the decision-making ability of reinforcement learning in a universal form, and can achieve direct control from raw input to output through end-to-end learning. As a learning method for solving sequential decision-making, deep reinforcement learning can establish an autonomous system with a higher level of understanding of the environment by continuously optimizing the control strategy, thereby learning the optimal strategy.
[0005] However, in deep reinforcement learning, the trained model is only applicable to the current environment. If the environment changes, the trained model needs to be retrained. Many existing studies focus on the single task of the robot arm. When the properties of the target and the object change, the model trained to push the object to the target to complete the task is difficult to complete the task of pushing and then grabbing the object to the target. In other words, the model trained using a single task cannot achieve the same effect as during training, which limits the applicability of the robot arm in certain scenarios. Some existing multi-task reinforcement learning focuses on achieving knowledge sharing through changes in model structure. It is necessary to set too many parameters for multiple tasks, resulting in a large amount of calculation and cannot be deployed in a robot arm control system with limited computing power. Therefore, how to deal with the uncertainty of the task so that the robot arm can make decisions between different tasks and accurately complete the task is a very worthy issue to study. Summary of the invention
[0006] In view of the above analysis, an embodiment of the present invention aims to provide a robot arm control system based on reward weights to solve the problem that the existing robot arm cannot flexibly complete multiple tasks.
[0007] The embodiment of the present invention provides a reward weight-based robotic arm control system, comprising: a robotic arm, a model fusion module and a task execution module;
[0008] The robot arm is used to perform corresponding actions according to the instructions issued by the task execution module, and send the collected robot arm posture and environmental information to the task execution module;
[0009] The model fusion module is used to fuse the reinforcement learning models according to the reward weights of each reinforcement learning model in each task to obtain the fusion model corresponding to each task;
[0010] The task execution module is used to construct a state vector based on the received robot arm posture and environmental information, and according to the task to be completed, the state vector is passed to the corresponding fusion model in the model fusion module, and the corresponding instructions are sent to the robot arm according to the action vector output by the fusion model.
[0011] Based on the further improvement of the above system, in the model fusion module, the model structure of the fusion model corresponding to each task is the same as the model structure of each reinforcement learning model, and the network parameters at each position of the fusion model corresponding to each task are obtained by weighted summing up the network parameters at the same position of each reinforcement learning model using the reward weights of each reinforcement learning model in the same task.
[0012] Based on the further improvement of the above system, the robotic arm is a serial 3-DOF robotic arm, including a turntable with 1 DOF, a joint module with 2 DOF, an end effector and a depth camera. The turntable is the base of the robotic arm; the joint module includes an upper arm and a lower arm, and the position of the end effector is located by controlling the directions of the upper arm and the lower arm; the end effector is an electric claw-type gripper used to perform tasks; the depth camera is used to collect the position of the end effector, as well as the positions of targets and objects in the environment.
[0013] Based on the further improvement of the above system, the tasks include: pushing objects to the target and grabbing objects to the target; the system also includes a reward weight acquisition module, which is used to calculate the average total round reward of each reinforcement learning model for multiple rounds of interaction with the simulation environment for each task, and then obtain the reward weight of each reinforcement learning model in the task based on the average total round reward.
[0014] Based on further improvements to the above system, the model structures of various reinforcement learning models are the same, including a policy network and a value network, which are trained by setting different tasks in a simulation environment.
[0015] Based on the further improvement of the above system, in the reward weight acquisition module, the average round total reward of each reinforcement learning model interacting with the simulation environment for multiple rounds is calculated for each task, including:
[0016] For the same task, each reinforcement learning model is used to interact with the simulation environment the same number of times, and the reward value fed back by the simulation environment in each interaction is summarized to obtain the total reward of each reinforcement learning model in each round; then, based on the same number of rounds, the average total round reward corresponding to each reinforcement learning model in each task is obtained.
[0017] Based on the further improvement of the above system, the reward value fed back by the simulation environment is the negative of the distance between the object and the target at the current moment.
[0018] Based on the further improvement of the above system, in the reward weight acquisition module, the reward weight of each reinforcement learning model in the task is obtained according to the average round total reward, including:
[0019] The reinforcement learning model corresponding to the minimum value of the average round total reward in the task is taken as the base model, and its initial weight is set to 1; the initial weights of other reinforcement learning models are obtained by calculating the ratio of their respective average round total rewards to the average round total reward of the base model; the initial weights are normalized to obtain the weights of each reinforcement learning model in the task.
[0020] Based on the further improvement of the above system, the initial weights of other reinforcement learning models are calculated by the following formula:
[0021]
[0022] in, is the initial weight of the i-th reinforcement learning model in the j-th task, is the average round total reward of the base model in the jth task, is the average total round reward of the ith reinforcement learning model in the jth task.
[0023] Based on further improvements of the above system, the state vector includes: the observation value at the current moment, the observation value at the previous moment and the target position at the current moment, wherein the observation values include: the end effector position, the normalized opening and closing degree of the end effector, the object position and the object moving speed; the action vector includes: the end effector position and the normalized opening and closing degree of the end effector.
[0024] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0025] 1. Multiple reinforcement learning models are integrated according to the reward weights to improve the generalization ability of the model, so that better decisions can be made when the task changes, and the intelligence and adaptability of the robotic arm are improved; by integrating multiple basic models, it is avoided to set too many parameters to adapt to different target tracking tasks, the calculation amount is small, and it is suitable for robotic arm control systems with limited computing power.
[0026] 2. By setting different tasks to learn the reinforcement learning model, each reinforcement learning model can cover multiple tasks of the robot arm. Then, the weight fusion model is calculated based on the average reward for completing the same task, so that the robot arm can autonomously learn and make more efficient strategies when facing multiple tasks, and cope with more complex and diverse task requirements.
[0027] 3. The weight acquisition method is applicable to all reinforcement learning paradigms. Models with exactly the same structure except for network parameters speed up the learning and training speed of intelligent agents when facing multiple tasks.
[0028] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.
[0030] Figure 1 Schematic diagram of the structure of a robotic arm control system based on reward weights in an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0032] A specific embodiment of the present invention discloses a reward weighted robotic arm control system, such as Figure 1 As shown, it includes: a robotic arm, a model fusion module and a task execution module;
[0033] The robot arm is used to perform corresponding actions according to the instructions issued by the task execution module, and send the collected robot arm posture and environmental information to the task execution module;
[0034] The model fusion module is used to fuse the reinforcement learning models according to the reward weights of each reinforcement learning model in each task to obtain the fusion model corresponding to each task;
[0035] The task execution module is used to construct a state vector based on the received robot arm state information and environmental information, and according to the task to be completed, pass the state vector to the corresponding fusion model in the model fusion module, and send corresponding instructions to the robot arm according to the action vector output by the fusion model.
[0036] It should be noted that the robotic arm in this embodiment is a serial 3-DOF robotic arm, including a turntable with 1 DOF, a joint module with 2 DOF, an end effector and a depth camera. The turntable is the base of the robotic arm, and its position remains unchanged when performing tasks; the joint module includes an upper arm and a lower arm, and the position of the end effector is located by controlling the directions of the upper arm and the lower arm; the end effector is an electric claw-type gripper used to perform tasks; the depth camera is used to collect the position of the end effector, as well as the positions of targets and objects in the environment.
[0037] The tasks in this embodiment include pushing an object to a target and grabbing an object to a target. Within the range of the object and the target, the task execution module converts the motion vector output by the fusion model into an instruction to control the manipulator to perform the corresponding action. The manipulator interacts with the working environment multiple times to complete the set task. For example, the manipulator rotates the turntable according to the instructions issued by the task execution model to change the position of the joint module, adjusts the servo angles of the upper arm and the lower arm in the joint module, moves the end effector to the corresponding position, and controls the opening / closing degree of the gripper of the end effector to release / grasp the object.
[0038] The state vector in this embodiment includes: the observation value at the current moment, the observation value at the previous moment and the target position at the current moment, wherein the observation value includes: the end effector position, the normalized opening and closing degree of the end effector, the object position and the object moving speed; the action vector includes: the end effector position and the normalized opening and closing degree of the end effector.
[0039] It should be noted that the normalized opening and closing degree of the end effector is 1D, the position includes the 3D Cartesian coordinate value, and the object movement speed includes the speed value on the 3D Cartesian coordinate system, which is calculated based on the position difference and time of the object at adjacent moments. Therefore, in this embodiment, the state space is a 23D continuous state space, and the action space is a 4D continuous action space.
[0040] It should be noted that the model structures of the reinforcement learning models fused in the model fusion module are the same, including a policy network and a value network. This embodiment does not limit the network model structure. For example, both the policy network and the value network can adopt a two-layer fully connected network. Among them, the input of the policy network is the state vector of the robot arm, and the output is the action vector; the input of the value network is the state vector of the robot arm, and the output is the value of the state under the current action.
[0041] Each reinforcement learning model sets different tasks in the simulation environment and uses the reinforcement learning algorithm to update the policy network parameters in the process of interacting with the simulation environment, so that the probability of selecting high-reward actions increases and the probability of selecting low-reward actions decreases. In this way, the strategy is improved step by step until the optimal policy network is trained.
[0042] That is to say, the model structures of the reinforcement learning models trained in this embodiment are the same, but the network parameters are different. During training, if the same task is faced, the random seed is not set, and multiple reinforcement learning models with different network parameters are trained under the condition that the target and object attributes, action vector, state vector, and reward function are exactly the same; if different tasks are faced, the random seed is not set, and the action vector, state vector, and reward function are the same but the target and object attributes are different, and multiple reinforcement learning models with different network parameters are trained.
[0043] It should be noted that setting the same random seed value during training can make the training process repeatable and obtain the same network parameters. Conversely, not setting the random seed can obtain different network parameters.
[0044] The tasks for which each trained reinforcement learning model is trained are the tasks in which it excels. In order to accurately complete the tasks in which it excels and cope with changes in tasks, this embodiment fuses the reward weights of each reinforcement learning model in each task in the model fusion module, so that the fused model can not only handle the task well, but also successfully complete other different tasks.
[0045] It should be noted that the reward weight of each reinforcement learning model in each task is obtained by using the reward weight acquisition module also included in the system.
[0046] Considering that the reward value is an indicator for evaluating the quality of a strategy or an action in reinforcement learning, and the training process of reinforcement learning is based on rounds, the reward weight is calculated based on the average round total reward. In other words, the reward weight acquisition module is used to calculate the average round total reward of each reinforcement learning model interacting with the simulation environment for multiple rounds for each task, and then obtain the reward weight of each reinforcement learning model in the task based on the average round total reward.
[0047] It should be noted that an episode is a sequence of interactions between the agent and the environment, which ends with a final state. In this embodiment, reaching the number of interactions is used as the end mark, that is, for each task, each basic model interacts with the simulation environment the same number of times in each episode. However, the number of interactions with the simulation environment in each episode may be different between different models, and the total number of episodes may also be different.
[0048] For example, in the task of "pushing an object to the target", each reinforcement learning model interacts with the simulation environment 500 times per round, and executes 30 rounds in total; in the task of "grasping an object to the target", each reinforcement learning model interacts with the simulation environment 600 times per round, and executes 50 rounds in total.
[0049] In the reward weight acquisition module, the average total round reward of each reinforcement learning model interacting with the simulation environment for multiple rounds is calculated for each task, including:
[0050] For the same task, each reinforcement learning model is used to interact with the simulation environment for the same number of times, and the reward value fed back by the simulation environment in each interaction is summarized to obtain the total reward of each reinforcement learning model in each round; then, based on the same number of rounds, the average total round reward corresponding to each reinforcement learning model in each task is obtained. Among them, the reward value fed back by the simulation environment is the negative of the distance between the object and the target at the current moment.
[0051] Next, the reward weights of each reinforcement learning model in the task are obtained based on the average round total reward, including:
[0052] The reinforcement learning model corresponding to the minimum value of the average round total reward in the task is taken as the base model, and its initial weight is set to 1; the initial weights of other reinforcement learning models are obtained by calculating the ratio of their respective average round total rewards to the average round total reward of the base model; the initial weights are normalized to obtain the weights of each reinforcement learning model in the task.
[0053] Specifically, the initial weights of other basic models are calculated using the following formula:
[0054]
[0055] in, is the initial weight of the i-th reinforcement learning model in the j-th task, is the average round total reward of the base model in the jth task, is the average total round reward of the ith reinforcement learning model in the jth task.
[0056] Furthermore, each initial weight is normalized to between [0, 1] by the following formula, and the sum of the normalized weights under the unified target tracking task is 1:
[0057]
[0058] in, for The normalized weights, n represents the total number of basic models.
[0059] For example, there are 2 basic models, the average round total reward of the first basic model is -1125.93991, and the average round total reward of the second basic model is -944.48179. Then the first basic model 1 is the base model, and the initial weights of the two basic models are 1 and 1.19212453 respectively, and the normalized weights are 0.4562 and 0.5438 respectively.
[0060] It should be emphasized that in this embodiment, multiple reinforcement learning models are obtained by multiple learning and training for different tasks, and then the weight of each reinforcement learning model in each task is calculated according to the average round total reward of performing the same task, so that the reinforcement learning model has a larger weight in the task it is good at and contributes more, while increasing its generalization ability in other tasks. In other words, the reward weight of each reinforcement learning model is different for different tasks.
[0061] It can be understood that the method for obtaining weights in this embodiment is applicable to all reinforcement learning paradigms, and models with exactly the same structure except for network parameters accelerate the learning and training speed of the intelligent agent when facing multiple tasks.
[0062] In the model fusion module, the model structure of the fusion model corresponding to each task is the same as the model structure of each reinforcement learning model. The network parameters at each position of the fusion model corresponding to each task are obtained by weighted summing the network parameters at the same position of each reinforcement learning model using the reward weights of each reinforcement learning model in the same task.
[0063] It should be noted that this embodiment fuses multiple reinforcement learning models according to the reward weight. The fused model is better than any reinforcement learning model in the task when completing its corresponding task. It can make accurate decisions flexibly after the task changes, thereby improving the intelligence and adaptability of the robotic arm. By fusing multiple basic models, it avoids setting too many parameters to adapt to different target tracking tasks, and the amount of calculation is small, which is suitable for robotic arm control systems with limited computing power.
[0064] Before the robot arm performs a task, the working environment of the robot arm is initialized first, including: using the base of the robot arm as the world coordinate system, constructing the action area of the robot arm according to the appearance range of the objects to be pushed / grasped and the range of the target; using the depth camera to collect the position of the end effector, as well as the position of the target and the object, and converting them to the world coordinate system.
[0065] During the process of the robot arm performing the task, after the robot arm interacts with the working environment, the task execution module calculates the values of each dimension in the state vector based on the position of the end effector in the robot arm's posture, the normalized opening and closing degree, and the position of objects and targets in the environmental information, and passes the constructed state vector into the fusion model corresponding to the task to be completed in the model fusion module. The strategy network of the fusion model outputs an action vector, which is then converted into an instruction and sent to the robot arm. The robot arm performs the corresponding action according to the instruction and interacts with the working environment iteratively until the task is completed.
[0066] Compared with the prior art, the present embodiment provides a reward weight-based robotic arm control system, which fuses multiple reinforcement learning models according to the reward weight, improves the generalization ability of the model, enables better decisions to be made when the task changes, and improves the intelligence and adaptability of the robotic arm; by fusing multiple basic models, it avoids setting too many parameters to adapt to different target tracking tasks, and the amount of calculation is small, which is suitable for robotic arm control systems with limited computing power; by setting different tasks to learn the reinforcement learning model, each reinforcement learning model covers a variety of tasks of the robotic arm, and then calculates the weight fusion model based on the average reward for completing the same task, so that the robotic arm can autonomously learn and make more efficient strategies when facing multiple tasks, and cope with more complex and diverse task requirements; the weight acquisition method is applicable to all reinforcement learning paradigms, and models with exactly the same structure except for network parameters, which speeds up the learning and training speed of the intelligent agent when facing multiple tasks.
[0067] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0068] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A robotic arm control system based on reward weights, characterized in that: include: Robotic arm, model fusion module, task execution module and reward weight acquisition module; The robotic arm is used to perform corresponding actions according to the instructions issued by the task execution module, and send the collected robotic arm posture and environmental information to the task execution module; The model fusion module is used to fuse the reinforcement learning models according to the reward weights of the reinforcement learning models in each task to obtain a fusion model corresponding to each task; The task execution module is used to construct a state vector according to the received robot arm posture and environmental information, and according to the task to be completed, the state vector is transferred to the corresponding fusion model in the model fusion module, and the corresponding instruction is sent to the robot arm according to the action vector output by the fusion model; the tasks include: pushing an object to a target and grabbing an object to a target; The reward weight acquisition module is used to calculate the average total round reward of each reinforcement learning model for multiple rounds of interaction with the simulation environment for each task, and then obtain the reward weight of each reinforcement learning model in the task according to the average total round reward; the calculation of the average total round reward of each reinforcement learning model for multiple rounds of interaction with the simulation environment for each task includes: for the same task, using each reinforcement learning model to interact with the simulation environment for the same number of times, summarizing the reward value fed back by the simulation environment in each interaction, and obtaining the total reward of each reinforcement learning model for each round; then, according to the same number of rounds, obtaining the average total round reward corresponding to each reinforcement learning model in each task; the reward value fed back by the simulation environment is the negative of the distance between the object and the target at the current moment.
2. The reward weight-based robotic arm control system according to claim 1, characterized in that: In the model fusion module, the model structure of the fusion model corresponding to each task is the same as the model structure of each reinforcement learning model, and the network parameters at each position of the fusion model corresponding to each task are obtained by weighted summing the network parameters at the same position of each reinforcement learning model using the reward weights of each reinforcement learning model in the same task.
3. The reward weight-based robotic arm control system according to claim 1, characterized in that: The robotic arm is a serial 3-DOF robotic arm, including a turntable with 1 DOF, a joint module with 2 DOF, an end effector and a depth camera, wherein the turntable is the base of the robotic arm; the joint module includes an upper arm and a lower arm, and the position of the end effector is located by controlling the directions of the upper arm and the lower arm; the end effector is an electric claw-type gripper for performing tasks; the depth camera is used to collect the position of the end effector, as well as the positions of targets and objects in the environment.
4. The reward weight-based robotic arm control system according to claim 1, characterized in that: The reinforcement learning models have the same model structure, including a policy network and a value network, and are trained by setting different tasks in a simulation environment.
5. The reward weight-based robotic arm control system according to claim 1, characterized in that: In the reward weight acquisition module, the reward weight of each reinforcement learning model in the task is obtained according to the average round total reward, including: The reinforcement learning model corresponding to the minimum value of the average round total reward in the task is taken as the base model, and its initial weight is set to 1; the initial weights of other reinforcement learning models are obtained by calculating the ratio of their respective average round total rewards to the average round total reward of the base model; the initial weights are normalized to obtain the weights of each reinforcement learning model in the task.
6. The reward weight-based robotic arm control system according to claim 5, characterized in that: The initial weights of the other reinforcement learning models are calculated using the following formula: , in, For the j Task No. i The initial weights of the reinforcement learning model, For the j The average total round reward of the base model in tasks, For the j Task No. i Average total reward per episode for the reinforcement learning model.
7. The reward weight-based robotic arm control system according to claim 1, characterized in that: The state vector includes: the observation value at the current moment, the observation value at the previous moment and the target position at the current moment, wherein the observation value includes: the end effector position, the normalized opening and closing degree of the end effector, the object position and the object moving speed; the action vector includes: the end effector position and the normalized opening and closing degree of the end effector.
