Mechanical arm joint control method and electronic device

By using a trained temporal convolutional neural network to automatically calculate the torque of the robotic arm joints, the problem of low control precision under the influence of human factors is solved, and higher control precision and efficiency are achieved.

CN119952725BActive Publication Date: 2026-06-09人形机器人(上海)有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
人形机器人(上海)有限公司
Filing Date
2025-03-28
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In existing technologies, the parameter adjustment of robotic arm joint controllers is greatly affected by human factors, resulting in low control accuracy.

Method used

A trained temporal convolutional neural network is used to replace the robotic arm controller. The joint control commands are used as input parameters to calculate the torque of the first joint. When the torque of the first joint is outside the expected torque range, the neural network is adjusted to calculate a more accurate torque of the second joint, thereby controlling the robotic arm to perform the task.

Benefits of technology

It reduces the impact of human factors, improves the precision and efficiency of robotic arm control, and increases the probability of successful task execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119952725B_ABST
    Figure CN119952725B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a kind of mechanical arm joint control method and electronic equipment, belong to robot technical field.The method includes: obtaining joint control instruction and the expected torque interval corresponding to joint control instruction;With joint control instruction as the input parameter of trained time convolution neural network, first joint torque is obtained;In the case where first joint torque is located outside the expected torque interval, trained time convolution neural network is adjusted, and adjusted time convolution neural network is obtained;With joint control instruction as the input parameter of adjusted time convolution neural network, second joint torque is obtained;According to second joint torque, each joint of mechanical arm is controlled to execute task, and execution result is obtained.The method is used to reach the effect of improving the control precision of mechanical arm joint.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of robotics technology, and in particular to a method for controlling the joints of a robotic arm and an electronic device. Background Technology

[0002] Currently, with the development of robotics and artificial intelligence, the industry has higher requirements for robot control. As one of the main actuators for robots to complete tasks, how to achieve more precise control over the joints of the robotic arm has become a key research issue in the industry.

[0003] In existing technologies, proportional-derivative (PD) controllers convert received control commands into actual torque, thereby driving the joints of the robotic arm to move and complete the task. The PD controller adjusts the proportional and derivative gains to generate appropriate torque based on the given target action, ensuring that the joints of the robotic arm complete the task as expected. However, the parameters of the PD controller need to be manually tuned. This requires knowledgeable and experienced control engineers to manually adjust the controller parameters in a single controller system or multiple decoupled controller systems, using simple rules of thumb (such as the Ziegler-Nichols rule), to adapt to the real-world environment.

[0004] Therefore, the inventors discovered the following technical problem in the prior art: due to manual adjustment of the PD controller parameters, the adjustment process of the controller parameters 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] This application provides a robotic arm joint control method and electronic device to improve the control accuracy of robotic arm joints.

[0006] In a first aspect, embodiments of this application provide a method for controlling the joints of a robotic arm, including:

[0007] Obtain the joint control command and the expected torque range corresponding to the joint control command;

[0008] The joint control command is used as the input parameter of the trained temporal convolutional neural network to calculate the first joint torque;

[0009] When the torque of the first joint is outside the expected torque range, the trained temporal convolutional neural network is adjusted to obtain an adjusted temporal convolutional neural network.

[0010] The joint control command is used as the input parameter of the adjusted temporal convolutional neural network to calculate the second joint torque;

[0011] The robotic arm is controlled to perform tasks based on the torque of the second joint, and the execution results are obtained.

[0012] In one possible implementation, acquiring the joint control command and the expected torque range corresponding to the joint control command includes: acquiring the weight of the task object and the spatial degree of the task scene corresponding to the task currently being performed by the robotic arm; and determining the expected torque range corresponding to the joint control command based on the weight of the task object and the spatial degree of the task scene.

[0013] In one possible implementation, the upper limit of the expected torque range is positively correlated with the weight of the task object; the first span of the expected torque range is positively correlated with the spatial degree of the task scene; and the first span of the expected torque range is the difference between its upper and lower limits.

[0014] In one possible implementation, adjusting the temporal convolutional neural network to obtain an adjusted temporal convolutional neural network when the first joint torque is outside the expected torque range includes: acquiring a reference torque range corresponding to the robotic arm joint and a reference receptive field corresponding to the reference torque range; when the first joint torque is outside the expected torque range and the expected torque range and the reference torque range are not the same, acquiring a first span corresponding to the expected torque range and a second span corresponding to the reference torque range; the first span corresponding to the expected torque range is the difference between the upper and lower limits of the expected torque range; the second span corresponding to the reference torque range is the difference between the upper and lower limits of the reference torque range; using the ratio between the first span and the second span as a first adjustment ratio; determining the adjusted receptive field based on the first adjustment ratio and the reference receptive field; and determining the adjusted temporal convolutional neural network based on the adjusted receptive field.

