Torque detection method of mechanical arm, electronic equipment and storage medium

By obtaining dynamic information of each joint of the robot arm and establishing an error compensation model, the problem of inaccurate torque prediction in the prior art is solved, and more accurate robot arm control is achieved.

CN119704257APending Publication Date: 2025-03-28SUZHOU PEITIAN ROBOT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411746832.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When predicting the torque of industrial robot motors, the prior art fails to effectively consider factors such as resonance formed by connecting rod bending, resulting in inaccurate torque prediction.

Method used

By obtaining the position, velocity and acceleration information of each joint of the robot arm, using the dynamic model to determine the torque to be optimized, and an error compensation model is established, and this information is input to obtain a more accurate target torque.

Benefits of technology

It improves the accuracy of torque prediction, provides more accurate control conditions, and enhances the control accuracy of the robotic arm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119704257A_ABST
    Figure CN119704257A_ABST
Patent Text Reader

Abstract

The invention discloses a torque detection method of a mechanical arm, electronic equipment and a storage medium, the mechanical arm comprises a plurality of joints connected in series, and the detection method comprises the steps that the position, the speed and the acceleration of each joint on the mechanical arm at the current moment are obtained, and the to-be-optimized torque of each joint is determined through a kinetic model; and taking the position, the speed, the acceleration and the to-be-optimized moment of each joint as the input of the error compensation model to obtain the target moment of each joint. According to the scheme, the accuracy of detecting the moment of the mechanical arm can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of robotics technology, and in particular to a torque detection method, electronic equipment and storage medium for a robotic arm. Background Art

[0002] Accurate torque prediction is a prerequisite for industrial robots to achieve precise control. The high-speed and high-precision motion requirements lead to high requirements for the control model. Generally, the uncertainties of robot dynamics systems are mainly divided into structural uncertainty and non-structural uncertainty. The error caused by parameters is a kind of structural uncertainty. Many other factors, such as nonlinear damping, friction model and noise, are non-structural uncertainty factors. It is very difficult to represent these non-structural uncertainty factors using physical dynamics models.

[0003] Existing methods can predict the motor torque by considering Coulomb friction and viscous friction through dynamic modeling. However, this friction model does not consider factors such as resonance caused by connecting rod bending, and the model parameters of the connecting rod will also have errors due to processing. Therefore, the torque estimated by dynamic modeling is inaccurate. Summary of the invention

[0004] The present application at least provides a torque detection method, electronic device and storage medium for a robotic arm.

[0005] The first aspect of the present application provides a torque detection method for a robotic arm, wherein the robotic arm includes a plurality of joints connected in series, and the detection method includes: obtaining the position, velocity, acceleration of each joint on the robotic arm at the current moment and the torque to be optimized of each joint determined by using a dynamic model; using the position, velocity, acceleration and torque to be optimized of each joint as input of an error compensation model to obtain a target torque of each joint.

[0006] A second aspect of the present application provides an electronic device, which includes a memory and a processor coupled to each other, and the processor is used to execute program instructions stored in the memory to implement the torque detection method of the robotic arm in the first aspect above.

[0007] A third aspect of the present application provides a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implements the torque detection method of the robotic arm in the first aspect.

[0008] The beneficial effect of the present application is: different from the prior art, the present application establishes an error compensation model, so that after obtaining the torque output by the dynamic model, by collecting information such as the position, speed and acceleration of each joint on the robotic arm at the current moment as the input of the error compensation model, the torque after error compensation can be obtained. The torque after error compensation is more accurate than the torque output by the dynamic model, thereby facilitating subsequent more precise control of the robotic arm.

[0009] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0011] Figure 1 It is a first flow chart of an embodiment of a torque detection method for a mechanical arm of the present application;

[0012] Figure 2 It is a second flow diagram of an embodiment of a torque detection method for a robotic arm of the present application;

[0013] Figure 3 It is a schematic diagram of the framework of an embodiment of the torque detection device of the present application;

