Mechanical arm joint control method and electronic equipment
By using the trained time convolution neural network to calculate the torque of the robotic arm joint and adjust the network if necessary, the problem of low control accuracy of the robotic arm joint is solved, achieving higher control accuracy and task success rate.
Patent Information
- Application Number
- CN202510385166.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-03-28
AI Technical Summary
In the prior art, the controller parameter adjustment process of the robotic arm joint is greatly affected by human factors, resulting in low control accuracy.
The trained time convolution neural network is used instead of the robotic arm controller. By obtaining joint control instructions and expected moment intervals, the first joint moment is calculated, and the time convolution neural network is adjusted when it is outside the expected moment interval until the second joint moment is located within the expected moment interval is obtained, which is used to control the robotic arm joint.
The influence of human factors is reduced, the accuracy of joint control of the robotic arm is improved, making the final calculated second joint torque more accurate, and increasing the probability of successful task execution.
Smart Images

Figure CN119952725A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of robotics technology, and in particular to a robot arm joint control method and electronic equipment. Background Art
[0002] At present, with the development of robots and artificial intelligence, the industry has higher requirements for robot control. The robot's mechanical arm is one of the main actuators for the robot to complete tasks. How to achieve more precise control of each joint of the mechanical arm has become a key issue in the industry.
[0003] In the prior art, the proportional-differential PD controller used converts the received control instructions into actual torque, thereby driving the joints of the robot to move and complete the task. The PD controller will generate appropriate torque by adjusting the proportional and differential gains according to the given target action to ensure that the joints of the robot complete the task as expected. However, the parameters of the PD controller need to be manually adjusted, that is, a knowledgeable and experienced control engineer needs to use simple rules of thumb (such as the Ziegler-Nichols rule) in a single controller system or multiple but decoupled controller systems to manually adjust the controller parameters to adapt to the real environment.
[0004] Therefore, the inventors discovered that the prior art has the following technical problems: due to manual parameter adjustment of the PD controller, the controller parameter adjustment process of the robotic arm joint is greatly affected by human factors, resulting in low control accuracy of the robotic arm joint. Summary of the invention
[0005] The embodiments of the present application provide a robot arm joint control method and electronic device to achieve the effect of improving the control accuracy of the robot arm joints.
[0006] In a first aspect, an embodiment of the present application provides a method for controlling a joint of a robotic arm, comprising:
[0007] Acquire a joint control instruction and an expected torque interval corresponding to the joint control instruction;
[0008] The joint control instruction is used as an input parameter of the trained temporal convolutional neural network to calculate a first joint torque;
[0009] When the first joint torque is outside the expected torque interval, adjusting the trained temporal convolutional neural network to obtain an adjusted temporal convolutional neural network;
[0010] Using the joint control instruction as an input parameter of the adjusted temporal convolutional neural network to calculate a second joint torque;
[0011] The joints of the robotic arm are controlled to perform tasks according to the second joint torque to obtain an execution result.
[0012] In a possible implementation, obtaining joint control instructions and the expected torque range corresponding to the joint control instructions includes: obtaining the task object weight and the task scene spatiality corresponding to the task currently performed by the robotic arm; and determining the expected torque range corresponding to the joint control instructions based on the task object weight and the task scene spatiality.
[0013] In a possible implementation, the upper limit value of the expected torque interval is positively correlated with the weight of the task object; the first span of the expected torque interval is positively correlated with the spatial dimension of the task scene; and the first span of the expected torque interval is the difference between its upper limit value and its lower limit value.
[0014] In a possible implementation, when the first joint torque is outside the expected torque interval, the temporal convolutional neural network is adjusted to obtain an adjusted temporal convolutional neural network, including: respectively obtaining a reference torque interval corresponding to the robotic arm joint and a reference receptive field corresponding to the reference torque interval; when the first joint torque is outside the expected torque interval and the expected torque interval and the reference torque interval are different, respectively obtaining a first span corresponding to the expected torque interval and a second span corresponding to the reference torque interval; the first span corresponding to the expected torque interval is the difference between the upper limit value and the lower limit value of the expected torque interval; the second span corresponding to the reference torque interval is the difference between the upper limit value and the lower limit value of the reference torque interval; taking the ratio between the first span and the second span as the first adjustment ratio; determining the adjusted receptive field according to the first adjustment ratio and the reference receptive field; determining the adjusted temporal convolutional neural network according to the adjusted receptive field.
[0015] In a possible implementation, when the first joint torque is outside the expected torque interval, the temporal convolutional neural network is adjusted to obtain an adjusted temporal convolutional neural network, including: when the first joint torque is greater than the upper limit of the expected torque interval, respectively obtaining a first difference between the first joint torque and the lower limit of the expected torque interval, and a second difference between the upper limit and the lower limit of the expected torque interval; taking the ratio between the first difference and the second difference as a second adjustment ratio; adjusting the receptive field of the temporal convolutional neural network according to the second adjustment ratio to obtain an adjusted receptive field; and determining the adjusted temporal convolutional neural network according to the adjusted receptive field.
[0016] In a possible implementation, the temporal convolutional neural network includes three one-dimensional causal convolutional hidden layers and one fully connected hidden layer; wherein the input and output of the one-dimensional causal convolutional hidden layer are both 31 dimensions, and the one-dimensional causal convolutional hidden layer includes a convolution kernel, which is used to scan each time node to capture the relationship between different time nodes; the input dimension of the fully connected hidden layer is 31 dimensions, and the output dimension is one dimension; the convolution kernel size of the temporal convolutional network is 2, the expansion factor is [1,2,4], the filling method is zero filling, and the discard ratio is 0.3.
[0017] In a possible implementation, the method further includes: acquiring the joint motion data of the temporal convolutional neural network and each joint of the robotic arm, and dividing the joint motion data into a training set and a verification set according to a preset ratio; storing the joint motion data of the previous preset number of frames corresponding to each time node in the training set and the verification set in the order of time nodes to a preset historical data buffer; extracting the training set from the preset historical data buffer at each time node to perform model training on the temporal convolutional neural network, and extracting the verification set for verification to obtain a trained temporal convolutional neural network.
[0018] In a possible implementation, when the first joint torque is outside the expected torque interval, the temporal convolutional neural network is adjusted to obtain an adjusted temporal convolutional neural network, including: calculating the task complexity according to the upper limit value of the expected torque interval and the expected torque interval; determining the adjusted receptive field according to the task complexity and a preset mapping relationship; the preset mapping relationship records the mapping relationship between the task complexity and the corresponding receptive field; and determining the adjusted temporal convolutional neural network according to the adjusted receptive field.
[0019] In a possible implementation, the task complexity is calculated based on the upper limit value of the expected torque interval and the expected torque interval, including: determining the span of the expected torque interval; the span of the expected torque interval is the difference between its upper limit value and its lower limit value; adding the span of the expected torque interval weighted by a first factor and the upper limit value of the expected torque interval weighted by a second factor to obtain the task complexity; the first factor is smaller than the second factor.
[0020] In a second aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
[0021] The memory stores computer-executable instructions;
[0022] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.
[0023] A method and electronic device for controlling a robotic arm joint provided by an embodiment of the present application utilizes a trained temporal convolutional neural network to replace a robotic arm controller, and uses a joint control instruction as an input parameter to obtain a first joint torque. When the first joint torque is outside the expected torque range, the trained temporal convolutional neural network is adjusted, and then the adjusted temporal convolutional neural network is used to calculate a more accurate second joint torque, and finally, the joints of the robotic arm are controlled to perform tasks according to the second joint torque to obtain an execution result. The entire process does not require human intervention, which reduces the influence of human factors, and thus improves the accuracy of the execution result of the robotic arm control. Using an adjusted temporal convolutional neural network can better improve control accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0025] Figure 1 A schematic diagram of a scenario of a robot arm joint control method provided in an embodiment of the present application;
[0026] Figure 2 A schematic diagram of a flow chart of a method for controlling a robot arm joint according to an embodiment of the present application;
[0027] Figure 3 Schematic diagram of the process of adjusting the temporal convolutional neural network provided in another embodiment of the present application Figure 1 ;
[0028] Figure 4 Schematic diagram of the process of adjusting the temporal convolutional neural network provided in another embodiment of the present application Figure 2 ;
[0029] Figure 5 A schematic diagram of a model training process of a temporal convolutional neural network provided in another embodiment of the present application;
[0030] Figure 6 A schematic diagram of a data collection process for joint motion data provided in an embodiment of the present application;
[0031] Figure 7 Schematic diagram of a process for adjusting a temporal convolutional neural network provided in another embodiment of the present application Figure 3 ;
[0032] Figure 8 A schematic diagram of the structure of the electronic device provided in this application.
[0033] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0034] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0035] In the prior art, using the simulation environment, the parameters of the PD controller need to be debugged and optimized through a lot of time and human experience to improve the accuracy of the PD controller's control of the robot arm joints. This process usually involves continuous testing and adjustment to ensure that the robot arm performs stable and efficient performance in different tasks. However, due to the certain gap between the simulation environment and the actual environment, the controller parameters debugged in the simulation sometimes cannot adapt to the real environment. This also makes the PD controller face serious performance degradation when controlling the robot arm joints in the actual environment after adjusting the PD controller parameters in the simulation, resulting in the problem of low control progress.
[0036] In response to the above-mentioned technical problems, the following technical concept is proposed in the embodiments of the present application: a large amount of actual robot arm joint movement data is used to train the neural network model, and a system is established that can automatically calculate the required torque or other control quantities based on the input control instructions, directly drive the robot arm joint movement, thereby avoiding the influence of human factors and improving the accuracy of robot arm joint control.
[0037] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0038] Figure 1 A schematic diagram of a scenario of a robot arm joint control method provided in an embodiment of the present application, such as Figure 1As shown, the application scenario includes: a robot 101 and a target 102 to be grasped. Among them, a server and a scanning device for collecting information about the surrounding environment of the robot 101 are installed on the robot 101. The scanning device can be a radar sensor or a depth camera, and the robotic arm of the robot 101 serves as a task executor. In one embodiment, the robotic arm of the robot 101 can have seven joints, and the seven joints correspond to different motors. The robotic arm joint control method provided in the embodiment of the present application is used to determine the control parameters of the motor of the robotic arm joint, such as torque, to control the robotic arm to complete the corresponding task. In this embodiment, the server can execute the relevant steps of the robotic arm joint control method according to the control instructions input by the user, so as to ultimately enable the robotic arm joint to complete the corresponding task more accurately.
[0039] It should be noted that Figure 1 The application scenario of the robot arm joint control method shown only represents the grasping scenario. The robot arm joint control method proposed in this embodiment can also be applied to other application scenarios such as handling scenarios, clamping scenarios and picking scenarios, etc., which are not limited in this embodiment.
[0040] Figure 2 A schematic diagram of a flow chart of a robot arm joint control method provided in an embodiment of the present application, such as Figure 2 As shown, the method includes:
[0041] S201: Acquire joint control instructions and expected torque ranges corresponding to the joint control instructions.
[0042] In this embodiment, the joint control instruction may be information collected by the robot containing information related to the task to be performed, such as: the target joint position of each joint of the robot arm, or the target joint angle, or information related to the target task object. The expected torque interval may be a torque interval indexed from the correspondence between the pre-stored object and the torque interval according to the relevant information of the target task object. The torque interval in the correspondence may be pre-set or summarized based on historical task experience. For example: when the task object is a bottle, the expected torque interval may be [40,60] (unit: Newton meter N·m).
[0043] S202: Using the joint control instruction as an input parameter of the trained temporal convolutional neural network to calculate a first joint torque.
[0044] In this embodiment, the trained temporal convolutional neural network (TCN neural network) refers to the use of pre-collected motion data of the drive motor from the actual robotic arm joint to capture the dynamic response and behavior of the motor under different working conditions. Subsequently, these motion data and historical joint control instructions related to the robotic arm joint control are used as training data to perform model training on the temporal convolutional neural network, and the trained temporal convolutional neural network can be obtained. The input parameters of the trained temporal convolutional neural network are joint control instructions and historical joint information, and the output result is the joint torque required to perform tasks based on the robotic arm joints. Exemplarily, the above-mentioned historical joint information may include the current joint position or the current joint angle, and may also include at least one of historical joint position information, historical joint velocity information, and historical joint acceleration information.
[0045] Specifically, in an optional embodiment of the present application, after the above-mentioned input parameters are input into the temporal convolutional neural network, they are calculated in sequence through causal convolution, dilated convolution, residual block, stacked residual block and output layer to finally obtain the output result.
[0046] S203: When the first joint torque is outside the expected torque range, the trained temporal convolutional neural network is adjusted to obtain an adjusted temporal convolutional neural network.
[0047] In this embodiment, the first joint torque is outside the expected torque range, indicating that if the output result of the trained time convolutional neural network is used to control the joints of the robotic arm, the corresponding task cannot be completed. For example: the first joint torque is 20 Nm, and the expected torque range is 30 Nm to 50 Nm. At this time, if the robotic arm joints are controlled according to the first joint torque, the task cannot be completed. At this time, the trained time convolutional neural network needs to be adjusted and optimized to improve the accuracy of the output results of the adjusted time convolutional neural network. Among them, the adjustment of the trained time convolutional neural network can be retrained through the training data obtained from different task scenarios and task objects, or the corresponding neural network parameters can be directly adjusted according to different task scenarios and task objects, for example: increasing the receptive field, increasing the amount of historical joint information data, or increasing the expansion factor, etc.
[0048] In an optional embodiment of the present application, after step S202, it also includes: when the first joint torque is within the expected torque range, each joint of the robotic arm is controlled to perform the task based on the first joint torque to obtain an execution result.
[0049] S204: Using the joint control instruction as an input parameter of the adjusted temporal convolutional neural network to calculate a second joint torque.
[0050] In this embodiment, the principle of calculating the second joint torque is similar to the principle in step S202, so it is not repeated here. The difference is that the relevant parameters of the adjusted temporal convolutional neural network are different from the relevant parameters of the trained temporal convolutional neural network. And the output second joint torque is within the expected torque range.
[0051] S205: Controlling each joint of the robot arm to perform a task according to the second joint torque to obtain an execution result.
[0052] In this embodiment, the process of controlling each joint of the robotic arm to perform a task according to the second joint torque may be a process of converting the obtained second joint torque corresponding to each joint into a control signal and then inputting it into the motor corresponding to each joint of the robotic arm so that the robotic arm completes the corresponding task. The obtained execution result may be the success or failure of the task execution.
[0053] In summary, the robot arm joint control method provided in the embodiment of the present application utilizes the trained time convolutional neural network to replace the robot arm controller, and uses the joint control instruction as the input parameter to obtain the first joint torque. When the first joint torque is outside the expected torque range, the trained time convolutional neural network is adjusted, and then the adjusted time convolutional neural network is used to calculate a more accurate second joint torque, and finally the various joints of the robot arm are controlled to perform the task according to the second joint torque to obtain the execution result. The whole process does not require human participation, which reduces the influence of human factors, and thus improves the accuracy of the execution result of the robot arm control. The use of the adjusted time convolutional neural network can better improve the control accuracy; on the other hand, it makes the second joint torque finally calculated more accurate, which is conducive to improving the probability of successful task execution.
[0054] At the same time, the adjusted temporal convolutional neural network is used to automatically calculate the second joint torque used to control the joints of the robotic arm, and the joints of the robotic arm are controlled to perform tasks according to the second joint torque, thereby improving the control efficiency.
[0055] With the above Figure 2 Based on the corresponding embodiment, in an optional embodiment of the present application, step S201 includes:
[0056] S201a: Obtain the weight of the task object and the spatial dimension of the task scene corresponding to the task currently performed by the robot arm.
[0057] In this embodiment, obtaining the weight of the task object and the spatial dimension of the task scene corresponding to the task currently performed by the robot arm can be performed by using the robot's scanning device to capture the environmental information of the task object, and calculating the spatial dimension of the task scene based on relevant technologies. The weight of the task object can be obtained by weighing. Among them, the spatial dimension of the task scene can be, for example, the volume of the current working space of the robot, or the current working space capacity, or the length, width, height of the current working space, or a related parameter calculated based on at least one of the length, width, and height of the current working space, and can also include the width of the robot's working space and the interval between the robot and the obstacle.
[0058] S201b: Determine the expected torque range corresponding to the joint control instruction according to the weight of the task object and the spatial degree of the task scene.
[0059] In this embodiment, the implementation process of step S201b can be that the server first calculates the static torque through data processing software based on the input task object and task object weight, calculates the spatial constraints of the current task scene space on each joint of the robotic arm based on the input task scene space, and chooses to reduce or increase the torque based on the spatial constraints to obtain the expected torque range.
[0060] Based on the above embodiment, in an optional embodiment of the present application, taking the robot arm grabbing a package between shelves as an example, if: the weight of the task object is 5 kg, the width of the robot arm's workspace in the task scene space can be 0.6 meters, the interval between the robot arm and the obstacle is 0.1 meters, the three joints of the robot arm are shoulder, elbow and wrist, and the effective length of the elbow joint is 0.5 meters, the effective length of the elbow joint is 0.4 meters, and the effective length of the wrist joint is 0.3 meters. Then the process calculation process of step S201 is as follows:
[0061] First, the static torque of each joint of the robot arm can be obtained by the calculation formula of the static torque, which is the static torque of the shoulder joint = 82.32 Nm, the static torque of the elbow joint = 34.3 Nm, and the static torque of the wrist joint = 14.7 Nm. Then, according to the working space width of the robot arm of 0.6 meters, the interval between the robot arm and the obstacle of 0.3 meters, and the effective length of the elbow joint of 0.5 meters, the effective length of the elbow joint of 0.4 meters, and the effective length of the wrist joint of 0.3 meters, the space compression coefficient can be calculated as (0.6-2×0.1) / (0.5+0.4+0.3)=0.33, where the space compression coefficient is ≤1, and the smaller the space compression coefficient, the narrower the space. Then, according to the spatial compression coefficient, the task execution safety factor is adjusted to 1 + (1-spatial compression coefficient) = 1.67. Finally, according to the task execution safety factor and the static torque, the expected torque range of the shoulder joint (in Newton meters) can be obtained. The final expected torque range of the shoulder joint = [82.32 × 0.8, 82.32 × 1.67] = [65.9, 137.47], where 0.8 refers to the torque lower limit coefficient pre-set according to different task objects.
[0062] Based on the above embodiments, in an optional embodiment of the present application, the upper limit value of the expected torque interval is positively correlated with the weight of the task object; the first span of the expected torque interval is positively correlated with the spatial dimension of the task scene; the first span of the expected torque interval is the difference between its upper limit value and its lower limit value.
[0063] In this embodiment, the greater the weight of the task object, the greater the upper limit of the corresponding expected torque interval, and vice versa. The first span of the expected torque interval is used to represent the variable range of the expected torque of the manipulator joint. For example, the smaller the task scene space, the smaller the variable range of the expected torque, and the smaller the first span of the corresponding expected torque interval.
[0064] In the embodiment of the present application, the expected torque range is determined by using the mass of the task object and the spatial degree of the task scene, thereby avoiding the problem of inaccurate expected torque range resulting from different task objects or changing dynamic task scenes. This provides a more accurate judgment standard for the torque used to control the joints of the robotic arm in the future, making the second joint torque finally calculated more accurate, which is beneficial to improving the probability of successful task execution.
[0065] Figure 3 Schematic diagram of the process of adjusting the temporal convolutional neural network provided in another embodiment of the present application Figure 1 .
[0066] like Figure 3 As shown above Figure 2 Based on the corresponding embodiment, in an optional embodiment of the present application, step S203 includes:
[0067] S203a: Obtain reference torque intervals corresponding to the joints of the robotic arm and reference receptive fields corresponding to the reference torque intervals respectively.
[0068] In this embodiment, the reference receptive field refers to the range of data that can be input into the calculation process of an output node of a certain layer in a temporal convolutional neural network. The process of obtaining the reference receptive field can be a process of indexing the receptive field corresponding to the reference torque interval through the correspondence between the pre-saved torque interval and the receptive field. Among them, the reference torque interval can be pre-set, that is, after the robot arm leaves the factory, the torque interval that it is good at has been determined. In some possible implementations, for simple tasks, the reference torque intervals are the same.
[0069] S203b: When the first joint torque is outside the expected torque interval and the expected torque interval is different from the reference torque interval, obtain the first span corresponding to the expected torque interval and the second span corresponding to the reference torque interval respectively; the first span corresponding to the expected torque interval is the difference between the upper limit value and the lower limit value of the expected torque interval; the second span corresponding to the reference torque interval is the difference between the upper limit value and the lower limit value of the reference torque interval.
[0070] In this embodiment, the first joint torque is outside the expected torque interval, and the expected torque interval and the reference torque interval are different, which also means that the first joint torque output by the trained temporal convolutional neural network cannot complete the current task. At this time, the trained temporal convolutional neural network can be optimized.
[0071] S203c: Taking the ratio between the first span and the second span as the first adjustment ratio.
[0072] In this embodiment, the ratio between the first span and the second span can be calculated by calculation software, and the ratio is used as the first adjustment ratio.
[0073] S203d: Determine an adjusted receptive field according to the first adjustment ratio and the reference receptive field.
[0074] In this embodiment, the smaller the first adjustment ratio is, the closer the first joint torque needs to be to the reference torque interval, that is, the adjustment is made based on the reference torque interval. This means that the task is more difficult to complete than the torque execution in the expected torque interval, and the reference receptive field corresponding to the reference torque interval can be used to increase the receptive field to obtain the adjusted receptive field.
[0075] S203e: Determine an adjusted temporal convolutional neural network according to the adjusted receptive field.
[0076] In this embodiment, according to the adjusted receptive field, the convolution kernel of each layer of the temporal convolutional neural network can be calculated through the calculation formula of the receptive field, the convolution kernel, and the expansion factor, and then the convolution kernel and the receptive field are used to update the trained temporal convolutional neural network to obtain the adjusted temporal convolutional neural network.
[0077] In summary, the robotic arm joint control method provided in the embodiment of the present application also adjusts the receptive field of the temporal convolutional neural network by adjusting the size of the receptive field, so that the temporal convolutional neural network can extract more time step data, so that the output result of the adjusted temporal convolutional neural network is closer to the reference ideal torque range, thereby improving the accuracy of the robotic arm joint control, making the final calculated second joint torque more accurate, which is beneficial to increasing the probability of successful task execution.
[0078] Figure 4 Schematic diagram of the process of adjusting the temporal convolutional neural network provided in another embodiment of the present application Figure 2 .
[0079] like Figure 4 As shown, in addition to the above method of adjusting the trained temporal convolutional neural network, the above Figure 2 Based on the corresponding embodiment, in an optional embodiment of the present application, step S203 includes:
[0080] S203f: When the first joint torque is greater than the upper limit of the expected torque interval, obtain a first difference between the first joint torque and the lower limit of the expected torque interval, and a second difference between the upper limit and the lower limit of the expected torque interval.
[0081] In this embodiment, the first joint torque is greater than the upper limit value of the expected torque range, indicating that the output result of the trained temporal convolutional neural network is inaccurate. At this time, the receptive field of the temporal convolutional neural network can be adjusted to correct the problem of inaccurate calculation results of the trained temporal convolutional neural network.
[0082] S203g: Taking the ratio between the first difference and the second difference as the second adjustment ratio.
[0083] In this embodiment, the ratio between the first difference and the second difference can be calculated by calculation software, and the ratio is used as the second adjustment ratio.
[0084] S203h: Adjust the receptive field of the temporal convolutional neural network according to the second adjustment ratio to obtain an adjusted receptive field.
[0085] In this embodiment, the smaller the second adjustment ratio is, the closer the first joint torque needs to be to the upper limit of the expected torque interval, that is, the adjustment is made based on the upper limit of the expected torque interval. This means that the task is more difficult to complete than the torque execution in the expected torque interval, and the receptive field can be increased according to the receptive field adjustment rule to obtain the adjusted receptive field, so that the calculated second joint torque is more accurate.
[0086] S203i: Determine an adjusted temporal convolutional neural network based on the adjusted receptive field.
[0087] In this embodiment, the adjustment principle of step S203i is similar to the principle of step S203e, so this embodiment will not be repeated here.
[0088] The robotic arm joint control method provided in this embodiment also adjusts the receptive field of the temporal convolutional neural network by adjusting the size of the receptive field, so that the temporal convolutional neural network extracts more time step data, thereby improving the accuracy of the robotic arm joint control, making the second joint torque finally calculated more accurate, which is beneficial to increasing the probability of successful task execution.
[0089] Based on the above embodiments, in an optional embodiment of the present application, the temporal convolutional neural network includes three one-dimensional causal convolutional hidden layers and one fully connected hidden layer; the input and output of the one-dimensional causal convolutional hidden layer are both 31 dimensions, and the one-dimensional causal convolutional hidden layer includes a convolution kernel, which is used to scan each time node to capture the relationship between different time nodes; the input dimension of the fully connected hidden layer is 31 dimensions, and the output dimension is one dimension; the convolution kernel size of the temporal convolutional network is 2, the expansion factor is [1,2,4], the filling method is zero filling, and the discard ratio is 0.3.
[0090] In this embodiment, the temporal convolutional neural network processes time series data through causal convolution and dilated convolution kernel residual connection. Among them, the input and output of the causal convolution hidden layer are both 31 dimensions, which is intended to be 31-dimensional data when the input parameters are input when training the temporal convolutional neural network. The input dimension of the fully connected hidden layer is 31 dimensions, and the output dimension is one dimension, which is intended to map the output of the third causal convolution hidden layer to 1 dimension, that is, the output of the first joint torque.
[0091] The key hyperparameter settings for the temporal convolutional neural network can be pre-set before artificially training the neural network. The corresponding convolution kernel size is set to 2, the expansion factor is set to [1,2,4], and the activation function of each layer uses the commonly used ReLU function. Among them, the padding method is set to zero padding, which means that the output is padded so that the output size is equal to the input size divided by the step size. When the step size is 1, the output size remains unchanged. At this time, the padding size will be calculated based on the size and step size of the convolution kernel. It is usually padded symmetrically from left to right and from top to bottom. Sometimes there may be asymmetry, such as when the padding number cannot be evenly divided, an extra zero is added to the right or bottom.
[0092] Figure 5 A schematic diagram of the model training process of a temporal convolutional neural network provided in another embodiment of the present application.
[0093] like Figure 5 As shown, based on any of the above embodiments, a robot arm joint control method provided as an optional embodiment of the present application further includes:
[0094] Step A: Acquire the joint motion data of the temporal convolutional neural network and each joint of the robotic arm, and divide the joint motion data into a training set and a validation set according to a preset ratio.
[0095] In this embodiment, the temporal convolutional neural network may adopt a neural network that can process time series data. The joint motion data of each joint of the robot arm may be collected by sensors pre-installed on the robot.
[0096] Figure 6 A schematic diagram of the data collection process of joint motion data provided in another embodiment of the present application.
[0097] like Figure 6 As shown, based on any of the above embodiments, in an optional embodiment of the present application, the data collection process of the joint motion data of each joint of the robot arm is as follows:
[0098] First, multiple diverse trajectories are designed for the end of each joint of the robot arm. Diversity means that each trajectory does not overlap. Then, the target joint angle q of each joint of the robot arm is calculated through inverse kinematics. ref , and input the control torque τ to each joint actuator through the PD controller cmd , to drive each joint actuator (in this embodiment, the actuator can be a motor) to move, and at the same time collect the actual joint angle qp and actual joint speed of each joint Actual joint acceleration The data is collected at a frequency of 500 Hz and stored as joint motion data of each joint of the robotic arm. Finally, the collected joint motion data is divided into a training set and a test set according to a preset ratio. The preset ratio can be set in advance. In this embodiment, the ratio of the test set to the training set used in the preset ratio is 1:9.
[0099] Step B: Store the joint motion data of the previous preset number of frames corresponding to each time node in the training set and the validation set in the order of time nodes into a preset historical data buffer.
[0100] In this embodiment, the first preset number of frames may be a preset number of data frames, such as the ten frames before the current time t. The preset history buffer area may be a 30-dimensional data storage area, such as the preset history buffer area H∈R 30 There are 30 dimensions in total, including R 30 Represents a vector composed of 30 real numbers, that is, a 30-dimensional real number array. For example, the joint motion data of the first ten frames are the historical joint position information qp∈R10, the historical joint velocity information Historical joint acceleration information That is, the first ten frames of joint motion data in the corresponding preset history buffer
[0101] Step C: At each time node, a training set is extracted from a preset historical data buffer to perform model training on the temporal convolutional neural network, and a validation set is extracted for validation to obtain a trained temporal convolutional neural network.
[0102] In this embodiment, the model training process can be to input parameters There are 31 dimensions in total, where qp∈R10 is the historical joint position information of the previous 10 frames at the current moment. is the historical joint velocity information of the previous 10 frames at the current moment, is the historical joint acceleration information of the previous 10 frames at the current moment, qtgt∈R1 is the joint position of the target at the current moment, that is, Input=(qp,H) is input into the initial temporal convolutional neural network, and the input of the temporal convolutional neural network is one-dimensional, where τ is the torque output by the temporal convolutional neural network. Then, τ is compared with the actual torque τa in the joint motion data collected in real time by the sensor, and the parameters of the temporal convolutional neural network are adjusted according to the comparison results until the joint motion data of all time nodes are used for training, and the temporal convolutional neural network to be verified is obtained.
[0103] Then, the joint motion data in the validation set is used to evaluate and adjust the model of the time convolutional neural network to be verified, so as to optimize the key parameters in the time convolutional neural network to be verified, and finally obtain the trained time convolutional neural network. The process of using the validation set is similar to the principle of using the training set, so this embodiment will not be repeated here.
[0104] In summary, the robot arm joint control method provided in the embodiment of the present application also trains and optimizes the time convolutional neural network by using a large amount of joint motion data of each joint of the robot arm in a real environment. Driven by joint motion data, the time convolutional neural network can automatically learn the complex nonlinear characteristics and dynamic changes of the robot arm joint motion during the training process, and the joint motion data of each joint of the robot arm in the real environment reduces the gap between simulation and reality. The trained time convolutional neural network can better output joint torque to each joint of the robot arm as a robot arm joint controller, thereby improving control accuracy; on the other hand, the second joint torque finally calculated is more accurate, which is beneficial to improving the probability of successful task execution. The second joint torque finally calculated is more accurate, which is beneficial to improving the probability of successful task execution.
[0105] At the same time, since the joint motion data in the training set and the validation set are derived from the joint motion in the real environment, the trained temporal convolutional neural network can more accurately reflect the real operating environment, so that the control strategy learned in the simulation environment can be more smoothly transferred to the real environment, reducing the control effect inconsistency caused by the difference between simulation and reality. Therefore, the temporal convolutional neural network driven by joint motion data in the real environment has significant advantages in improving control accuracy and accelerating strategy migration.
[0106] Figure 7 Schematic diagram of a process for adjusting a temporal convolutional neural network provided in another embodiment of the present application Figure 3 .
[0107] like Figure 7 As shown, based on any of the above embodiments, in an optional embodiment, step S203 may also include the following steps:
[0108] S203j: Calculate the task complexity based on the upper limit value of the expected torque interval and the expected torque interval.
[0109] In this embodiment, the upper limit value of the expected torque interval can be positively correlated with the task complexity, and the span of the expected torque interval can be positively correlated with the task complexity. These two factors can be used to express the correlation according to a pre-set ratio. If the correlation between the upper limit value of the preset torque interval and the task complexity is large, the upper limit value of the preset torque interval has a greater impact on the task complexity. The specific value of the task complexity can be calculated by a pre-set code or calculation tool, that is, the upper limit value of the torque interval and the expected torque interval are input into the calculation tool to output the value of the task complexity.
[0110] In an optional embodiment of the present application, step S203j specifically includes:
[0111] Step j1: Determine the span of the expected torque interval; the span of the expected torque interval is the difference between its upper limit and lower limit.
[0112] In this embodiment, the span of the expected torque period can be calculated by subtracting the upper limit value and the lower limit value of the preset torque interval.
[0113] Step j2: Add the span of the expected torque interval weighted by the first factor and the upper limit of the expected torque interval weighted by the second factor to obtain the task complexity; the first factor is smaller than the second factor.
[0114] In this embodiment, the first factor and the second factor can be pre-set weight coefficient values, and the task complexity is dimensionless. For example, if the first factor is 0.2, the second factor is 0.8, and the expected moment interval is [30, 80], then the task complexity = 0.2 × (80-30) + 0.8 × 80 = 74.
[0115] S203k: Determine an adjusted receptive field according to the task complexity and a preset mapping relationship; the preset mapping relationship records a mapping relationship between the task complexity and the corresponding receptive field.
[0116] In this embodiment, the preset mapping relationship may be a correspondence between task complexity and receptive field obtained in advance through experiments or based on historical data summary, and these correspondences may be mapping relationships between task complexity and corresponding receptive fields. The task complexity calculated according to the above steps can be indexed from the preset mapping relationship to the corresponding receptive field as the adjusted receptive field.
[0117] S203m: Determine an adjusted temporal convolutional neural network according to the adjusted receptive field.
[0118] In this embodiment, the specific implementation principle of step S203m is similar to that of step S203a, so it will not be repeated here in this embodiment.
[0119] In summary, the robotic arm joint control method provided in the embodiment of the present application also calculates the task complexity according to the upper limit value of the expected torque interval and the expected torque interval, and determines the adjusted receptive field according to the task complexity and the preset mapping relationship, and then adjusts the trained temporal convolutional neural network according to the adjusted receptive field, so that the adjusted temporal convolutional neural network can cope with robotic arm joint control tasks with different task complexities and improve the control accuracy of robotic arm joints with different task complexities; on the other hand, it makes the second joint torque finally calculated more accurate, which is beneficial to improve the probability of successful task execution.
[0120] At the same time, the task complexity is obtained by weighted calculation of the first factor and the second factor, so that the calculation process of the task complexity is formulated, and the influence of human factors is reduced, which further improves the calculation accuracy of the task complexity. It provides a more accurate receptive field for the calculation of the subsequent receptive field, which is conducive to the adjustment of the temporal convolutional neural network; on the other hand, since the upper limit value of the expected torque interval is more correlated with the task complexity, the second factor is greater than the first factor, which can improve the calculation accuracy of the task complexity, and then improve the accuracy of the receptive field, so that the final calculated second joint torque is more accurate, which is conducive to improving the probability of successful task execution.
[0121] Based on the above embodiments, in an optional embodiment of the present application, when a robotic arm is applied to a completely new real environment, the adjusted temporal convolutional neural network can also be trained for the second time to obtain the latest temporal convolutional neural network. Of course, the amount of joint motion data used in the secondary training at this time may be smaller than the amount of joint motion data in the above embodiments.
[0122] Figure 8 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 8 As shown, the electronic device provided in this embodiment includes: at least one processor 801 and a memory 802. Optionally, the device further includes a communication component 803. The processor 801, the memory 802 and the communication component 803 are connected via a bus.
[0123] In a specific implementation process, at least one processor 801 executes the computer-executable instructions stored in the memory 502, so that at least one processor 801 executes the above method.
[0124] The specific implementation process of the processor 801 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0125] An embodiment of the present application also provides a humanoid robot, including a robot body, a camera disposed on the robot body, and an electronic device as described in the above embodiment disposed in the robot body.
[0126] In this embodiment, both being arranged on the robot body and being arranged inside the robot body can be realized by means of hardware connection structures such as bolt connection, threaded connection, etc.
[0127] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the method in the above embodiment is implemented.
[0128] An embodiment of the present application also provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.
[0129] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0130] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0131] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0132] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0133] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0134] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0135] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0136] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0137] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0138] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0139] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0140] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0141] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for controlling a robot arm joint, characterized in that: include: Acquire a joint control instruction and an expected torque interval corresponding to the joint control instruction; The joint control instruction is used as an input parameter of the trained temporal convolutional neural network to calculate a first joint torque; When the first joint torque is outside the expected torque interval, adjusting the trained temporal convolutional neural network to obtain an adjusted temporal convolutional neural network; Using the joint control instruction as an input parameter of the adjusted temporal convolutional neural network to calculate a second joint torque; The joints of the robotic arm are controlled to perform tasks according to the second joint torque to obtain execution results.
2. The robot arm joint control method according to claim 1, characterized in that: The acquiring of the joint control instruction and the expected torque interval corresponding to the joint control instruction includes: Obtain the task object weight and task scene spatiality corresponding to the task currently performed by the robotic arm; and determine the expected torque interval corresponding to the joint control instruction based on the task object weight and the task scene spatiality.
3. The robot arm joint control method according to claim 2, characterized in that: The upper limit value of the expected torque interval is positively correlated with the weight of the task object; the first span of the expected torque interval is positively correlated with the spatial dimension of the task scene; and the first span of the expected torque interval is the difference between its upper limit value and its lower limit value.
4. The robot arm joint control method according to claim 1, characterized in that: When the first joint torque is outside the expected torque interval, adjusting the temporal convolutional neural network to obtain an adjusted temporal convolutional neural network includes: Respectively obtaining a reference torque interval corresponding to the mechanical arm joint and a reference receptive field corresponding to the reference torque interval; When the first joint torque is outside the expected torque interval, and the expected torque interval is different from the reference torque interval, a first span corresponding to the expected torque interval and a second span corresponding to the reference torque interval are respectively obtained; the first span corresponding to the expected torque interval is the difference between the upper limit value and the lower limit value of the expected torque interval; the second span corresponding to the reference torque interval is the difference between the upper limit value and the lower limit value of the reference torque interval; using a ratio between the first span and the second span as a first adjustment ratio; Determining an adjusted receptive field according to the first adjustment ratio and the reference receptive field; According to the adjusted receptive field, an adjusted temporal convolutional neural network is determined.
5. The robot arm joint control method according to claim 1, characterized in that: When the first joint torque is outside the expected torque interval, adjusting the temporal convolutional neural network to obtain an adjusted temporal convolutional neural network includes: When the first joint torque is greater than the upper limit of the expected torque interval, respectively obtaining a first difference between the first joint torque and the lower limit of the expected torque interval, and a second difference between the upper limit and the lower limit of the expected torque interval; using a ratio between the first difference and the second difference as a second adjustment ratio; Adjusting the receptive field of the temporal convolutional neural network according to the second adjustment ratio to obtain an adjusted receptive field; According to the adjusted receptive field, an adjusted temporal convolutional neural network is determined.
6. The robot arm joint control method according to any one of claims 1 to 5, characterized in that: The temporal convolutional neural network comprises three one-dimensional causal convolution hidden layers and one fully connected hidden layer; The input and output of the one-dimensional causal convolution hidden layer are both 31-dimensional, and the one-dimensional causal convolution hidden layer includes a convolution kernel, which is used to scan each time node to capture the relationship between different time nodes; The input dimension of the fully connected hidden layer is 31 dimensions, and the output dimension is 1 dimension; The convolution kernel size of the temporal convolutional network is 2, the expansion factor is [1, 2, 4], the filling method is zero filling, and the drop ratio is 0.
3.
7. The robot arm joint control method according to any one of claims 1 to 5, characterized in that: The method further comprises: Acquire the joint motion data of the temporal convolutional neural network and each joint of the robotic arm, and divide the joint motion data into a training set and a validation set according to a preset ratio; The training set and the validation set are both stored in the order of time nodes, and the joint motion data of the previous preset number of frames corresponding to each time node are stored in a preset historical data buffer; At each time node, the training set is extracted from the preset historical data buffer to perform model training on the temporal convolutional neural network, and the verification set is extracted for verification to obtain a trained temporal convolutional neural network.
8. The robot arm joint control method according to any one of claims 1 to 5, characterized in that: When the first joint torque is outside the expected torque interval, adjusting the temporal convolutional neural network to obtain an adjusted temporal convolutional neural network includes: Calculating the task complexity according to the upper limit value of the expected torque interval and the expected torque interval; Determine an adjusted receptive field according to the task complexity and a preset mapping relationship; the preset mapping relationship records a mapping relationship between the task complexity and the corresponding receptive field; According to the adjusted receptive field, an adjusted temporal convolutional neural network is determined.
9. The robot arm joint control method according to claim 8, characterized in that: The calculating the task complexity according to the upper limit value of the expected torque interval and the expected torque interval includes: Determine the span of the expected torque interval; the span of the expected torque interval is the difference between its upper limit and lower limit; The task complexity is obtained by adding the span of the expected torque interval weighted by the first factor and the upper limit of the expected torque interval weighted by the second factor; the first factor is smaller than the second factor.
10. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the robot arm joint control method according to any one of claims 1 to 9.