[0015] In one possible implementation, adjusting the temporal convolutional neural network to obtain an adjusted temporal convolutional neural network when the first joint torque is outside the expected torque range includes: when the first joint torque is greater than the upper limit of the expected torque range, obtaining a first difference between the first joint torque and the lower limit of the expected torque range, and a second difference between the upper and lower limits of the expected torque range; using 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 based on the adjusted receptive field.

[0016] In one possible implementation, the temporal convolutional neural network comprises 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 layers are both 31-dimensional, and each one-dimensional causal convolutional hidden layer contains a convolutional 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-dimensional, and the output dimension is one-dimensional; the convolutional kernel size of the temporal convolutional network is 2, the dilation factor is [1,2,4], the padding method is zero padding, and the dropout ratio is 0.3.

[0017] In one possible implementation, the method further includes: acquiring joint motion data of each joint of the temporal convolutional neural network and the robotic arm, and dividing the joint motion data into a training set and a validation set according to a preset ratio; storing the joint motion data of the previous preset number of frames corresponding to each time node in a preset historical data buffer according to the order of time nodes for both the training set and the validation set; extracting the training set from the preset historical data buffer at each time node to train the temporal convolutional neural network, and extracting the validation set for validation, to obtain the trained temporal convolutional neural network.

[0018] In one possible implementation, adjusting the temporal convolutional neural network to obtain an adjusted temporal convolutional neural network when the first joint torque is outside the expected torque range includes: calculating the task complexity based on the upper limit of the expected torque range and the expected torque range; determining the adjusted receptive field based on 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 based on the adjusted receptive field.

[0019] In one possible implementation, calculating the task complexity based on the upper limit of the expected torque interval and the expected torque interval includes: determining the span of the expected torque interval; the span of the expected torque interval is the difference between its upper limit and lower limit; adding the span of the expected torque interval weighted based on a first factor and the upper limit of the expected torque interval weighted based on a second factor to obtain the task complexity; the first factor is less than the second factor.

[0020] Secondly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0021] The memory stores computer-executed instructions;

[0022] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0023] This application provides a robotic arm joint control method and electronic device. It utilizes a trained temporal convolutional neural network (TCNN) instead of a robotic arm controller, using joint control commands as input parameters to obtain a first joint torque. When the first joint torque falls outside the expected torque range, the trained TCNN is adjusted, and then the adjusted TCNN is used to calculate a more accurate second joint torque. Finally, the robotic arm's joints are controlled to perform tasks based on the second joint torque, yielding the execution result. The entire process requires no human intervention, reducing the impact of human factors and thus improving the accuracy of the robotic arm control execution result. The adjusted TCNN further enhances control precision. Attached Figure Description

[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0025] Figure 1 A schematic diagram of a scenario for a robotic arm joint control method provided in an embodiment of this application;

[0026] Figure 2 A flowchart illustrating a robotic arm joint control method provided in an embodiment of this application;

[0027] Figure 3 A flowchart illustrating the adjustment of a temporal convolutional neural network provided in another embodiment of this application. Figure 1 ;

[0028] Figure 4 A flowchart illustrating the adjustment of a temporal convolutional neural network provided in another embodiment of this application. Figure 2 ;

[0029] Figure 5 A schematic diagram of the model training process of a temporal convolutional neural network provided in another embodiment of this application;

[0030] Figure 6 This is a schematic diagram of the data acquisition process for joint motion data provided in an embodiment of this application;

[0031] Figure 7 A flowchart illustrating the adjustment of a temporal convolutional neural network provided in another embodiment of this application. Figure 3 ;

[0032] Figure 8 A schematic diagram of the structure of the electronic device provided in this application.

[0033] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0034] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0035] In existing technologies, using simulation environments, the parameters of the PD controller require extensive time and human experience to debug and optimize in order to improve the accuracy of the PD controller in controlling the robotic arm joints. This process typically involves continuous experimentation and adjustments to ensure that the robotic arm exhibits stable and efficient performance under different tasks. However, due to the difference between the simulation environment and the actual environment, the controller parameters debugged in the simulation sometimes fail to adapt to the real environment. This leads to a significant performance degradation of the PD controller when controlling the robotic arm joints in the actual environment after adjusting the PD controller parameters in the simulation, resulting in slow control progress.

[0036] To address the aforementioned technical problems, this application proposes the following technical concept: Utilizing a large amount of actual robotic arm joint motion data for training a neural network model, a model is established that can automatically calculate the required torque or other control quantities based on input control commands, directly driving the robotic arm joint motion, thereby avoiding the influence of human factors and improving the accuracy of robotic arm joint control.