[0014] Figure 4 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;

[0015] Figure 5 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0016] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0017] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0018] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.

[0019] In the present application, the execution subject for implementing the torque detection method of the mechanical arm described in the present application may be a torque detection device, an electronic device, etc. For example, the torque detection device may be provided in an electronic device or a server or other processing device, wherein the electronic device may be a numerical control device, a user equipment (UE), a handheld device, a computing device, a vehicle-mounted device, etc. In some possible implementations, the torque detection method of the mechanical arm may be implemented by a processor calling a computer-readable instruction stored in a memory.

[0020] See also Figure 1 , Figure 1 This is a schematic diagram of the first process of an embodiment of a torque detection method for a mechanical arm of the present application. Specifically, it may include the following steps:

[0021] Step S11: Obtain the position, velocity, acceleration of each joint on the robotic arm at the current moment and the torque to be optimized of each joint determined by using a dynamic model.

[0022] Among them, the robotic arm includes a plurality of joints connected in series. The plurality may be one or more. The series connection may specifically be end-to-end connection. Exemplarily, the robotic arm may include 6 joints connected end-to-end. The position of the joint may be the position of a preset key point on the joint. Exemplarily, a coordinate system may be established in advance, and the position of the key point may be the position under the coordinate system. In other embodiments, the position of the joint may also include the curvature of the joint. For example, a certain direction of the robotic arm is used as a reference direction. If the joint coincides with the reference direction, the curvature is 0 degrees. The curvature is determined according to the angle between the reference direction and the joint. Specifically, the curvature may be determined according to the angle between the extension direction of the joint and the reference direction.

[0023] The modeling methods of the dynamic model may include the Newton-Euler method and the Lagrange method. The method of using the dynamic model to determine the torque to be optimized for each joint can refer to formula (1):

[0024]

[0025] Among them, τ is the torque to be optimized, D(q) represents the n×n mass matrix of the joint, are the n×1 centrifugal force and Coriolis force vectors, G(q) is the n×1 gravity vector, Indicates the acceleration of the joint at the current moment, represents the velocity of the joint at the current moment, and q represents the position of the joint at the current moment.

[0026] In other embodiments, the modeling method of the dynamic model is different, and the specific formula for calculating the torque to be optimized is also different. The dynamic model here is only an example and is not used to limit the method of obtaining the torque to be optimized in this application.

[0027] Step S12: The position, velocity, acceleration and torque to be optimized of each joint are used as inputs of the error compensation model to obtain the target torque of each joint.

[0028] The error compensation model can be a neural network, for example, it can be constructed using the TensorFlow2 deep learning framework. There are many types of neural networks, and as long as it can achieve compensation for the torque to be optimized, the specific type of neural network is not limited. In this solution, the error compensation model essentially estimates the error between the torque to be optimized and the true torque, thereby achieving error compensation for the torque to be optimized. In this way, the target torque of each joint output by the error compensation model can be closer to the true torque relative to each torque to be optimized, thereby facilitating the subsequent more precise control of the robotic arm according to the target torque of each joint.

[0029] In the above scheme, an error compensation model is established, so that after obtaining the torque output by the dynamic model, the position, velocity, acceleration and other information of each joint on the robotic arm at the current moment are collected as the input of the error compensation model, so that the torque after error compensation can be obtained. The torque after error compensation is more accurate than the torque output by the dynamic model, thereby facilitating subsequent more precise control of the robotic arm.

[0030] In some embodiments, the position of each joint includes the current arc of each joint. The above step S11 may include the following steps:

[0031] The current curvature of each joint is filtered to obtain the filtered current curvature of each joint.

[0032] Considering that the speed and acceleration of the joint are calculated by using the position data, since there is a certain degree of noise in the feedback position of the joint sensor, this has a great impact on the calculated speed and acceleration. Therefore, in order to obtain smoother speed and acceleration, the position can be filtered first. The specific filtering method can be a third-order Butterworth low-pass filter or other filtering methods.

