Control method and device of mechanical arm, electronic equipment and computer storage medium
By combining feedforward and world model control methods, the technical problems of the robotic arm were quickly identified and solved, improving the control accuracy and efficiency of the robotic arm. This solved the problem of low control accuracy and efficiency of robotic arms in existing technologies, and achieved more efficient robotic arm control.
Patent Information
- Application Number
- CN202510115068.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-01-23
AI Technical Summary
The low control precision and efficiency of existing robotic arms are mainly due to the poor adaptability of excavators to complex working conditions and the long debugging time of PID feedback controllers.
A control method combining a feedforward model and a world model is adopted. By acquiring the angle and velocity information of the target tracking trajectory point of the robotic arm, the feedforward model is used to predict the control signal quantity, and sampling is performed within the sampling range to find the optimal control signal quantity. The world model is then combined to predict the next trajectory point and determine the control signal quantity that is closest to the target trajectory.
It improves the control precision and efficiency of the robotic arm, reduces the adaptation time to complex working conditions, and enhances the rapid response capability of the control system.
Smart Images

Figure CN120006793B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of mechanical arm control, and in particular to a mechanical arm control method and device, electronic equipment and a computer readable storage medium. BACKGROUND
[0002] In order to realize the functions of automatic operation of excavators or remote control of the end, accurate path and speed control of the excavator arm joints are required.
[0003] In related technologies, the control system of the mechanical arm needs to accurately model the excavator. Then, on the basis of accurate modeling, a PID feedback control is used to realize the trajectory controller of the excavator arm joints.
[0004] However, since accurate kinematic modeling of the excavator is challenging, and the debugging of the PID feedback controller requires experienced operators to spend a long time to correct, a set of control parameters is difficult to adapt to various complex working conditions faced by the excavator, resulting in low control accuracy and efficiency of the excavator mechanical arm. SUMMARY
[0005] The present application provides a mechanical arm control method, device, electronic equipment and computer readable storage medium to solve the problem of low control accuracy and efficiency of the mechanical arm in the prior art.
[0006] In a first aspect, an embodiment of the present application provides a mechanical arm control method, which comprises:
[0007] Obtaining a target tracking trajectory of a mechanical arm, the target tracking trajectory comprising N tracking trajectory points, the tracking trajectory points comprising angle information and angular velocity information of each joint of the mechanical arm;
[0008] For the i-th tracking trajectory point in the N tracking trajectory points, a first step is sequentially executed to obtain a target control signal quantity corresponding to each joint in the i-th tracking trajectory point, the target control signal quantity corresponding to each joint in the i-th tracking trajectory point being used to control each joint of the mechanical arm when tracking the i-th tracking trajectory point, i being greater than or equal to 1 and less than or equal to N;
[0009] The first step comprises:
[0010] Inputting the angle information and angular velocity information of each joint in the i-th tracking trajectory point into a feedforward model to obtain a predicted control signal quantity of each joint output by the feedforward model;
[0011] Determine a control signal quantity sampling range corresponding to each joint with reference to the predicted control signal quantity of each joint, and sample in the control signal quantity sampling range to obtain a plurality of candidate control signal quantities corresponding to each joint;
[0012] Determine a plurality of candidate predicted trajectory points according to the angle information and angular velocity information of each joint in the i th tracking trajectory point and the plurality of candidate control signal quantities corresponding to each joint;
[0013] For each predicted trajectory point, predict N-i trajectory points after the predicted trajectory point based on a world model to obtain a predicted trajectory corresponding to the predicted trajectory point, the predicted trajectory including N-i+1 predicted trajectory points, and the world model being used to predict the angle, angular velocity and control signal quantity of each joint in the robot arm at the next trajectory point;
[0014] From the predicted trajectory corresponding to each predicted trajectory point, determine a target predicted trajectory closest to a target trajectory segment to determine the control signal quantity of each joint in the first trajectory point in the target predicted trajectory as the target control signal quantity corresponding to each joint in the i th tracking trajectory point, the target trajectory segment being a trajectory composed of the i th tracking trajectory point to the N th tracking trajectory point in the target tracking trajectory.
[0015] In a second aspect, an embodiment of the present application provides a control device of a robot arm, the device comprising:
[0016] An acquisition module configured to acquire a target tracking trajectory of a robot arm, the target tracking trajectory including N tracking trajectory points, and each tracking trajectory point including angle information and angular velocity information of each joint on the robot arm;
[0017] A processing module configured to, for an i th tracking trajectory point in the N tracking trajectory points, sequentially perform a first step to obtain a target control signal quantity corresponding to each joint in the i th tracking trajectory point, the target control signal quantity corresponding to each joint in the i th tracking trajectory point being used to control each joint of the robot arm when tracking the i th tracking trajectory point, the i being greater than or equal to 1 and less than or equal to N;
[0018] The first step includes:
[0019] Input the angle information and angular velocity information of each joint in the i th tracking trajectory point into a feedforward model to obtain a predicted control signal quantity of each joint output by the feedforward model;
[0020] Determine a control signal amount sampling range corresponding to each joint with reference to the predicted control signal amount of each joint, and sample in the control signal amount sampling range to obtain a plurality of candidate control signal amounts corresponding to each joint;
[0021] Determine a plurality of candidate predicted trajectory points according to the angle information and angular velocity information of each joint in the i th tracking trajectory point and the plurality of candidate control signal amounts corresponding to each joint, the predicted trajectory point including the angle information and angular velocity information of each joint in the i th tracking trajectory point and a candidate control signal amount;
[0022] For each predicted trajectory point, predict N-i trajectory points after the predicted trajectory point based on a world model to obtain a predicted trajectory corresponding to the predicted trajectory point, the predicted trajectory including N-i+1 predicted trajectory points, the world model being used to predict the angle, angular velocity and control signal amount of each joint in the next trajectory point in the robot arm;
[0023] From the predicted trajectory corresponding to each predicted trajectory point, determine a target predicted trajectory closest to a target trajectory segment to determine the control signal amount of each joint in the first trajectory point in the target predicted trajectory as the target control signal amount corresponding to each joint in the i th tracking trajectory point in the target tracking trajectory, the target trajectory segment being a trajectory composed of the i th tracking trajectory point to the N th tracking trajectory point in the target tracking trajectory.
[0024] In a third aspect, an electronic device is provided, and the electronic device includes:
[0025] a memory and a processor, the memory and the processor being coupled;
[0026] the memory is configured to store one or more computer instructions;
[0027] the processor is configured to execute the one or more computer instructions to implement the control method of the robot arm according to any one of the first aspect.
[0028] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores one or more computer instructions, and the instructions are executed by a processor to implement the control method of the robot arm according to any one of the first aspect.
[0029] In a fifth aspect, a computer program product is provided, and the computer program product includes a computer program, and the computer program is executed by a processor to implement the control method of the robot arm according to any one of the first aspect.
[0030] Compared with the prior art, the present application has the following advantages:
[0031] The control method of the mechanical arm provided by the present application first acquires a target tracking trajectory of the mechanical arm, the target tracking trajectory including N tracking trajectory points, and the tracking trajectory points including angle information and angular velocity information of each joint of the mechanical arm. Next, the angle information and angular velocity information of each joint in the i th tracking trajectory point are input into a feedforward model to obtain a predicted control signal amount of each joint output by the feedforward model. The feedforward model can output a control signal amount required to achieve the angle and angular velocity information of each joint according to the angle and angular velocity information of each joint. Therefore, according to the feedforward model, a feasible control signal amount required to achieve the angle and angular velocity information of each joint can be found faster. In order to find the optimal control signal amount, sampling needs to be performed in the vicinity of the feasible control signal amount to obtain a series of sampling values. Based on this, the control signal amount sampling range corresponding to each joint is determined with the predicted control signal amount of each joint as the reference point, and sampling is performed in each control signal amount sampling range to obtain a plurality of to-be-selected control signal amounts corresponding to each joint. Subsequently, each sampling value is evaluated to quickly find the optimal control signal amount. Specifically, for each predicted trajectory point, the N-i trajectory points after the predicted trajectory point are predicted based on a world model to obtain a predicted trajectory corresponding to the predicted trajectory point, the predicted trajectory including N-i+1 predicted trajectory points, and the world model being used to predict the angle, angular velocity and control signal amount of each joint of the mechanical arm at the next trajectory point. From the predicted trajectory corresponding to each predicted trajectory point, a target predicted trajectory closest to a target trajectory segment is determined, so as to determine the control signal amount of each joint in the first trajectory point in the target predicted trajectory as the target control signal amount corresponding to each joint in the i th tracking trajectory point, and the target trajectory segment being a trajectory composed of the i th tracking trajectory point to the N th tracking trajectory point in the target tracking trajectory. The present application improves the control precision and efficiency of the mechanical arm. BRIEF DESCRIPTION OF DRAWINGS
[0032] The accompanying drawings, which are included to provide a further understanding of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and serve to explain the present application. In the drawings:
[0033] Figure 1 A flowchart of a control method of a mechanical arm provided by one of the embodiments of the present application;
[0034] Figure 2 A flowchart of a control method of a mechanical arm provided by one of the embodiments of the present application;
[0035] Figure 3 A schematic diagram of hardware modification of an excavator provided by one of the embodiments of the present application;
[0036] Figure 4A training flow diagram of the feedforward model provided for one of the embodiments of the present application is shown in the following figure.
[0037] Figure 5 A structural diagram of the control device of the mechanical arm provided for one of the embodiments of the present application is shown in the following figure.
[0038] Figure 6 A hardware structural diagram of the electronic device provided for one of the embodiments of the present application is shown in the following figure.
[0039] The specific embodiments of the present application have been shown in the above figures, and will be described in more detail hereinafter. These figures and the written description are not intended to limit the scope of the present application concept in any way, but to illustrate the present application concept to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0040] In order to make the purposes, advantages and features of the present application clearer, the present application will be described clearly and completely in the following in combination with the figures and specific embodiments. In the following description, a large number of specific details are set forth in order to facilitate a full understanding of the present application. However, the described embodiments are only part of the embodiments of the present application, and all other embodiments obtained by those skilled in the art without any creative work fall within the scope of protection of the present application.
[0041] It should be noted that, in the description of the present application, the terms "first", "second", etc. are only for the purpose of description, and cannot be understood as indicating or implying relative importance, and a specific order or sequence. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, unless otherwise specified, the term "a plurality of" means two or more. The term "and / or" describes the association between the associated objects, which means that there can be three kinds of relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects. The terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0042] In order to facilitate the understanding of the technical solutions of the present application, first, the related concepts involved in the present application are introduced.
[0043] A PID controller (Proportional-Integral-Derivative controller) controls actuators (e.g., individual joints on a robotic arm) by using current and past states of the controlled object collected by sensors.
[0044] An MPC (Model Predictive Control) predicts the trajectory of a controlled object in the next period of time under a series of actuator actions based on the current state of the controlled object and a simplified physical model of the controlled object inside the controller. MPC can theoretically achieve optimal control performance and can easily deal with the challenge of multiple inputs and outputs. Compared with the PID controller, MPC can also better handle the delay problem of the excavator system.
[0045] Next, the prior art and problems of the prior art involved in the present application are described:
[0046] In order to realize the functions of automatic operation of the robotic arm or remote control at the end, it is necessary to accurately control the path and speed of each joint on the robotic arm. The traditional PID controller uses the current and past states of the controlled object collected by sensors to control the actuator action. However, in actual application, the initial error of the PID control may be large, which can easily cause overshoot problem, and it is difficult to perform multi-objective constrained optimization for complex control systems with multiple inputs and outputs.
[0047] In related technologies, in order to control the movement of the robotic arm to perform a specified task or track a specified movement trajectory, the control system of the robotic arm needs to accurately model the kinematics of the robotic arm. On the basis of accurate modeling, PID feedback control is used to realize trajectory control of each joint on the robotic arm.
[0048] However, the above related technologies still have the following problems:
[0049] Due to the problems such as friction of hydraulic cylinders between actuators such as mechanical arms on excavators and control dead zones, heavy hydraulic excavators show strong nonlinearity, which makes it challenging to build an accurate motion control model for the excavators. In addition, obtaining accurate three-dimensional model information of the excavator requires a scheme for accurately measuring the size of large components, and the operation is relatively cumbersome. Finally, the debugging of the PID feedback controller requires experienced operators to spend a long time to correct, and a set of control parameters is also difficult to adapt to various complex working conditions faced by the excavator. In addition, in the traditional kinematic analysis of the excavator, the engineering designer usually needs to perform a large amount of pre-processing and post-processing settings, and requires certain simulation analysis experience. This process is tedious and time-consuming. Once the excavator hardware is upgraded, the state of the excavator changes, and the kinematic model needs to be recalibrated and modeled, causing unnecessary repetitive work. At the same time, in order to simplify the modeling process of the excavator, the model often needs to be simplified. The center of gravity of the weight calculated based on the simplified model has a deviation from the actual one, which affects the analysis accuracy. Therefore, the above related technologies have low control accuracy and efficiency for the mechanical arm.
[0050] In order to solve the above problems, the present application provides a mechanical arm control method, a mechanical arm control device corresponding to the method, an electronic device capable of implementing the mechanical arm control method, and a computer readable storage medium. The following embodiments provide detailed descriptions of the above methods, devices, electronic devices, and computer readable storage media.
[0051] In order to make the purpose, technical scheme of the present application more clear and intuitive, the following will combine the drawings and embodiments to describe the method provided by the embodiments of the present application in detail. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application. It can be understood that the following embodiments can exist independently, and the embodiments described below and the features in the embodiments can be combined with each other without conflict between the embodiments provided by the present application. For the same or similar content, it is not repeated in different embodiments. In addition, the step sequence in each method embodiment described below is only an example, not a strict limitation. In some cases, the steps shown or described can be executed in different order.
[0052] The application provides a mechanical arm control method and device, electronic equipment and a computer readable storage medium. Specifically, the mechanical arm control method of one embodiment of the application can be executed by a computer device, which can be a terminal or a server. The terminal can be a smart phone, a tablet computer, a notebook computer, a touch screen, etc. The terminal can also include a client, which can be an application client, a browser client carrying an application program or an instant messaging client, etc. The server can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, and basic cloud computing services such as big data and artificial intelligence platforms.
[0053] In the following, the mechanical arm control method provided by one embodiment of the application is described in combination with Figure 1 Figure 1 The flowchart of the mechanical arm control method provided by one embodiment of the application is shown in the following.
[0054] As Figure 1 shown, the mechanical arm control method includes S10-S20:
[0055] S10, obtaining a target tracking trajectory of a mechanical arm, the target tracking trajectory including N tracking trajectory points, each tracking trajectory point including angle information and angular velocity information of each joint of the mechanical arm.
[0056] The above mechanical arm is a mechanical device (such as an excavator or a loader) installed on a mechanical device (such as an excavator or a loader) for performing corresponding control actions. Taking the mechanical device as an example, the joints of the mechanical arm include the large arm, the small arm, the bucket, the cockpit joint or the rotating table of the excavator.
[0057] The above target tracking trajectory of the mechanical arm refers to a pre-planned movement trajectory for the mechanical arm to reach a target position from a current position. The target tracking trajectory includes N tracking trajectory points, each tracking trajectory point including angle information and angular velocity information of each joint of the mechanical arm.
[0058] In the embodiment of the application, the control signal amount of each joint of the mechanical arm at each tracking trajectory point is explored to realize the driving of each joint of the mechanical arm under the corresponding control signal amount, so that the movement trajectory of the mechanical arm is as close as possible to the target tracking trajectory.
[0059] S20, sequentially performing the first step on each of the N tracking trajectory points to obtain the target control signal quantity corresponding to each joint in the i-th tracking trajectory point, the target control signal quantity corresponding to each joint in the i-th tracking trajectory point being used for controlling each joint of the robot arm when tracking the i-th tracking trajectory point, i being greater than or equal to 1 and less than or equal to N.
[0060] In the embodiments of the present application, the first step is sequentially performed on each of the N tracking trajectory points included in the target tracking trajectory to obtain the target control signal quantity corresponding to each tracking trajectory point, that is, the target control signal quantity of each tracking trajectory point is predicted with the least amount of calculation and the fastest speed, so that each joint of the robot arm is controlled with the target control signal quantity corresponding to each joint in each tracking trajectory point when tracking each tracking trajectory point, which can make the moving trajectory of the robot arm as close as possible to the target tracking trajectory.
[0061] The first step includes steps S201-S205.
[0062] S201, inputting the angle information and the angular velocity information of each joint in the i-th tracking trajectory point into the feedforward model to obtain the predicted control signal quantity of each joint output by the feedforward model.
[0063] S202, determining the control signal quantity sampling range corresponding to each joint with the predicted control signal quantity of each joint as the reference point, and sampling in each control signal quantity sampling range to obtain a plurality of candidate control signal quantities corresponding to each joint.
[0064] S203, determining a plurality of candidate predicted trajectory points according to the angle information and the angular velocity information of each joint in the i-th tracking trajectory point and the plurality of candidate control signal quantities corresponding to each joint, the predicted trajectory point including the angle information, the angular velocity information of each joint in the tracking trajectory point and a candidate control signal quantity.
[0065] S204, predicting the N-i trajectory points after the predicted trajectory point based on the world model for each predicted trajectory point to obtain the predicted trajectory corresponding to the predicted trajectory point, the predicted trajectory including N-i+1 predicted trajectory points, the world model being used for predicting the angle, the angular velocity and the control signal quantity of each joint of the robot arm at the next trajectory point.
[0066] S205, determining the target predicted trajectory closest to the target trajectory segment from the predicted trajectory corresponding to each predicted trajectory point, the target control signal quantity of each joint in the first trajectory point in the target predicted trajectory being determined as the target control signal quantity corresponding to each joint in the i-th tracking trajectory point, the target trajectory segment being the trajectory composed of the i-th tracking trajectory point to the N-th tracking trajectory point in the target tracking trajectory.
[0067] The steps S201-S205 are explained below.
[0068] First, the angle information and the angular velocity information of each joint in the ith tracking trajectory point are input into the feedforward model to obtain the predicted control signal amount of each joint output by the feedforward model. The feedforward model can output the control signal amount required to achieve the angle and angular velocity information of each joint according to the angle and angular velocity information of each joint. Therefore, according to the feedforward model, a feasible control signal amount required to achieve the angle and angular velocity information of each joint can be found more quickly.
[0069] In the prior art, the model predictive control algorithm (MPC) is used to complete the tracking control task according to the obtained target tracking trajectory of the robot arm. The rolling optimization in MPC solves the optimal control solution of the objective function within a limited time period based on the set constraints, and an optimization problem is solved in each control period. However, solving the optimization problem has the problems of large amount of calculation and long time consumption. In order to solve this problem, a sampling-based method is used in the embodiments of the present application to find the optimal control signal amount from the multiple candidate control signal amounts sampled. Meanwhile, in the present application, the world model trained for the robot arm is used as the model to predict the next stage state (i.e. the next predicted trajectory point) of the robot arm. In order to complete the optimization calculation more quickly and better enable the robot arm to track the target tracking trajectory to move, the present application uses a hot start method to provide an initial solution for the sampling optimization process, thereby improving the solving efficiency of the optimization problem. The initial solution provided by the hot start is usually very close to the optimal solution of the original problem or at least a feasible solution, so that the calculation process of finding the optimal control signal amount can converge more quickly. In the present application, the predicted control signal amount of each joint of the robot arm in the ith tracking trajectory is obtained by using the trained feedforward model as the hot start item.
[0070] For each joint, in order to find the optimal control signal amount, the predicted control signal amount of the joint is used as the reference point to determine the control signal amount sampling range corresponding to the joint, and sampling is performed in the control signal amount sampling range to obtain multiple candidate control signal amounts corresponding to the joint. That is, for each joint, sampling is performed in the vicinity of the feasible control signal amount to obtain a series of control signal amount sampling values. The control signal amount sampling values will be evaluated subsequently to quickly find the optimal control signal amount therefrom.
[0071] Exemplarily, assuming that the predicted control signal amount of a joint is v1, [v1-x, v1+x] is determined as the control signal amount sampling range corresponding to the joint. Random sampling is performed in the control signal amount sampling range [v1-x, v1+x] to obtain k candidate control signal amounts corresponding to the joint.
[0072] In the embodiment of the present application, according to the angle information and the angular velocity information of each joint in the i th tracking trajectory point and the plurality of candidate control signal amounts corresponding to each joint, a plurality of candidate predicted trajectory points are determined, wherein each predicted trajectory point comprises the angle information and the angular velocity information of each joint in the tracking trajectory point and one candidate control signal amount. It should be noted that the angle information and the angular velocity information of each joint in each predicted trajectory point are the same, and the difference between different predicted trajectory points lies in that the candidate control signal amounts of at least one joint are different.
[0073] That is, for each joint, one candidate control signal amount is selected from the plurality of candidate control signal amounts corresponding to the joint. After the selection, the candidate control signal amount of each joint is combined with the angle information and the angular velocity information of each joint in the i th tracking trajectory point, and one candidate predicted trajectory point is obtained. By repeating the operation, a plurality of candidate predicted trajectory points are obtained.
[0074] In an alternative embodiment, the specific implementation of step S203 comprises steps S2031-S2032:
[0075] S2031, according to the plurality of candidate control signal amounts corresponding to each joint in the i th tracking trajectory point, a plurality of control signal amount groups are determined, wherein each control signal amount group comprises one candidate control signal amount corresponding to each joint.
[0076] S2032, each control signal amount group is combined with the angle information and the angular velocity information of each joint in the tracking trajectory point, and a plurality of candidate predicted trajectory points are obtained, wherein each predicted trajectory point comprises the angle information and the angular velocity information of each joint in the tracking trajectory point and one control signal amount group.
[0077] In the embodiment of the present application, from the plurality of candidate control signal amounts corresponding to each joint in the i th tracking trajectory point, one candidate control signal amount is selected for each joint, and one control signal amount group is obtained. By repeating the operation, a plurality of control signal amount groups are obtained. Each control signal amount group is combined with the angle information and the angular velocity information of each joint in the tracking trajectory point, and one candidate predicted trajectory point is obtained. The above operation is performed for each control signal amount group in the plurality of control signal amount groups, and a plurality of candidate predicted trajectory points are obtained, so that the plurality of candidate predicted trajectory points can be determined more quickly and conveniently.
[0078] In the embodiments of the present application, for each predicted trajectory point, N-i trajectory points after the predicted trajectory point are predicted based on a world model, to obtain a predicted trajectory corresponding to the predicted trajectory point, the predicted trajectory including N-i+1 predicted trajectory points, the world model being used to predict the angle, angular velocity and control signal amount of each joint of the robot arm at the next trajectory point. Therefore, the predicted trajectory corresponding to each predicted trajectory point is obtained based on each predicted trajectory point. From the predicted trajectory corresponding to each predicted trajectory point, a target predicted trajectory closest to the target trajectory segment is determined, to determine the control signal amount of each joint in the first trajectory point in the target predicted trajectory as the target control signal amount of each joint in the i-th tracking trajectory point, the target trajectory segment being a trajectory composed of the i-th tracking trajectory point to the N-th tracking trajectory point in the target tracking trajectory.
[0079] For example, it is assumed that the target tracking trajectory includes 10 tracking trajectory points, and multiple predicted trajectories are determined for the 1st tracking trajectory point. The multiple predicted trajectories corresponding to the 1st tracking trajectory point each include 10 predicted trajectory points. From the multiple predicted trajectories, a trajectory closest to the target trajectory segment (i.e., a trajectory composed of the 1st tracking trajectory point to the 10th tracking trajectory point in the target tracking trajectory, i.e., the target tracking trajectory) is selected and determined as the target predicted trajectory corresponding to the 1st tracking trajectory point, so that the control signal amount of each joint in the first trajectory point in the target predicted trajectory is determined as the target control signal amount corresponding to each joint in the 1st tracking trajectory point.
[0080] For example, it is assumed that the target tracking trajectory includes 10 tracking trajectory points, and multiple predicted trajectories are determined for the 2nd tracking trajectory point. The multiple predicted trajectories corresponding to the 2nd tracking trajectory point each include 9 predicted trajectory points. From the multiple predicted trajectories, a trajectory closest to the target trajectory segment (i.e., a trajectory composed of the 2nd tracking trajectory point to the 10th tracking trajectory point in the target tracking trajectory) is selected and determined as the target predicted trajectory corresponding to the 2nd tracking trajectory point, so that the control signal amount of each joint in the first trajectory point in the target predicted trajectory is determined as the target control signal amount corresponding to each joint in the 2nd tracking trajectory point.
[0081] Based on the above two examples, the specific method for determining the target predicted trajectory corresponding to each of the 3rd, 4th, 5th, …, 10th tracking trajectory points in the target tracking trajectory and the target control signal amount corresponding to each joint is determined, and the same applies here, which will not be described herein again.
[0082] In the embodiments of the present application, only the control signal amount of each joint corresponding to the first trajectory point in each target predicted trajectory is used to control each joint of the robot arm. The control flow of the entire robot arm can be seen from Figure 2 , Figure 2A flowchart of the control of the mechanical arm provided for one of the embodiments of the present application is shown. As shown in Figure 2 For the i-th tracking trajectory point in the N tracking trajectory points contained in the target tracking trajectory, the angle information and the angular velocity information of each joint in the i-th tracking trajectory point are input to the feedforward model to obtain the predicted control signal amount of each joint output by the feedforward model. With the predicted control signal amount of each joint as a reference point, the control signal amount sampling range corresponding to each joint is determined, and the optimizer based on sampling is used to sample in each control signal amount sampling range to obtain a plurality of candidate control signal amounts corresponding to each joint. According to the angle information and the angular velocity information of each joint in the i-th tracking trajectory point and the plurality of candidate control signal amounts corresponding to each joint, a plurality of candidate predicted trajectory points are determined, and the predicted trajectory point includes the angle information, the angular velocity information of each joint in the i-th tracking trajectory point and a candidate control signal amount. For each predicted trajectory point, the world model is used to predict the N-i trajectory points after the predicted trajectory point to obtain the predicted trajectory corresponding to the predicted trajectory point, and the predicted trajectory includes N-i+1 predicted trajectory points. The world model is used to predict the angle, the angular velocity and the control signal amount of each joint in the mechanical arm at the next trajectory point. From the predicted trajectory corresponding to each predicted trajectory point, the target predicted trajectory closest to the target trajectory segment is determined, and the control signal amount of each joint in the first trajectory point in the target predicted trajectory is determined as the target control signal amount corresponding to each joint in the i-th tracking trajectory point. The target trajectory segment is the trajectory composed of the i-th tracking trajectory point to the N-th tracking trajectory point in the target tracking trajectory.
[0083] The control method of the mechanical arm provided in the embodiments of the present application first acquires a target tracking trajectory of the mechanical arm, the target tracking trajectory including N tracking trajectory points, and the tracking trajectory points including angle information and angular velocity information of each joint of the mechanical arm. Next, the angle information and the angular velocity information of each joint in the i th tracking trajectory point are input into a feedforward model to obtain a predicted control signal amount of each joint output by the feedforward model. The feedforward model can output a control signal amount required to achieve the angle and angular velocity information of each joint according to the angle and angular velocity information of each joint. Therefore, according to the feedforward model, a feasible control signal amount required to achieve the angle and angular velocity information of each joint can be found more quickly. In order to find the optimal control signal amount, sampling needs to be performed in the vicinity of the feasible control signal amount to obtain a series of sampling values. Based on this, the predicted control signal amount of each joint is taken as a reference point to determine a control signal amount sampling range corresponding to each joint, and sampling is performed in each control signal amount sampling range to obtain a plurality of to-be-selected control signal amounts corresponding to each joint. Subsequently, each sampling value is evaluated to quickly find the optimal control signal amount. Specifically, for each predicted trajectory point, the N-i trajectory points after the predicted trajectory point are predicted based on a world model to obtain a predicted trajectory corresponding to the predicted trajectory point, the predicted trajectory including N-i+1 predicted trajectory points, and the world model being used to predict the angle, angular velocity and control signal amount of each joint of the mechanical arm at the next trajectory point. From the predicted trajectory corresponding to each predicted trajectory point, a target predicted trajectory closest to a target trajectory segment is determined, so as to determine the control signal amount of each joint in the first trajectory point in the target predicted trajectory as the target control signal amount corresponding to each joint in the i th tracking trajectory point, and the target trajectory segment being a trajectory composed of the i th tracking trajectory point to the N th tracking trajectory point in the target tracking trajectory. The present application improves the control precision and efficiency of the mechanical arm.
[0084] On the basis of the above embodiments, the control method of the mechanical arm provided in the embodiments of the present application is further described.
[0085] In an optional implementation, the specific implementation of step S205 “determining, from the predicted trajectory corresponding to each predicted trajectory point, a target predicted trajectory closest to a target trajectory segment” includes steps S2051-S2052.
[0086] S2051, for the predicted trajectory corresponding to each predicted trajectory point, calculating a first loss value corresponding to the predicted trajectory according to the predicted trajectory and the target trajectory segment based on a first loss function.
[0087] S2052, determining the target predicted trajectory from the predicted trajectory corresponding to each predicted trajectory point according to the first loss value corresponding to the predicted trajectory corresponding to each predicted trajectory point.
[0088] The first loss function can refer to Formula I:
[0089]
[0090] wherein J is the number of trajectory points contained in the predicted trajectory, K is the number of joints contained in the robot arm, x k,j is the angle information of the jth trajectory point in the predicted trajectory corresponding to the kth joint, x' k,j is the angle information of the jth trajectory point in the target trajectory segment corresponding to the kth joint, y k,j is the angular velocity information of the jth trajectory point in the predicted trajectory corresponding to the kth joint, y' k,j is the angular velocity information of the jth trajectory point in the target trajectory segment corresponding to the kth joint, is the weight corresponding to the jth trajectory point in the predicted trajectory, and the Cost value is the first loss value corresponding to the predicted trajectory.
[0091] It should be noted that, since the predicted trajectory points in the predicted trajectory are predicted by the world model, as the prediction time increases, the problem of error accumulation is inevitable (since each predicted trajectory point is calculated based on the previous predicted trajectory point and the error term, the error may be accumulated at multiple times, thereby affecting the prediction accuracy of the world model for the predicted trajectory points), resulting in more predicted trajectory points predicted by the model, and the greater the error. Therefore, in the calculation of the first loss function, a weight is introduced for each predicted trajectory point, and a smaller weight is assigned to the predicted trajectory point predicted later.
[0092] An optional embodiment determines the predicted trajectory with the smallest first loss value as the target predicted trajectory. As can be seen from Formula I, the smaller the first loss value corresponding to the predicted trajectory, the closer the predicted trajectory is to the target tracking trajectory, so that a target predicted trajectory closest to the target tracking trajectory can be determined.
[0093] An optional embodiment, the control method of the robot arm provided by the embodiments of the present application further comprises S301-S302:
[0094] S301, a plurality of sample data sets are obtained, the sample data set comprises a plurality of state data arranged in time sequence, and the state data comprises angle information, angular velocity information and control signal amount of each joint in the robot arm.
[0095] S302, the first model is trained based on the sample data set, and the world model is obtained after the training is completed. The world model is used to predict the angle information, angular velocity information and control signal amount of each joint in the robot arm at the next time according to the currently input sample data set.
[0096] In the embodiments of the present application, the mechanical arm on the excavator is taken as an example. Through hardware modification of the excavator, such as Figure 3 As shown in the figure, an inclination sensor, an embedded development platform, a PLC (Programmable Logic Controller) and a solenoid valve are added to the excavator, so that the motion state information (i.e. the angle and angular velocity of each joint) of each joint of the mechanical arm on the excavator under different control signal amounts can be obtained in real time. Figure 3 The schematic diagram of hardware modification of the excavator provided in one of the embodiments of the present application is shown in the figure.
[0097] Specifically, an inclination sensor is arranged on the boom, the arm, the bucket and the cabin of the excavator, respectively, and the installation position is shown by the arrow in the figure. Figure 3 In addition, a computing unit is installed inside the cabin for collecting data of the sensors and uploading data. An automatic data collection script is deployed on the computing platform of the excavator, which is automatically started when the excavator is turned on, and the motion state information of each joint of the mechanical arm on the excavator is obtained in real time through the Rostopic communication mechanism. The specific data information includes the joint angle, the joint angular velocity, the control signal amount information (PWM) and the current information timestamp of the boom, the arm, the bucket and the cabin joints of the excavator.
[0098] The inclination sensor is used to detect the inclination of the boom, the arm, the bucket and the cabin joints of the excavator in real time. The embedded development platform is a set of high-performance, low-power embedded system modules (SOMs) designed for edge computing, which aims to support complex artificial intelligence (AI), machine learning (ML), computer vision (CV) and other high-performance computing applications. The PLC controller is a digital operation controller designed for industrial environment, which is used for automatic control process. The solenoid valve is a valve that uses the magnetic force generated by an electromagnet to open or close the fluid passage. In the present application, the solenoid valve is used to control the flow of liquid in the hydraulic excavator, thereby realizing the control of the hydraulic size of the excavator.
[0099] In the embodiments of the present application, the motion state information of each joint of the mechanical arm on the excavator at the current time can be obtained and recorded in real time through the above-mentioned hardware devices. The motion state information includes the control signal amount received by each joint, and the joint angle and joint angular velocity under the corresponding control signal amount. By installing the devices to obtain and record the motion state information of each joint of the excavator at the current time, the motion state information of the excavator is automatically obtained in real time, without the need for manual acquisition, which greatly improves the data acquisition efficiency.
[0100] The above can obtain the motion state information of each joint of the mechanical arm on the excavator at the current time, that is, a plurality of sample data sets, the sample data set includes a plurality of state data arranged in time sequence, and the state data includes angle information, angular velocity information and control signal quantity of each joint in the mechanical arm.
[0101] The above, the initial model of the world model, that is, the first model, adopts a network structure of deep learning, and the specific network structure can be adjusted according to actual needs, such as common MLP, LSTM, TRANSFORMER architecture and the like. The network structure and parameters are not limited in the embodiments of the present application.
[0102] In the embodiments of the present application, since the first model needs to be iteratively trained multiple times before the world model is determined, each iteration needs a sample data set as the input of the first model to train the first model. After multiple iterations, the world model is obtained.
[0103] An optional embodiment, the specific implementation of step S302 "training the first model based on the sample data set, and obtaining the world model after the training is completed", includes steps S3021-S3022:
[0104] S3021, input the sample data set into the first model, and calculate the second loss value according to the second loss function.
[0105] S3022, adjust the parameters of the first model according to the second loss value until the preset condition is met, the model training is completed, and the world model is obtained.
[0106] In the embodiment of the present application, the sample data is taken as the input of the first model. Since part of the positions in the collected sample data can have pauses. The pause refers to the fact that when collecting data of each joint of the robot arm, the robot arm can be stationary due to operation or other reasons. This part of data, taking the angle information of each joint as an example, is that the angle information of each joint remains unchanged. Therefore, if the timing information is not added, the motion at the starting time cannot be perceived. At the same time, as the output of the world model, a continuous motion trajectory is needed, and the input state needs to include a piece of historical trajectory information as the basis for model decision. Therefore, in the present application, a plurality of sample data groups are spliced into continuous sample data groups, and in addition, the sample data of each frame needs to describe the angle value and angular velocity value of each joint of the robot arm, and the control signal amount of each joint of the robot arm. The output of the world model is the change amount of the angle, angular velocity and control signal amount of each joint of the robot arm between the last input sample data group and the predicted next trajectory point. Specifically, the input information of the world model includes: the angle and angular velocity information of the current frame and the historical (n-1) frame of each joint of the robot arm such as the boom, the arm, the bucket and the cabin, the control signal amount received by the current frame and the historical (n-1) frame of the boom, the arm, the bucket and the cabin of the robot arm, and the state change amount of the boom, the arm, the bucket and the cabin of the robot arm predicted by the world model. The world model can obtain the state of each joint of the robot arm such as the boom, the arm, the bucket and the cabin in the next frame, i.e., the predicted trajectory point (i.e., the angle, angular velocity and control signal amount of each joint), according to the state change amount of the boom, the arm, the bucket and the cabin of the robot arm and the sum of the states of each joint of the robot arm such as the boom, the arm, the bucket and the cabin in the previous frame.
[0107] In an optional implementation, the preset condition for ending the training of the model includes any one of the following: the number of training times reaches a preset training time threshold, and the second loss value is less than or equal to a second loss threshold.
[0108] In an optional implementation, the control method of the robot arm provided in the embodiment of the present application further includes S401-S404.
[0109] S401, obtain the control dead zone range of each joint.
[0110] S402, on the basis of the control dead zone range of each joint, gradually increase the control signal amount of each joint, and real-time acquire and record the angle information and angular velocity information of each joint under different control signal amounts.
[0111] S403, determine a plurality of training data pairs under different control signal amounts according to the angle information and the angular velocity information of each joint under the different control signal amounts.
[0112] S404, train the second model according to the training sample data pairs, and obtain the feedforward model after the training is completed.
[0113] In the embodiments of the present application, as shown in Figure 4 the control dead zone range of each joint of the robot arm is first obtained. On the basis of the control dead zone range of each joint, the control signal amount of each joint is gradually increased, and the motion state information of each joint under different control signal amounts is obtained and recorded in real time. According to the motion state information of each joint under different control signal amounts, a plurality of training sample data pairs under different control signal amounts are obtained. The training sample data pair includes the control signal amount received by each joint, the joint speed information of the joint under the control signal amount, and the joint angular velocity information of the joint under the control signal amount. The second model is trained according to the training sample data pairs, and the feedforward model is obtained after the training is completed. The above steps can be referred to in Figure 4 , Figure 4 the training flowchart of the feedforward model provided by one of the embodiments of the present application.
[0114] An optional implementation, a possible implementation of the step S405 "training the second model according to the training data pairs" includes:
[0115] The second step is repeatedly executed until the third loss value is less than the third loss threshold value, and the feedforward model is obtained. The second step includes steps S4051-S4052:
[0116] S4051, input the control signal amount received by each joint in the training data pair and the joint speed information of the joint under the control signal amount into the second model, and obtain the joint angular velocity information of the joint under the control signal amount predicted by the second model output.
[0117] S4052, calculate the third loss value based on the third loss function according to the joint angular velocity information of the joint under the control signal amount in the training data pair and the joint angular velocity information of the joint under the control signal amount predicted by the second model, and update the parameters of the second model according to the third loss value.
[0118] An optional implementation, before the step S403, further includes the following steps:
[0119] A1, data preprocessing is performed on the motion state information of each joint under different control signal amounts.
[0120] In the embodiments of the present application, the main principle of data screening through data preprocessing is to eliminate the data of time periods in which the joint speed changes dramatically, because this part of data cannot truly reflect the corresponding relationship between PWM and joint angular speed.
[0121] In an alternative embodiment, a possible implementation of step A1 "data preprocessing of the angle information and angular speed information of each joint under different control signal amounts" includes A11-A15:
[0122] A11, for each joint, determining joint acceleration information of the joint under the Kth control signal amount according to the joint speed information of the joint under the Kth control signal amount and the joint speed information of the joint under the (K-1)th control signal amount, K is greater than or equal to 2.
[0123] A12, determining the mode of joint acceleration according to a plurality of joint acceleration information.
[0124] A13, determining a plurality of target control signal amounts in which the difference between the joint acceleration information and the mode of joint acceleration is less than a preset difference threshold.
[0125] A14, determining the variance of joint speed of the joint according to the joint speed information of the joint under a plurality of target control signal amounts.
[0126] A15, eliminating the joint speed information greater than a preset multiple of the variance of joint speed.
[0127] In the embodiments of the present application, the main principle of automatic data screening is to eliminate the time periods in which the joint speed changes dramatically, considering that this part of data cannot truly reflect the corresponding relationship between PWM and joint angular speed. The degree of dramatic change of speed can be reflected according to the slope of speed, i.e. acceleration information. The relatively stable speed interval is selected according to the statistical characteristics of overall acceleration. The overall principle is to find a relatively stable interval according to the mode of acceleration, calculate the mean and variance in the interval, and eliminate the data exceeding 2 times the variance as fluctuation data.
[0128] The control device of the mechanical arm provided by the present application is described below. The control device of the mechanical arm described below can be correspondingly referred to the control method of the mechanical arm described above.
[0129] Figure 5 The structural schematic diagram of the control device of the mechanical arm provided by one of the embodiments of the present application is shown in FIG. 5. As shown in FIG. 5, the control device 500 of the mechanical arm includes an acquisition module 501 and a processing module 502. Figure 5
[0130] An acquisition module is configured to acquire a target tracking trajectory of a robot arm, the target tracking trajectory including N tracking trajectory points, and each of the tracking trajectory points including angle information and angular velocity information of each joint of the robot arm;
[0131] A processing module is configured to sequentially perform a first step on each of the N tracking trajectory points to obtain a target control signal amount of each joint corresponding to the i-th tracking trajectory point, the target control signal amount of each joint corresponding to the i-th tracking trajectory point being used to control each joint of the robot arm when tracking the i-th tracking trajectory point, and i being greater than or equal to 1 and less than or equal to N;
[0132] The first step includes:
[0133] inputting the angle information and the angular velocity information of each joint in the i-th tracking trajectory point into a feedforward model to obtain a predicted control signal amount of each joint output by the feedforward model;
[0134] taking the predicted control signal amount of each joint as a reference point, determining a control signal amount sampling range corresponding to each joint, and sampling in each control signal amount sampling range to obtain a plurality of candidate control signal amounts corresponding to each joint;
[0135] determining a plurality of candidate predicted trajectory points according to the angle information and the angular velocity information of each joint in the i-th tracking trajectory point and the plurality of candidate control signal amounts corresponding to each joint, each of the predicted trajectory points including the angle information and the angular velocity information of each joint in the i-th tracking trajectory point and a candidate control signal amount;
[0136] for each of the predicted trajectory points, predicting N-i trajectory points after the predicted trajectory point based on a world model to obtain a predicted trajectory corresponding to the predicted trajectory point, the predicted trajectory including N-i+1 predicted trajectory points, and the world model being used to predict an angle, an angular velocity and a control signal amount of each joint of the robot arm in a next trajectory point;
[0137] determining a target predicted trajectory closest to a target trajectory segment from the predicted trajectory corresponding to each of the predicted trajectory points, the target trajectory segment being a trajectory composed of the i-th tracking trajectory point to the N-th tracking trajectory point in the target tracking trajectory, and determining a control signal amount of each joint in a first trajectory point in the target predicted trajectory as the target control signal amount of each joint corresponding to the i-th tracking trajectory point.
[0138] In an optional implementation, the processing module is specifically configured to:
[0139] According to the plurality of candidate control signal amounts corresponding to each joint in the i th tracking trajectory point, a plurality of control signal amount groups are determined, and each control signal amount group includes a candidate control signal amount corresponding to each joint;
[0140] Each of the plurality of control signal amount groups is combined with the angle information and the angular velocity information of each joint in the tracking trajectory point to obtain a plurality of candidate predicted trajectory points, and each predicted trajectory point includes the angle information and the angular velocity information of each joint in the tracking trajectory point and one control signal amount group.
[0141] In an optional implementation, the processing module is specifically configured to:
[0142] For each predicted trajectory corresponding to each predicted trajectory point, a first loss value corresponding to the predicted trajectory is calculated based on a first loss function and according to the predicted trajectory and the target trajectory segment;
[0143] According to the first loss value corresponding to the predicted trajectory corresponding to each predicted trajectory point, a target predicted trajectory is determined from the predicted trajectory corresponding to each predicted trajectory point.
[0144] In an optional implementation, the processing module is specifically configured to:
[0145] The predicted trajectory with the smallest first loss value is determined as the target predicted trajectory.
[0146] In an optional implementation, the device further includes a first training module, and the first training module is specifically configured to:
[0147] A plurality of sample data groups are obtained, each sample data group includes a plurality of state data arranged in time sequence, and the state data includes angle information, angular velocity information, and a control signal amount of each joint in the robot arm;
[0148] The first model is trained based on the sample data groups, and a world model is obtained after the training is completed, the world model is used to predict the angle information, the angular velocity information, and the control signal amount of each joint in the robot arm at the next time according to the currently input sample data group.
[0149] In an optional implementation, the first training module is specifically configured to:
[0150] The sample data groups are input into the first model, and a second loss value is calculated according to a second loss function;
[0151] The first model is adjusted in parameters according to the second loss value until a preset condition is met, the training of the model is completed, and a world model is obtained.
[0152] In an optional implementation, the preset condition comprises any one of the following: the number of training times reaches a preset training time threshold, or the second loss value is less than or equal to a second loss threshold.
[0153] In an optional implementation, the device further comprises a second training module, which is specifically configured to:
[0154] Obtain a control dead zone range of each joint;
[0155] On the basis of the control dead zone range of each joint, gradually increase the control signal amount of each joint, and obtain and record the angle information and angular velocity information of each joint under different control signal amounts in real time;
[0156] Data pre-processing is performed on the angle information and angular velocity information of each joint under different control signal amounts;
[0157] According to the pre-processed angle information and angular velocity information of each joint under different control signal amounts, a plurality of training data pairs under different control signal amounts are determined; wherein, the training data pair comprises the control signal amount received by each joint, the joint speed information and the joint angular velocity information of the joint under the control signal amount;
[0158] The second model is trained according to the training data pair, and the feedforward model is obtained after the training is completed.
[0159] In an optional implementation, the second training module is specifically configured to:
[0160] The second step is repeatedly executed until the third loss value is less than a third loss threshold, and a feedforward model is obtained, wherein the second step comprises:
[0161] The control signal amount received by each joint in the training data pair and the joint speed information of the joint under the control signal amount are input into the second model, and the joint angular velocity information of the joint under the control signal amount predicted by the second model output is obtained.
[0162] Based on a third loss function, the third loss value is calculated according to the joint angular velocity information of the joint under the control signal amount in the training data pair and the predicted joint angular velocity information of the joint under the control signal amount, and the second model is updated in parameters according to the third loss value.
[0163] In an optional implementation, the second training module is specifically configured to:
[0164] For each joint, according to joint speed information of the joint at the Kth control signal amount and joint speed information of the joint at the K-1th control signal amount, determine joint acceleration information of the joint at the Kth control signal amount, K is greater than or equal to 2;
[0165] According to a plurality of joint acceleration information, determine the joint acceleration mode;
[0166] Determine the difference between the joint acceleration information and the joint acceleration mode is less than the preset difference threshold value for a plurality of target control signal amounts in succession;
[0167] According to the joint speed information of the joint at the plurality of target control signal amounts, determine the joint speed variance of the joint;
[0168] Delete the joint speed information greater than the preset multiple of the joint speed variance.
[0169] The control device of the mechanical arm provided in the embodiment can be used to execute the technical solutions of the control method of the mechanical arm in the above embodiment, and has similar implementation principles and technical effects, which will not be described here again in the embodiment.
[0170] Figure 6 The hardware structure diagram of the electronic device provided in one of the embodiments of the present application is shown in FIG. 6, the electronic device 600 of the embodiment includes a processor 601 and a memory 602, wherein Figure 6
[0171] The memory 602 is used to store computer execution instructions.
[0172] The processor 601 is used to execute the computer execution instructions stored in the memory, so as to realize each step executed by the control method of the mechanical arm in the above embodiment. For details, please refer to the related description in the method embodiment.
[0173] Optionally, the memory 602 can be independent or integrated with the processor 601.
[0174] When the memory 602 is independently arranged, the electronic device further includes a bus 603 for connecting the memory 602 and the processor 601.
[0175] One of the embodiments of the present application further provides a computer readable storage medium, the computer readable storage medium stores computer execution instructions, when the processor executes the computer execution instructions, the technical solutions corresponding to the control method of the mechanical arm in any one of the above embodiments executed by the electronic device are realized.
[0176] An embodiment of the present application also provides a computer program product, which comprises a computer program stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to enable the electronic device to execute the technical solutions corresponding to the control method of the mechanical arm in any of the above embodiments.
[0177] Although the present application is disclosed with the preferred embodiments, it is not intended to limit the present application, and any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of the present application, so the protection scope of the present application should be subject to the scope defined by the claims of the present application.
[0178] In the several embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. The division of the modules is only a logical function division. There can be another division manner in actual implementation, for example, a plurality of modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the modules shown or discussed can be indirect coupling or communication connection through some interface, device or module, and can be electrical, mechanical or in other forms.
[0179] The integrated module implemented in the form of the software functional module can be stored in a computer readable storage medium. The software functional module stored in the storage medium includes a plurality of instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute some steps of the method described in each embodiment of the present application.
[0180] It should be understood that the above processor can be a central processing module (English: Central Processing Unit, CPU for short), and can also be other general-purpose processors, digital signal processors (English: Digital Signal Processor, DSP for short), application specific integrated circuits (English: Application Specific Integrated Circuit, ASIC for short), etc. The general-purpose processor can be a microprocessor, or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.
[0181] The memory can include a high-speed RAM memory, and can also include a non-volatile storage NVM, such as at least one disk memory, and can also be a U disk, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0182] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.
[0183] The above-mentioned storage medium can be realized by any type of volatile or non-volatile storage device or their combination, 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 storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0184] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The foregoing program can be stored in a computer readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the foregoing storage medium includes ROM, RAM, magnetic disk or optical disk and various storage medium that can store program codes.
[0185] Finally, it should be pointed out that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A control method of a robot arm, characterized by, The method comprises: obtaining a target tracking trajectory of a robot arm, the target tracking trajectory comprising N tracking trajectory points, the tracking trajectory points comprising angle information and angular velocity information of each joint of the robot arm; for an i-th tracking trajectory point in the N tracking trajectory points, sequentially performing a first step to obtain target control signal amounts of each joint in the i-th tracking trajectory point, the target control signal amounts of each joint in the i-th tracking trajectory point being used for controlling each joint of the robot arm when tracking the i-th tracking trajectory point, i being greater than or equal to 1 and less than or equal to N; the first step comprising: inputting the angle information and the angular velocity information of each joint in the i-th tracking trajectory point into a feedforward model to obtain predicted control signal amounts of each joint output by the feedforward model; taking the predicted control signal amounts of each joint as reference points to determine control signal amount sampling ranges of each joint, and sampling in each control signal amount sampling range to obtain a plurality of candidate control signal amounts corresponding to each joint; determining a plurality of candidate predicted trajectory points according to the angle information and the angular velocity information of each joint in the i-th tracking trajectory point and the plurality of candidate control signal amounts corresponding to each joint, the predicted trajectory points comprising the angle information and the angular velocity information of each joint in the i-th tracking trajectory point and a candidate control signal amount; for each predicted trajectory point, predicting N-i trajectory points after the predicted trajectory point based on a world model to obtain a predicted trajectory corresponding to the predicted trajectory point, the predicted trajectory comprising N-i+1 predicted trajectory points, the world model being used for predicting angles, angular velocities and control signal amounts of each joint of the robot arm in a next trajectory point; from the predicted trajectories corresponding to each predicted trajectory point, determining a target predicted trajectory closest to a target trajectory segment to determine control signal amounts of each joint in a first trajectory point in the target predicted trajectory as target control signal amounts of each joint in the i-th tracking trajectory point, the target trajectory segment being a trajectory composed of the i-th tracking trajectory point to the N-th tracking trajectory point in the target tracking trajectory.
2. The method of claim 1, wherein, The determining a plurality of candidate predicted trajectory points according to the angle information and the angular velocity information of each joint in the i-th tracking trajectory point and the plurality of candidate control signal amounts corresponding to each joint comprises: determining a plurality of control signal amount groups according to the plurality of candidate control signal amounts corresponding to each joint in the i-th tracking trajectory point, each control signal amount group comprising a candidate control signal amount corresponding to each joint; combining each control signal amount group with the angle information and the angular velocity information of each joint in the tracking trajectory point to obtain a plurality of candidate predicted trajectory points, the predicted trajectory points comprising the angle information and the angular velocity information of each joint in the tracking trajectory point and one control signal amount group.
3. The method of claim 1, wherein, The determining a target predicted trajectory closest to a target trajectory segment from the predicted trajectories corresponding to each predicted trajectory point comprises: For each of the predicted trajectories corresponding to the predicted trajectory points, a first loss value corresponding to the predicted trajectory is calculated based on a first loss function and according to the predicted trajectory and the target trajectory segment; A target predicted trajectory is determined from each of the predicted trajectories corresponding to the predicted trajectory points according to the first loss value corresponding to the predicted trajectory.
4. The method of claim 3, wherein, The determination of the target predicted trajectory from each of the predicted trajectories corresponding to the predicted trajectory points according to the first loss value corresponding to the predicted trajectory includes: The predicted trajectory with the smallest first loss value is determined as the target predicted trajectory.
5. The method of claim 1, wherein, The method further includes: Obtaining a plurality of sample data sets, each of the sample data sets including a plurality of state data arranged in time sequence, the state data including angle information, angular velocity information, and control signal amount of each joint in the robot arm; Training the first model based on the sample data sets, and obtaining a world model after the training, the world model being configured to predict the angle information, angular velocity information, and control signal amount of each joint in the robot arm at a next time according to a currently input sample data set.
6. The method of claim 5, wherein, The training of the first model based on the sample data sets and the obtaining of the world model after the training include: Inputting the sample data set into the first model, and calculating a second loss value according to a second loss function; Adjusting parameters of the first model according to the second loss value until a preset condition is met, and obtaining the world model after the training of the model ends.
7. The method of claim 6, wherein, The preset condition includes any one of the following: the number of training times reaches a preset training time threshold, and the second loss value is less than or equal to a second loss threshold.
8. The method of claim 1, wherein, The method further includes: Obtaining a control dead zone range of each joint; Based on the control dead zone range of each joint, gradually increasing the control signal amount of each joint, and real-time obtaining and recording the angle information and angular velocity information of each joint under different control signal amounts; According to the angle information and angular velocity information of each joint under different control signal amounts, a plurality of training data pairs under different control signal amounts are determined; wherein, each training data pair includes a control signal amount received by each joint, joint speed information and joint angular velocity information of the joint under the control signal amount; Training a second model according to the training data pairs, and obtaining the feedforward model after the training of the second model ends.
9. The method of claim 8, wherein, The training of the second model according to the training data pairs includes: Repeating the second step until a third loss value is less than a third loss threshold, and obtaining the feedforward model, the second step including: Inputting the control signal amount received by each joint in the training data pair and the joint speed information of the joint under the control signal amount into the second model, and obtaining joint angular velocity information of the joint under the control signal amount predicted by the second model output; According to the joint angular velocity information of the joint in the control signal amount in the training data pair and the predicted joint angular velocity information of the joint in the control signal amount, a third loss value is calculated based on a third loss function, and the second model is updated in parameters according to the third loss value.
10. The method of claim 8, wherein, Before determining a plurality of training data pairs at different control signal amounts according to the angle information and the angular velocity information of the respective joints at different control signal amounts, the method further comprises: Data preprocessing is performed on the angle information and the angular velocity information of the respective joints at different control signal amounts.
11. The method of claim 10, wherein, The data preprocessing on the angle information and the angular velocity information of the respective joints at different control signal amounts comprises: For each joint, joint acceleration information of the joint at the Kth control signal amount is determined according to joint velocity information of the joint when the Kth control signal amount is received and joint velocity information of the joint when the K-1th control signal amount is received, wherein K is greater than or equal to 2; Joint acceleration modes are determined according to a plurality of the joint acceleration information; A plurality of target control signal amounts are determined, in which a difference between the joint acceleration information and the joint acceleration modes is less than a preset difference threshold value; Joint velocity variance of the joint is determined according to joint velocity information of the joint at the plurality of target control signal amounts; Joint velocity information greater than a preset multiple of the joint velocity variance is deleted.
12. A control device of a robot arm, characterized by The device comprises: An acquisition module is configured to acquire a target tracking trajectory of a robot arm, the target tracking trajectory comprising N tracking trajectory points, and each tracking trajectory point comprising angle information and angular velocity information of each joint of the robot arm; A processing module is configured to sequentially perform a first step on an i-th tracking trajectory point in the N tracking trajectory points to obtain target control signal amounts corresponding to each joint in the i-th tracking trajectory point, the target control signal amounts corresponding to each joint in the i-th tracking trajectory point being used to control each joint of the robot arm when tracking the i-th tracking trajectory point, wherein i is greater than or equal to 1 and less than or equal to N. The first step comprises: inputting the angle information and the angular velocity information of each joint in the i-th tracking trajectory point into a feedforward model to obtain predicted control signal amounts of each joint output by the feedforward model; determining a control signal amount sampling range corresponding to each joint with the predicted control signal amounts of each joint as a reference point, and sampling in each control signal amount sampling range to obtain a plurality of candidate control signal amounts corresponding to each joint; determining a plurality of candidate predicted trajectory points according to the angle information and the angular velocity information of each joint in the i-th tracking trajectory point and the plurality of candidate control signal amounts corresponding to each joint, each predicted trajectory point comprising angle information, angular velocity information and a candidate control signal amount of each joint in the i-th tracking trajectory point; For each of the predicted trajectory points, N-i trajectory points after the predicted trajectory point are predicted based on a world model, to obtain a predicted trajectory corresponding to the predicted trajectory point, the predicted trajectory comprising N-i+1 predicted trajectory points, the world model being configured to predict an angle, an angular velocity and a control signal amount of each joint of the robot arm at a next trajectory point; From each of the predicted trajectories corresponding to the predicted trajectory points, a target predicted trajectory closest to a target trajectory segment is determined, to determine a control signal amount of each joint in a first trajectory point in the target predicted trajectory as a target control signal amount corresponding to each joint in an i-th tracking trajectory point, the target trajectory segment being a trajectory from the i-th tracking trajectory point to an N-th tracking trajectory point in the target tracking trajectory.
13. An electronic device, comprising: The electronic device comprises: a processor; and a memory for storing a data processing program, after the electronic device is powered on and the program is run by the processor, the control method of the robot arm as claimed in any one of claims 1-11 is executed.
14. A computer-readable storage medium, characterized in that, A data processing program is stored, the program is run by a processor, and the control method of the robot arm as claimed in any one of claims 1-11 is executed.
Citation Information
Patent Citations
Controlling a digging attachment along a path or trajectory
CN105756117A
Control method and device of hydraulic drive mechanical arm, electronic equipment and storage medium
CN114952866A