[0037] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0038] Figure 1 This is a schematic diagram of a scenario for the robotic arm joint control method provided in the embodiments of this application, such as... Figure 1As shown, the application scenario includes a robot 101 and a target 102 to be grasped. The robot 101 is equipped with a server and a scanning device for collecting information about its surrounding environment. This scanning device can be a radar sensor or a depth camera. The robot 101's robotic arm acts as a task executor. In one embodiment, the robot 101's robotic arm may have seven joints, each corresponding to a different motor. The robotic arm joint control method provided in this application embodiment is used to determine the control parameters, such as torque, of the motors of the robotic arm joints 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 commands input by the user, ultimately enabling the robotic arm joints to complete the corresponding task more accurately.

[0039] It should be noted that, Figure 1 The application scenario of the robotic arm joint control method shown is only the grasping scenario. The robotic arm joint control method proposed in this embodiment can also be applied to other application scenarios such as handling, gripping and picking scenarios, etc., which are not limited here.

[0040] Figure 2 This is a flowchart illustrating the robotic arm joint control method provided in an embodiment of this application, as shown below. Figure 2 As shown, the method includes:

[0041] S201: Obtain the joint control command and the expected torque range corresponding to the joint control command.

[0042] In this embodiment, the joint control commands can be information collected by the robot that includes information related to the task to be executed, such as the target joint position, target joint angle, or information related to the target task object. The expected torque range can be a torque range indexed from the pre-stored correspondence between objects and torque ranges according to the relevant information of the target task object. The torque range in the correspondence can be pre-set or summarized based on historical task experience. For example, when the task object is a bottle, the expected torque range can be [40, 60] (unit: Newton-meter N·m).

[0043] S202: The joint control command is used as the input parameter of the trained temporal convolutional neural network to calculate the first joint torque.

[0044] In this embodiment, the trained Temporal Convolutional Neural Network (TCN) refers to a network that uses pre-collected motion data from the drive motors of actual robotic arm joints to capture the dynamic response and behavior of the motors under different operating conditions. Subsequently, this motion data and historical joint control commands related to robotic arm joint control are used as training data to train the TCN model, thus obtaining the trained TCN. The input parameters of the trained TCN are joint control commands and historical joint information, and the output is the joint torque required for the robotic arm joints to perform the task. For example, the aforementioned 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 this application, after the above input parameters are input into the temporal convolutional neural network, they are sequentially processed by causal convolution, dilated convolution, residual block, stacked residual block and output layer to finally obtain the output result.

[0046] S203: When the torque of the first joint is outside the expected torque range, the trained temporal convolutional neural network is adjusted to obtain the adjusted temporal convolutional neural network.

[0047] In this embodiment, the first joint torque is outside the expected torque range, meaning that if the output of the trained temporal convolutional neural network is used to control the robotic arm joints, the corresponding task cannot be completed. For example, if the first joint torque is 20 Nm and the expected torque range is 30 Nm to 50 Nm, controlling the robotic arm joints according to the first joint torque will not complete the task. In this case, the trained temporal convolutional neural network needs to be adjusted and optimized to improve the accuracy of its output. This adjustment can be achieved by retraining the network with training data obtained from different task scenarios and objects, or by directly adjusting the corresponding neural network parameters based on different task scenarios and objects. For example, this could involve increasing the receptive field, increasing the amount of historical joint information data, or increasing the dilation factor.

[0048] In an optional embodiment of this application, after step S202, the method further includes: if the first joint torque is within the expected torque range, then the robot arm is controlled to perform tasks based on the first joint torque to obtain the execution result.

[0049] S204: The joint control command is used as the input parameter of the adjusted temporal convolutional neural network to calculate the second joint torque.

[0050] In this embodiment, the principle for calculating the second joint torque is similar to that in step S202, and therefore will not be repeated. The difference lies in that the parameters of the adjusted temporal convolutional neural network are different from those of the trained temporal convolutional neural network. Furthermore, the output second joint torque is within the expected torque range.

[0051] S205: Control each joint of the robotic arm to perform the task based on the torque of the second joint, and obtain the execution result.

[0052] In this embodiment, the process of controlling each joint of the robotic arm to perform a task based on the second joint torque can be described as follows: the obtained second joint torque corresponding to each joint is converted into a control signal and then input into the motor corresponding to each joint of the robotic arm so that the robotic arm can complete the corresponding task. The execution result can be either task execution successful or execution failure.