[0033] For each joint, the velocity and acceleration of each joint at the current moment are determined based on the filtered current arc, the arc of the joint at the previous moment, and the sampling frequency per unit time. The sampling frequency is the frequency of obtaining the position of each joint at different moments per unit time. The specific method for calculating the velocity of each joint can refer to formula (2), and the method for calculating the acceleration of each joint can refer to formula (3).

[0034]

[0035] As mentioned above, the robot arm may include several joints. In this embodiment, the number of joints is 6 as an example. ij (i=1,2,…,5,6) is the instantaneous velocity of joint i at the current moment j, p ij is the joint arc at the current moment, p i(j-1) is the joint arc at the previous moment, a ij is the instantaneous acceleration of the joint at the current moment, and f is the sampling frequency. For example, if the sampling frequency of the robot is 1000 Hz, 1000 data can be collected every 1 second.

[0036] Finally, we can obtain 24 parameters, p, v, a, and m, of the six joints in the robotic arm as input items for the subsequent training of the error compensation model.

[0037] In some embodiments, the error compensation model includes an input layer, a preset number of fully connected layers with Dropout, and an output layer. The input layer includes several types of input nodes, each of which is used to input the position, velocity, acceleration, and torque to be optimized of each joint, and different types of input nodes are used to input different data. The output layer includes several output nodes, and different output nodes are used to output target torques of different joints.

[0038] Nodes can be considered as neurons. Exemplarily, the number of layers of the fully connected layer is 3 layers or other number layers. Each fully connected layer with random dropout can include 128 neurons, and other embodiments can also include other numbers of neurons. The number of neurons in the input layer is the same as the number of input data, for example, the number of neurons in the input layer is 24, for example, the number of joints of the robotic arm is 6, the number of the first input nodes, the number of the second input nodes, the number of the third input nodes, and the number of the fourth input nodes can be at least 6, and 6 of the first input nodes can be used to input the position of each joint at the current moment, 6 of the second input nodes can be used to input the speed of each joint at the current moment, 6 of the third input nodes can be used to input the acceleration of each joint at the current moment, and 6 of the fourth input nodes can be used to input the torque to be optimized for each joint. The number of output nodes of the output layer is the same as the number of joints, for example, if the number of joints is 6, the number of output nodes of the output layer is 6. Optionally, the activation function used is the traditional ReLU activation function, and the Dropout parameter is 0.2.

[0039] In some embodiments, the torque detection method may further include a step of training an error compensation model. Figure 2 , Figure 2 This is a second flow diagram of an embodiment of a torque detection method for a robotic arm of the present application. Specific training steps may include:

[0040] Step S21: in at least two different motion trajectories of the reference robot arm, respectively obtain sample data and torque labels of each joint at different times.

[0041] The reference manipulator has the same structure as the manipulator, and the sample data includes position samples, velocity samples, acceleration samples, and torque samples to be optimized. The reference manipulator has the same structure as the manipulator, that is, there are 6 joints in the manipulator, so the reference manipulator for data collection in the error compensation model also has 6 joints, and the distance between the joints in the reference manipulator is the same as the distance between the joints in the manipulator, or the manipulator can be directly used as the reference manipulator. The specific method of obtaining the torque label can be to obtain the actual torque of each joint on the manipulator as a label through a torque sensor or ammeter on the manipulator joint.

[0042] In some embodiments, the motion trajectory includes a motion trajectory generated based on the joint motion instruction and a Fourier trajectory, wherein there are multiple Fourier trajectories, and the initial joint position of each joint point in each Fourier trajectory is arranged in a preset manner.