[0053] In summary, the robotic arm joint control method provided in this application utilizes a trained temporal convolutional neural network (TCNN) instead of a robotic arm controller, using joint control commands as input parameters to obtain the first joint torque. When the first joint torque is outside the expected torque range, the trained TCNN is adjusted, and then the adjusted TCNN is used to calculate a more accurate second joint torque. Finally, the robotic arm's joints are controlled to perform tasks based on the second joint torque to obtain the execution result. The entire process requires no human intervention, reducing the impact of human factors and thus improving the accuracy of the robotic arm control execution result. Utilizing the adjusted TCNN can better improve control accuracy; furthermore, it makes the final calculated second joint torque more accurate, which is beneficial for increasing the probability of successful task execution.

[0054] Meanwhile, the adjusted temporal convolutional neural network is used to automatically calculate the second joint torque used to control the robotic arm joints, and the robotic arm joints are controlled to perform tasks based on the second joint torque, thereby improving control efficiency.

[0055] Based on the above Figure 2 Based on the corresponding embodiments, in an optional embodiment of this application, step S201 includes:

[0056] S201a: Obtain the weight of the task object and the spatial degree of the task scene corresponding to the task currently being performed by the robotic arm.

[0057] In this embodiment, obtaining the weight of the task object and the spatial degree of the task scene corresponding to the current task being performed by the robotic arm can be achieved by using the robot's scanning device to capture environmental information of the task object and calculating the spatial degree of the task scene based on relevant technologies. The weight of the task object can be obtained by weighing. The spatial degree of the task scene can be, for example, the volume of the robot's current working space, or the capacity of the current working space, or the length, width, and height of the current working space, or related parameters calculated based on at least one of the length, width, and height of the current working space. It can also include the width of the robotic arm's working space and the distance between the robotic arm and obstacles.

[0058] S201b: Determine the expected torque range corresponding to the joint control command based on the weight of the task object and the spatiality of the task scene.

[0059] In this embodiment, the implementation process of step S201b can be that the server first calculates the static torque based on the input task object and the weight of the task object through data processing software, calculates the spatial constraints of the current task scene space on each joint of the robotic arm based on the input task scene space degree, and selects to decrease or increase the torque according to the spatial constraints to obtain the expected torque range.

[0060] Based on the above embodiments, in an optional embodiment of this application, taking the robotic arm grasping packages between shelves as an example, suppose: the weight of the object being grasped is 5 kg, the width of the robotic arm's workspace in the task scenario is 0.6 meters, the distance between the robotic arm and obstacles is 0.1 meters, the three joints of the robotic arm are the shoulder, elbow, and wrist, and the effective lengths of the elbow joints are 0.5 meters, 0.4 meters, and 0.3 meters respectively. Then the calculation process of step S201 is as follows:

[0061] First, using the static torque calculation formula, the static torques of each joint of the robotic arm are obtained as follows: shoulder joint static torque = 82.32 Nm, elbow joint static torque = 34.3 Nm, and wrist joint static torque = 14.7 Nm. Then, based on the robotic arm's workspace width of 0.6 meters, the distance between the robotic arm and the obstacle of 0.3 meters, and the effective lengths of the elbow, elbow, and wrist joints of 0.5 meters, 0.4 meters, and 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 a smaller space compression coefficient indicates a narrower space. Then, based on the spatial compression coefficient, the task execution safety factor is adjusted to 1 + (1 - spatial compression coefficient) = 1.67. Finally, based on the task execution safety factor and 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 is [82.32 × 0.8, 82.32 × 1.67] = [65.9, 137.47], where 0.8 refers to the torque lower limit coefficient preset according to different task objects.

[0062] Based on the above embodiments, in an optional embodiment of this application, the upper limit of the expected torque range is positively correlated with the weight of the task object; the first span of the expected torque range is positively correlated with the spatial degree of the task scene; and the first span of the expected torque range is the difference between its upper limit and lower limit.

[0063] In this embodiment, the greater the weight of the task object, the larger the upper limit of the corresponding expected torque range can be, and vice versa. The first span of the expected torque range is used to represent the variable range of the expected torque of the robotic arm joint. For example, the smaller the spatial degree of the task scene, the smaller the variable range of the expected torque, and the smaller the first span of the corresponding expected torque range.

[0064] In this embodiment, the expected torque range is determined by using the quality of the task object and the spatial degree of the task scene. This avoids the problem that the expected torque range obtained is inaccurate due to different task objects or dynamic task scenes. It provides a more accurate judgment standard for the torque used to control the joints of the robotic arm, making the final calculated torque of the second joint more accurate and improving the probability of successful task execution.

[0065] Figure 3 A flowchart illustrating the adjustment of a temporal convolutional neural network provided in another embodiment of this application. Figure 1 .

[0066] like Figure 3 As shown above, Figure 2 Based on the corresponding embodiments, in an optional embodiment of this application, step S203 includes:

[0067] S203a: Obtain the reference torque range and the reference receptive field corresponding to the reference torque range of the robotic arm joint.

[0068] In this embodiment, the reference receptive field refers to the range of input data that the output node of a certain layer in a temporal convolutional neural network can input during its computation. Obtaining the reference receptive field can be achieved by indexing the receptive field corresponding to the reference torque range using a pre-saved correspondence between torque ranges and receptive fields. The reference torque range can be pre-defined, meaning that the robot arm's preferred torque range is determined after it leaves the factory. In some possible implementations, the reference torque range may be the same for simple tasks.

[0069] S203b: When the torque of the first joint is outside the expected torque range and the expected torque range and the reference torque range are different, obtain the first span corresponding to the expected torque range and the second span corresponding to the reference torque range respectively; the first span corresponding to the expected torque range is the difference between the upper limit and the lower limit of the expected torque range; the second span corresponding to the reference torque range is the difference between the upper limit and the lower limit of the reference torque range.

[0070] In this embodiment, the first joint torque is outside the expected torque range, and the expected torque range and the reference torque range are different, which also indicates 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: The ratio between the first span and the second span is used as the first adjustment ratio.

[0072] In this embodiment, the ratio between the first span and the second span can be calculated using calculation software, and this ratio can be used as the first adjustment ratio.

[0073] S203d: Determine the adjusted receptive field based on the first adjustment ratio and the reference receptive field.

[0074] In this embodiment, a smaller first adjustment ratio indicates that the first joint torque needs to be closer to the reference torque range, i.e., the adjustment is based on the reference torque range. This means that the task will be more difficult to complete compared to the torque execution within the expected torque range. Therefore, the reference receptive field corresponding to the reference torque range can be used to increase the receptive field, resulting in the adjusted receptive field.

[0075] S203e: Determine the adjusted temporal convolutional neural network based on the adjusted receptive field.

[0076] In this embodiment, based on the adjusted receptive field, the convolution kernels of each layer of the temporal convolutional neural network can be calculated using the formulas for calculating the receptive field, convolution kernel, and dilation factor. Then, the trained temporal convolutional neural network is updated using the convolution kernels and receptive field to obtain the adjusted temporal convolutional neural network.

[0077] In summary, the robotic arm joint control method provided in this 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, making the output result of the adjusted temporal convolutional neural network closer to the reference ideal torque range, thereby improving the accuracy of robotic arm joint control, making the final calculated second joint torque more accurate, and helping to increase the probability of successful task execution.

[0078] Figure 4 A flowchart illustrating the adjustment of a temporal convolutional neural network provided in another embodiment of this application. Figure 2 .

[0079] like Figure 4 As shown, in addition to the methods described above for adjusting the trained temporal convolutional neural network, the above-mentioned methods also include... Figure 2 Based on the corresponding embodiments, in an optional embodiment of this application, step S203 includes:

[0080] S203f: When the torque of the first joint is greater than the upper limit of the expected torque range, obtain the first difference between the torque of the first joint and the lower limit of the expected torque range, and the second difference between the upper limit and the lower limit of the expected torque range.

[0081] In this embodiment, if the torque of the first joint is greater than the upper limit of the expected torque range, it indicates that the output result of the trained temporal convolutional neural network is inaccurate. At this time, the problem of inaccurate calculation results of the trained temporal convolutional neural network can be corrected by adjusting the receptive field of the temporal convolutional neural network.

[0082] S203g: The ratio between the first difference and the second difference is used 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 this ratio can be 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 the adjusted receptive field.

[0085] In this embodiment, a smaller second adjustment ratio indicates that the first joint torque needs to move closer to the upper limit of the expected torque range, i.e., the adjustment is based on the upper limit of the expected torque range. This means that the task will be more difficult to complete compared to the torque execution within the expected torque range. Therefore, the receptive field can be increased according to the receptive field adjustment rule to obtain an adjusted receptive field, making the calculated second joint torque more accurate.

[0086] S203i: Determine the adjusted temporal convolutional neural network based on the adjusted receptive field.

[0087] In this embodiment, the adjustment principle of step S203i is similar to that of step S203e, so it will not be described again 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 can extract more time step data, thereby improving the accuracy of robotic arm joint control and making the final calculated second joint torque more accurate, which is conducive to increasing the probability of successful task execution.

[0089] Based on the above embodiments, in an optional embodiment of this application, 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-dimensional, and each one-dimensional causal convolutional hidden layer contains a convolutional 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-dimensional, and the output dimension is one-dimensional; the convolutional kernel size of the temporal convolutional network is 2, the dilation factor is [1,2,4], the padding method is zero padding, and the dropout ratio is 0.3.