[0043] The way in which the initial joint positions are arranged in a preset manner may be an arithmetic arrangement, or the difference between the initial joint positions of each joint point in each Fourier trajectory may be arranged in a power function or exponential function, or in other embodiments, the initial joint positions of each joint point in each Fourier trajectory may also be randomly arranged. The motion trajectory generated based on the joint motion instruction may be considered as a Move-j trajectory. The Move-j trajectory may generate the path by inputting the starting point and the end point. For its specific generation method, please refer to the motion control manual. Since the final robot arm uses the Move-j path in the working state, it is very necessary to collect the motion data of the reference robot arm under the path as a training set for training the model. By using a series of randomly generated starting points and end points, the reference robot arm can generate a data set within a limited range. At the same time, the cold / hot machine condition of the robot arm needs to be considered when collecting data. Its dynamic model will be quite different in different situations. This is mainly due to the change in the friction factor caused by the change in the performance of the lubricant. This solution can use cold machine data as training data. The specific collection method is to run a random path (about 3-7 seconds), stop and cool for 10 minutes, and then move the controller. This can ensure that the robot arm is always in a cold machine working state.

[0044] Considering the use of artificial neural networks for dynamic identification of robot systems, the input trajectory needs to be representative enough and contain as much characteristic information of the robot as possible. In addition, the impact of the noise of the actual measured torque on model identification must also be considered. The Fourier trajectory has good time domain data averaging and can contain noise characteristics to the maximum extent, which can provide sufficient information for model training. The Fourier trajectory used in this solution can be a finite Fourier series trajectory:

[0045]

[0046] Where θ(t) is the joint position at time t, θ0 is the initial joint position, N is the number of Fourier terms (3 to 5), ω is the fundamental frequency, and a j and b j They represent the corresponding Fourier series respectively.

[0047] In addition, it is necessary to limit the range of motion of the joints when generating the path to ensure that it is within a safe range, that is, each parameter needs to satisfy formula (5):

[0048]

[0049] θ i (t) is the joint position at time t, represents the speed at time t, Represents the acceleration at time t. The rotation arc of the joint needs to be between the maximum arc and the minimum arc, and the speed and acceleration need to be less than the maximum speed or less than the maximum acceleration.

[0050] The method of obtaining the sample data and torque labels of each joint at different times in at least two different motion trajectories of the reference robot arm may be: controlling the reference robot arm to move at least one cycle according to each motion trajectory. Then, obtaining the sample data and torque labels of each joint at different times within the motion cycle of the reference robot arm.

[0051] For example, the generated Fourier trajectories may be 150 Fourier trajectories of the initial joint positions arranged in equal intervals, with the parameters Each trajectory runs for one cycle, that is, 10 seconds, to capture all the motion areas of the robot arm as much as possible.

[0052] Optionally, before executing step S22, the following steps may also be performed:

[0053] Preprocess the collected data. Since the collected data is generated according to each path, there are multiple independent path data files. Divide the collected data files into two, for example, one is placed in the train_data folder as training data, and the other is placed in the val_data folder as test data, with a ratio of 80% and 20% respectively. Then merge the data sets in each folder to generate two files for training.

[0054] The torque detection method may further include the following steps:

[0055] The sample data and torque labels of each joint at different times are displayed on the display interface. Then, in response to receiving an adjustment instruction for the displayed data, an adjustment operation is performed on the displayed sample data or torque labels of each joint at different times based on the adjustment instruction, and the adjustment operation includes changing the display position, changing the displayed value and / or deleting the displayed sample data or torque labels.

[0056] Exemplarily, you can choose to delete one or more sample data, or you can also choose to delete one or more torque labels. In some application scenarios, the displayed data can be changed, deleted, or the display mode can be adjusted. The display mode can be the display size, display position, etc. After generating the file used in training, the generated data can be visualized to ensure that the generated data is not missing, misplaced, etc. At the same time, the visual display can also help users better understand the collected and processed data. After display, the user can change, delete, or add sample data to the file for the position samples, velocity samples, acceleration samples, and torque samples to be optimized collected at each moment in the file.