[0090] In this embodiment, the temporal convolutional neural network processes time-series data through causal convolution, dilated convolution kernels, and residual connections. The input and output of the causal convolutional hidden layer are both 31-dimensional, designed to accommodate the 31-dimensional parameters input during training of the temporal convolutional neural network. The fully connected hidden layer has a 31-dimensional input and a 1-dimensional output, intended to map the output of the third causal convolutional hidden layer to 1 dimension, specifically the first joint torque.

[0091] The key hyperparameters for temporal convolutional neural networks can be preset before manual training. For example, the kernel size is set to 2, the dilation factor to [1, 2, 4], and the activation function for each layer is the commonly used ReLU function. Zero-padding means that the output size is equal to the input size divided by the stride; when the stride is 1, the output size remains unchanged. The padding size is calculated based on the kernel size and stride, typically symmetrically padded horizontally and vertically. Asymmetry may occur, for example, when the padding cannot be evenly distributed, adding an extra zero on the right or bottom.

[0092] Figure 5 This is a schematic diagram of the model training process of a temporal convolutional neural network provided in another embodiment of this application.

[0093] like Figure 5 As shown, based on any of the above embodiments, the robotic arm joint control method provided as an optional embodiment of this application further includes:

[0094] Step A: Obtain joint motion data of each joint of the temporal convolutional neural network and the robotic arm, and divide the joint motion data into training set and validation set according to a preset ratio.

[0095] In this embodiment, the temporal convolutional neural network can be a neural network capable of processing time-series data. The joint motion data of each joint of the robotic arm can be obtained through sensors pre-installed on the robot.

[0096] Figure 6 This is a schematic diagram of the data acquisition process for joint motion data provided in another embodiment of this application.

[0097] like Figure 6 As shown, based on any of the above embodiments, in an optional embodiment of this application, the data acquisition process for the joint motion data of each joint of the robotic arm is as follows:

[0098] First, multiple diverse trajectories are designed for the end effectors of each joint of the robotic arm. "Diverse" means that each trajectory does not overlap. Then, the target joint angle q for each joint of the robotic arm is calculated using inverse kinematics. ref The control torque τ is input to each joint actuator via the PD controller. cmd This drives the actuators of each joint (in this embodiment, the actuators can be motors) to move, while simultaneously collecting the actual joint angle qp and actual joint speed of each joint. Actual joint acceleration The data, along with the actual joint motor torque τ, is collected at a frequency of 500 Hz and stored as joint motion data for 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. This preset ratio can be pre-set; in this embodiment, the ratio of the test set to the training set 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 preset historical data buffer, in the order of time nodes for both the training set and the validation set.

[0100] In this embodiment, the previous preset number of frames can be a pre-set number of data frames, such as the ten frames prior to the current time t. The preset history buffer can be a 30-dimensional data storage area, such as a preset history buffer H∈R. 30 There are 30 dimensions in total, of which R 30 This represents a vector consisting of 30 real numbers, i.e., a 30-dimensional array of real numbers. For example, the joint motion data of the first ten frames are historical joint position information qp∈R10, historical joint velocity information, etc. Historical joint acceleration information That is, the joint motion data of the first ten frames in the corresponding preset history buffer.

[0101] Step C: At each time point, extract the training set from the preset historical data buffer to train the temporal convolutional neural network, and extract the validation set for validation to obtain the 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 represents the historical joint position information of the previous 10 frames at the current time. This provides historical joint velocity information for the previous 10 frames at the current moment. The system uses historical joint acceleration information from the previous 10 frames as input, where qtgt∈R1 represents the joint position of the target at the current moment. Input = (qp, H) is used to input the initial temporal convolutional neural network (TCNN). The TCNN's input Onput = τ is one-dimensional, where τ represents the torque output by the TCNN. Then, τ is compared with the actual torque τa in the joint motion data collected in real-time by sensors. The parameters of the TCNN are adjusted based on the comparison results until joint motion data from all time points are used for training, resulting in the TCNN to be validated.

[0103] Then, the joint motion data in the validation set is used to evaluate and adjust the temporal convolutional neural network to be validated, so as to optimize the key parameters in the temporal convolutional neural network to be validated, and finally obtain the trained temporal convolutional neural network. The process of using the validation set is similar to the principle of using the training set, so it will not be described in detail here.

[0104] In summary, the robotic arm joint control method provided in this application further trains and optimizes a temporal convolutional neural network using a large amount of joint motion data of each joint of the robotic arm collected in a real environment. Based on joint motion data-driven operation, the temporal convolutional neural network can automatically learn the complex nonlinear characteristics and dynamic changes of the robotic arm joint motion during training. Furthermore, the joint motion data of each joint of the robotic arm in a real environment reduces the gap between simulation and reality. The trained temporal convolutional neural network can better act as a robotic arm joint controller, outputting joint torques to each joint of the robotic arm and improving control accuracy. On the other hand, it makes the final calculated second joint torque more accurate, which is beneficial to increasing the probability of successful task execution.

[0105] Meanwhile, since the joint motion data in the training and validation sets originates from joint motion in real-world environments, the trained temporal convolutional neural network can more accurately reflect the real operating environment. This allows control strategies learned in the simulation environment to be transferred more smoothly to the real environment, reducing inconsistencies in control performance caused by differences between simulation and reality. Therefore, temporal convolutional neural networks driven by joint motion data from real-world environments have significant advantages in improving control accuracy and accelerating strategy transfer.

[0106] Figure 7 A flowchart illustrating the adjustment of a temporal convolutional neural network provided in another embodiment of this application. Figure 3 .

[0107] like Figure 7 As shown, based on any of the above embodiments, in an optional embodiment, step S203 may further include the following steps:

[0108] S203j: The task complexity is calculated based on the upper limit of the expected torque range and the expected torque range.

[0109] In this embodiment, the upper limit of the expected torque range and the task complexity can be positively correlated, and the span of the expected torque range and the task complexity can also be positively correlated. These two factors can be used to represent the correlation according to a pre-set ratio. If the correlation between the upper limit of the preset torque range and the task complexity is large, then the upper limit of the preset torque range will have a greater impact on the task complexity. The specific task complexity value can be calculated using pre-set code or a calculation tool. That is, by inputting the upper limit of its torque range and the expected torque range into the calculation tool, the task complexity value will be output.

[0110] In an optional embodiment of this application, step S203j specifically includes:

[0111] Step j1: Determine the span of the expected torque range; the span of the expected torque range is the difference between its upper and lower limits.

[0112] In this embodiment, the span of the expected torque period can be obtained by subtracting the upper limit and lower limit of the preset torque range.

[0113] Step j2: Add the span of the expected moment interval after weighting based on the first factor and the upper limit of the expected moment interval after weighting based on the second factor to obtain the task complexity; the first factor is less 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 torque range is [30, 80], then the task complexity = 0.2 × (80 - 30) + 0.8 × 80 = 74.

[0115] S203k: Determine the adjusted receptive field based on task complexity and preset mapping relationship; the preset mapping relationship records the mapping relationship between task complexity and corresponding receptive field.

[0116] In this embodiment, the preset mapping relationship can be a correspondence between task complexity and receptive field obtained through prior experimentation or based on historical data. These correspondences can 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 find the corresponding receptive field as the adjusted receptive field.

[0117] S203m: Determine the adjusted temporal convolutional neural network based on 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 described again here.

[0119] In summary, the robotic arm joint control method provided in this application further calculates the task complexity based on the upper limit of the expected torque range and the expected torque range, determines the adjusted receptive field based on the task complexity and the preset mapping relationship, and then adjusts the trained temporal convolutional neural network based on the adjusted receptive field. This results in the adjusted temporal convolutional neural network being able to handle robotic arm joint control tasks with different task complexities, thereby improving the control accuracy of robotic arm joints with different task complexities. On the other hand, it makes the final calculated second joint torque more accurate, which is beneficial to increasing the probability of successful task execution.

[0120] Simultaneously, the task complexity is calculated by weighting the first and second factors, which formalizes the calculation process and reduces the influence of human factors, further improving the accuracy of task complexity calculation. This provides a more precise receptive field for subsequent calculations, facilitating the adjustment of the temporal convolutional neural network. On the other hand, since the upper limit of the expected torque range is more correlated with task complexity, the second factor is greater than the first factor. This improves the accuracy of task complexity calculation, thereby increasing the accuracy of the receptive field. Consequently, the final calculated second joint torque is more accurate, which helps increase the probability of successful task execution.

[0121] Based on the above embodiments, in an optional embodiment of this application, when a robotic arm is applied to a completely new real environment, the adjusted temporal convolutional neural network can be trained a second time to obtain the latest temporal convolutional neural network. Of course, the amount of joint motion data used for the second training can be less than the amount of joint motion data in the above embodiments.

[0122] Figure 8 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, memory 802, and communication component 803 are connected via a bus.

[0123] In a specific implementation, at least one processor 801 executes computer execution instructions stored in memory 502, causing at least one processor 801 to perform the above-described method.

[0124] The specific implementation process of processor 801 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0125] This application also provides a humanoid robot, including a robot body, a camera mounted on the robot body, and electronic devices as described in the above embodiments disposed within the robot body.

[0126] In this embodiment, whether it is located on the robot body or inside the robot body, it can be achieved through hardware connection structures such as bolt connection, threaded connection, etc.

[0127] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the methods described in the above embodiments.

[0128] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the methods described in the above embodiments.