[0057] Step S22: taking each sample data as the input of the error compensation model to obtain sample target torque data corresponding to each sample data.

[0058] The sample data may be normalized first, and then each normalized sample data is used as an input of the error compensation model to obtain sample target torque data corresponding to each sample data.

[0059] For example, before starting training, the training data is loaded from the file generated by data preprocessing. After the data loading is completed, the data set needs to be split into input and output, and then normalized to ensure the efficiency of gradient descent.

[0060] Step S23: For each sample data, determine the difference between the sample target torque data and the torque label.

[0061] Exemplarily, each sample target torque data has a corresponding torque label, and the accuracy of the error compensation model can be determined by the difference between the two. In some application scenarios, the difference between the sample target torque data and the torque label can be obtained as the difference.

[0062] Step S24: adjusting parameters in the error compensation model based on the differences.

[0063] In some embodiments, the above step S23 may include the following steps: determining a mean square error loss according to each difference, and then adjusting parameters in the error compensation model according to the mean square error loss.

[0064] For example, the batch size of the data set for each training is set to 32, the number of training times is set to 300, the adam optimizer is used, and the loss function uses MSE. This is mainly to better predict numerical data. The batch size here can be considered as the number of sample data used for each training. The batch size of the data set for each training is set to 32, and the number of training times is set to 300. It can be understood that 32 sample data are used each time to train the error compensation model, and the total number of training times can be 300 times. After a period of training, the model of this training will be saved, and the entire training ends here. The trained model can be used for error compensation. Please refer to Table 1, which shows the torque accuracy of this scheme and the output of the dynamic model, as well as the accuracy of the torque output by the dynamic model.

[0065] Table 1: Comparison of the accuracy of this solution and the kinetic model

[0066]

[0067] As shown in Table 1 , the accuracy of torque prediction of this scheme on joints 1 to 6 is higher than that of the dynamic model on joints 1 to 6.

[0068] The above scheme establishes an error compensation model so that after obtaining the torque output by the dynamic model, the position, velocity, acceleration and other information of each joint on the robotic arm at the current moment are collected as the input of the error compensation model, so as to obtain the torque after error compensation. The torque after error compensation is more accurate than the torque output by the dynamic model, thereby facilitating subsequent more precise control of the robotic arm.

[0069] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0070] See also Figure 3 , Figure 3 It is a schematic diagram of the framework of an embodiment of the torque detection device of the present application. The mechanical arm includes a plurality of joints connected in series. The torque detection device 30 includes: a data acquisition module 31 and an error compensation module 32. The data acquisition module 31 is used to obtain the position, velocity, acceleration of each joint on the mechanical arm at the current moment and the torque to be optimized of each joint determined by the dynamic model; the error compensation module 32 is used to use the position, velocity, acceleration and torque to be optimized of each joint as the input of the error compensation model to obtain the target torque of each joint.

[0071] In the above scheme, an error compensation model is established, so that after obtaining the torque output by the dynamic model, the position, velocity, acceleration and other information of each joint on the robotic arm at the current moment are collected as the input of the error compensation model, so that the torque after error compensation can be obtained. The torque after error compensation is more accurate than the torque output by the dynamic model, thereby facilitating subsequent more precise control of the robotic arm.

[0072] In some embodiments, the error compensation model includes an input layer, a preset number of fully connected layers with random dropout, and an output layer. The input layer includes several types of input nodes, each of which is used to input the position, velocity, acceleration, and torque to be optimized of each joint, and different types of input nodes are used to input different data. The output layer includes several output nodes, and different output nodes are used to output target torques of different joints.

[0073] In some embodiments, the position of each joint includes the current arc of each joint, and the data acquisition module 31 acquires the position, velocity, and acceleration of each joint on the robotic arm, including:

[0074] Filter the current curvature of each joint to obtain the filtered current curvature of each joint;

[0075] For each joint, the velocity and acceleration of each joint at the current moment are determined based on the filtered current arc, the arc of the joint at the previous moment, and the sampling frequency per unit time. The sampling frequency is the frequency of obtaining the position of each joint at different moments per unit time.

[0076] In some embodiments, the torque detection device 30 further includes a training module (not shown), which is used to perform the training steps for the error compensation model:

[0077] In at least two different motion trajectories of the reference manipulator, sample data and torque labels of each joint at different times are obtained respectively, the structure of the reference manipulator is the same as that of the manipulator, and the sample data includes position samples, velocity samples, acceleration samples, and torque samples to be optimized;

[0078] Taking each sample data as the input of the error compensation model, the torque data corresponding to each sample data is obtained;

[0079] For each sample data, determining the difference between the sample target moment data and the moment label;

[0080] Parameters in the error compensation model are adjusted based on the differences.

[0081] In some embodiments, the motion trajectory includes a motion trajectory generated based on a joint motion instruction and a Fourier trajectory, wherein there are multiple Fourier trajectories, and the initial joint position of each joint point in each Fourier trajectory is arranged in a preset manner. The training module obtains sample data and torque labels of each joint at different times in at least two different motion trajectories of the reference robot arm, including:

[0082] Controlling the reference robot arm to move at least one cycle according to each motion trajectory;

[0083] During the motion cycle of the reference robot, sample data and torque labels of each joint at different times are obtained.

[0084] In some embodiments, adjusting parameters in the error compensation model based on the differences includes:

[0085] Based on each difference, determine the mean square error loss;

[0086] According to the mean square error loss, the parameters in the error compensation model are adjusted.

[0087] In some embodiments, each sample data is used as an input of the error compensation model to obtain sample target torque data corresponding to each sample data, including:

[0088] Normalize each sample data;

[0089] Each sample data after normalization is used as the input of the error compensation model to obtain the torque data corresponding to each sample data.

[0090] In some embodiments, the torque detection device 30 further includes a display module (not shown), which is used to perform the following steps:

[0091] Display the sample data and torque labels of each joint at different times on the display interface;

[0092] In response to receiving an adjustment instruction for the displayed data, an adjustment operation is performed on the sample data or torque labels of each joint displayed at different times based on the adjustment instruction, and the adjustment operation includes changing the display position, changing the displayed value and / or deleting the displayed sample data or torque label.

[0093] See also Figure 4 , Figure 4: is a schematic diagram of a framework of an embodiment of an electronic device of the present application. The electronic device 40 includes a memory 41 and a processor 42 coupled to each other, and the processor 42 is used to execute program instructions stored in the memory 41 to implement the steps of any of the above-mentioned torque detection method embodiments of the mechanical arm. In a specific implementation scenario, the electronic device 40 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 40 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.

[0094] Specifically, the processor 42 is used to control itself and the memory 41 to implement the steps of the torque detection method embodiment of any of the above-mentioned mechanical arms. The processor 42 can also be called a CPU (Central Processing Unit). The processor 42 may be an integrated circuit chip with signal processing capabilities. The processor 42 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 42 can be implemented by an integrated circuit chip.

[0095] The above scheme establishes an error compensation model so that after obtaining the torque output by the dynamic model, the position, velocity, acceleration and other information of each joint on the robotic arm at the current moment are collected as the input of the error compensation model, so as to obtain the torque after error compensation. The torque after error compensation is more accurate than the torque output by the dynamic model, thereby facilitating subsequent more precise control of the robotic arm.

[0096] See also Figure 5 , Figure 5 The computer-readable storage medium 50 stores program instructions 501 that can be executed by a processor, and the program instructions 501 are used to implement the steps of any of the above-mentioned torque detection method embodiments of the mechanical arm.