[0129] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0130] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0131] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0132] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0133] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0134] The aforementioned 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 storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0135] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from 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 reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0136] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0137] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0138] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0139] If a function is implemented as 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 this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0140] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0141] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for controlling the joints of a robotic arm, characterized in that, include: Obtain the joint control command and the expected torque range corresponding to the joint control command; The joint control command is used as the input parameter of the trained temporal convolutional neural network to calculate the first joint torque; When the torque of the first joint is outside the expected torque range, the trained temporal convolutional neural network is adjusted to obtain an adjusted temporal convolutional neural network. The joint control command is used as the input parameter of the adjusted temporal convolutional neural network to calculate the second joint torque; The robotic arm is controlled to perform tasks based on the torque of the second joint, and the execution results are obtained.

2. The robotic arm joint control method according to claim 1, characterized in that, The acquisition of joint control commands and the expected torque range corresponding to the joint control commands includes: Obtain the weight of the task object and the spatial degree of the task scene corresponding to the task currently being performed by the robotic arm; determine the expected torque range corresponding to the joint control command based on the weight of the task object and the spatial degree of the task scene.

3. The robotic arm joint control method according to claim 2, characterized in that, The upper limit of the expected torque range is positively correlated with the weight of the task object; the first span of the expected torque range is positively correlated with the spatial degree of the task scene; the first span of the expected torque range is the difference between its upper and lower limits.

4. The robotic arm joint control method according to claim 1, characterized in that, When the first joint torque is outside the expected torque range, adjusting the temporal convolutional neural network to obtain an adjusted temporal convolutional neural network includes: The reference torque range corresponding to the joint of the robotic arm and the reference receptive field corresponding to the reference torque range are obtained respectively; When the first joint torque is outside the expected torque range, and the expected torque range and the reference torque range are different, the first span corresponding to the expected torque range and the second span corresponding to the reference torque range are obtained respectively; the first span corresponding to the expected torque range is the difference between the upper limit and the lower limit of the expected torque range; the second span corresponding to the reference torque range is the difference between the upper limit and the lower limit of the reference torque range. The ratio between the first span and the second span is taken as the first adjustment ratio; The adjusted receptive field is determined based on the first adjustment ratio and the reference receptive field; Based on the adjusted receptive field, the adjusted temporal convolutional neural network is determined.

5. The robotic arm joint control method according to claim 1, characterized in that, When the first joint torque is outside the expected torque range, 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 range, the first difference between the first joint torque and the lower limit of the expected torque range, and the second difference between the upper limit and the lower limit of the expected torque range are obtained respectively. The ratio between the first difference and the second difference is used as the second adjustment ratio; The receptive field of the temporal convolutional neural network is adjusted according to the second adjustment ratio to obtain the adjusted receptive field; Based on the adjusted receptive field, the adjusted temporal convolutional neural network is determined.

6. The robotic arm joint control method according to any one of claims 1-5, characterized in that, The temporal convolutional neural network comprises 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-dimensional. The one-dimensional causal convolutional hidden layer contains a convolutional kernel, which is used to scan each time node to capture the relationship between different time nodes. The fully connected hidden layer has a 31-dimensional input and a 1-dimensional output. The temporal convolutional network has a kernel size of 2, an inflation factor of [1,2,4], zero padding, and a dropout ratio of 0.

3.

7. The robotic arm joint control method according to any one of claims 1-5, characterized in that, The method further includes: Acquire joint motion data of each joint of the temporal convolutional neural network and 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 validation set are both stored in the order of time nodes, with the joint motion data of the previous preset number of frames corresponding to each time node stored in the preset historical data buffer. At each time point, the training set is extracted from the preset historical data buffer to train the temporal convolutional neural network, and the validation set is extracted for validation to obtain the trained temporal convolutional neural network.

8. The robotic arm joint control method according to any one of claims 1-5, characterized in that, When the first joint torque is outside the expected torque range, adjusting the temporal convolutional neural network to obtain an adjusted temporal convolutional neural network includes: The task complexity is calculated based on the upper limit of the expected torque range and the expected torque range. The adjusted receptive field is determined based on the task complexity and the preset mapping relationship; the preset mapping relationship records the mapping relationship between the task complexity and the corresponding receptive field. Based on the adjusted receptive field, the adjusted temporal convolutional neural network is determined.

9. The robotic arm joint control method according to claim 8, characterized in that, The step of calculating the task complexity based on the upper limit of the expected torque range and the expected torque range includes: Determine the span of the expected torque range; the span of the expected torque range is the difference between its upper and lower limits. The task complexity is obtained by adding the span of the expected torque interval after weighting based on the first factor and the upper limit of the expected torque interval after weighting based on the second factor; the first factor is less than the second factor.

10. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the robotic arm joint control method as described in any one of claims 1 to 9.