[0097] The above scheme establishes an error compensation model so that after obtaining the torque output by the dynamic model, the position, velocity, acceleration and other information of each joint on the robotic arm at the current moment are collected as the input of the error compensation model, so as to obtain the torque after error compensation. The torque after error compensation is more accurate than the torque output by the dynamic model, thereby facilitating subsequent more precise control of the robotic arm.

[0098] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0099] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0100] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as 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 through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0101] In addition, each functional unit in each embodiment of the present application 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0102] If the integrated unit 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 application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. 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 and other media that can store program code.

Claims

1. A torque detection method for a robotic arm, characterized in that: The robot arm includes a plurality of joints connected in series, and the detection method includes: Obtaining the position, velocity, acceleration of each joint on the robotic arm at the current moment and the torque to be optimized of each joint determined by using a dynamic model; The position, velocity, acceleration and torque to be optimized of each joint are used as inputs of the error compensation model to obtain the target torque of each joint.

2. The method according to claim 1, characterized in that The error compensation model includes an input layer, a preset number of fully connected layers with Dropout, and an output layer. The input layer includes several types of input nodes, each of which is used to input one of the position, velocity, acceleration, and torque to be optimized of each joint, and different types of input nodes are used to input different data. The output layer includes several output nodes, and different output nodes are used to output target torques of different joints.

3. The method according to claim 1, characterized in that The position of each joint includes the current arc of each joint, and obtaining the position, velocity, acceleration of each joint on the robotic arm at the current moment and the torque to be optimized of each joint determined by using a dynamic model includes: Filtering the current curvature of each joint to obtain the filtered current curvature of each joint; For each of the joints, the speed and acceleration of each joint at the current moment are determined based on the filtered current arc, the arc of the joint at the previous moment and the sampling frequency per unit time. The sampling frequency is the frequency of obtaining the position of each joint at different moments per unit time.

4. The method according to claim 2, characterized in that: The method also includes a step of training the error compensation model: In at least two different motion trajectories of a reference robotic arm, sample data and torque labels of each joint at different times are respectively obtained, wherein the reference robotic arm has the same structure as the robotic arm, and the sample data includes position samples, velocity samples, acceleration samples, and torque samples to be optimized; Using each of the sample data as an input of the error compensation model to obtain sample target torque data corresponding to each of the sample data; For each of the sample data, determining the difference between the sample target torque data and the torque label; Parameters in the error compensation model are adjusted based on each of the differences.

5. The method according to claim 4, characterized in that The motion trajectory includes a motion trajectory and a Fourier trajectory generated based on a joint motion instruction, wherein the Fourier trajectory is a plurality of trajectory, and the initial joint position of each joint point in each Fourier trajectory is arranged in a preset manner, and in at least two different motion trajectories of the reference robot arm, sample data and torque labels of each joint at different times are obtained respectively, including: Controlling the reference robot arm to move at least one cycle according to each motion trajectory; During the motion cycle of the reference robot arm, sample data and torque labels of each joint at different times are obtained.

6. The method according to claim 4, characterized in that The adjusting the parameters in the error compensation model based on the differences comprises: Determining a mean square error loss based on each of the differences; According to the mean square error loss, parameters in the error compensation model are adjusted.

7. The method according to claim 4, characterized in that The step of using each of the sample data as the input of the error compensation model to obtain sample target torque data corresponding to each of the sample data includes: Normalizing each of the sample data; Each normalized sample data is used as the input of the error compensation model to obtain sample target torque data corresponding to each sample data.

8. The method according to any one of claims 4 to 7, characterized in that The method further comprises: Display the sample data and torque labels of each joint at different times on the display interface; In response to receiving an adjustment instruction for the displayed data, an adjustment operation is performed on the sample data or torque labels of each joint displayed at different times based on the adjustment instruction, and the adjustment operation includes changing the display position, changing the displayed value and / or deleting the displayed sample data or torque label.

9. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the torque detection method of the robotic arm as described in any one of claims 1 to 8.

10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the torque detection method for a robotic arm according to any one of claims 1 to 8 is implemented.