Torque compensation method and device for robot arm, electronic device and storage medium
By combining Lagrange dynamics models and neural networks, a variable structure motion law was constructed, which solved the problems of modeling errors and disturbances in the torque control of traditional robotic arms, and achieved high stability and high precision robotic arm motion control.
Patent Information
- Application Number
- CN202511640679.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-11-11
AI Technical Summary
Traditional robotic arm torque control methods rely on precise dynamic modeling, which cannot effectively compensate for modeling errors and external disturbances, leading to decreased control performance and system instability.
A complete control equation is constructed based on the Lagrange dynamics model. Control laws and bounded envelope functions are introduced. By combining neural networks and Lyapunov functions, a variable structure motion law is designed to achieve dynamic compensation and control of torque disturbances.
This improves the control stability and accuracy of the robotic arm in uncertain environments, ensuring its efficient and stable movement along the planned path.
Smart Images

Figure CN121083665B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of torque compensation technology for robotic arms, and more particularly to a torque compensation method, device, electronic device, and storage medium for robotic arms. Background Technology
[0002] Traditional robotic arm torque control methods are mostly designed based on deterministic models, which usually rely on accurate dynamic modeling, such as inertia matrix, centrifugal force term and gravity term. However, in actual industrial environments, robotic arms often have uncertainties such as modeling errors, load disturbances and external interference. Existing methods lack effective compensation mechanisms for these fuzzy or uncertain dynamics, which can easily lead to a decrease in control performance or even system instability. Summary of the Invention
[0003] Therefore, it is necessary to address the torque compensation problem of existing robotic arms by proposing a torque compensation method, device, electronic equipment, and storage medium for robotic arms.
[0004] A torque compensation method for a robotic arm, the method comprising:
[0005] Obtain the joint positions and motion angles of each joint of a specified robotic arm, and establish a motion model of the robotic arm based on the joint positions and motion angles of each joint.
[0006] The motion model is subjected to dynamic analysis using the Lagrange square to obtain the control law of the robotic arm;
[0007] Based on the control law, the torque of the specified robotic arm is compensated to obtain the ideal state of each arm parameter under the ideal trajectory of the robotic arm;
[0008] Based on the ideal state of each arm parameter, a bounded envelope function of the control law is set, and based on the bounded envelope function, the variable structure motion law of the specified robotic arm is obtained through a preset Lyapunov function.
[0009] Obtain the planned motion path of the specified robotic arm;
[0010] Based on the aforementioned variable structure motion law, torque control is achieved on the designated robotic arm along the planned motion path.
[0011] Further, the step of obtaining the planned motion path of the specified robotic arm includes:
[0012] Obtain the current state of each arm parameter corresponding to the specified robotic arm;
[0013] The current state of each of the arm parameters is input into a preset path planning model to obtain the planned motion path of the specified robotic arm.
[0014] Furthermore, before the step of inputting the current state of each of the arm parameters into a preset path planning model to obtain the planned motion path of the specified robotic arm, the method further includes:
[0015] Acquire multiple sets of training data; one set of training data includes historical arm states and corresponding actual trajectories;
[0016] Each of the historical arm states is sequentially input into the neural network to obtain the predicted trajectory corresponding to each historical arm state;
[0017] Calculate the error value between the predicted trajectory and the actual trajectory for each of the historical arm states;
[0018] The parameters in the neural network model are updated based on the error value to obtain the preset path planning model.
[0019] Furthermore, after the step of inputting the current state of each of the arm parameters into a preset path planning model to obtain the planned motion path of the specified robotic arm, the method further includes:
[0020] Obtain the link length of the specified robotic arm;
[0021] Based on the link length, the link offset, rotation angle of each joint, and angle between the link and the joint axis of the specified robotic arm are obtained in the planned motion path.
[0022] According to the formula Calculate the position transformation matrix; where, The rotation angle of each arm joint, This is the linkage offset. Indicates the length of the robotic arm link. This indicates the angle between the connecting rod and the joint axis. The position transformation matrix, Indicates the angle as The cosine value, Indicates the angle as The sine value;
[0023] The rationality of the planned motion path is determined based on the position transformation matrix.
[0024] Furthermore, after the step of determining whether the planned motion path is reasonable based on the position transformation matrix, the method further includes:
[0025] If it is unreasonable, then determine whether there are intersecting joint axes in the planned motion path;
[0026] If joint axes intersect, the planned motion path is reduced in dimensionality to obtain a re-planned motion path.
[0027] Furthermore, after the step of controlling the torque of the designated robotic arm on the planned motion path based on the variable structure motion law, the method further includes:
[0028] The designated robotic arm is controlled to move based on the planned motion path, and the real-time trajectory and real-time arm status of the designated robotic arm are obtained.
[0029] The real-time arm status is input into a preset neural network to obtain the predicted optimal trajectory;
[0030] Calculate the difference between the real-time trajectory and the predicted optimal trajectory;
[0031] The parameters of the motion model are updated based on the difference in the trajectories.
[0032] Furthermore, in the step of controlling the designated robotic arm to move based on the planned motion path and obtaining the real-time trajectory and real-time arm status of the designated robotic arm, the step of obtaining the real-time arm status includes:
[0033] Obtain the initial state of the specified robotic arm and the motion time of the specified robotic arm;
[0034] The variable structure motion law, the planned motion path, the motion time, and the initial state are input into a preset intelligent agent to obtain the real-time arm state.
[0035] A torque compensation device for a robotic arm, the device comprising:
[0036] A module is established to obtain the joint positions and motion angles of each joint of a specified robotic arm, and to establish a motion model of the robotic arm based on the joint positions and motion angles of each joint.
[0037] The analysis module is used to perform dynamic analysis on the motion model using the Lagrange square to obtain the control law of the robotic arm;
[0038] The compensation module is used to compensate the torque of the specified robotic arm based on the control law to obtain the ideal state of each arm parameter under the ideal trajectory of the robotic arm;
[0039] The setting module is used to set the bounded envelope function of the control law according to the ideal state of each arm parameter, and obtain the variable structure motion law of the specified robotic arm through a preset Lyapunov function based on the bounded envelope function.
[0040] The acquisition module is used to acquire the planned motion path of the specified robotic arm;
[0041] The control module is used to control the torque of the specified robotic arm on the planned motion path based on the variable structure motion law.
[0042] An electronic device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the following steps:
[0043] Obtain the joint positions and motion angles of each joint of a specified robotic arm, and establish a motion model of the robotic arm based on the joint positions and motion angles of each joint.
[0044] The motion model is subjected to dynamic analysis using the Lagrange square to obtain the control law of the robotic arm;
[0045] Based on the control law, the torque of the specified robotic arm is compensated to obtain the ideal state of each arm parameter under the ideal trajectory of the robotic arm;
[0046] Based on the ideal state of each arm parameter, a bounded envelope function of the control law is set, and based on the bounded envelope function, the variable structure motion law of the specified robotic arm is obtained through a preset Lyapunov function.
[0047] Obtain the planned motion path of the specified robotic arm;
[0048] Based on the aforementioned variable structure motion law, torque control is achieved on the designated robotic arm along the planned motion path.
[0049] A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the following steps:
[0050] Obtain the joint positions and motion angles of each joint of a specified robotic arm, and establish a motion model of the robotic arm based on the joint positions and motion angles of each joint.
[0051] The motion model is subjected to dynamic analysis using the Lagrange square to obtain the control law of the robotic arm;
[0052] Based on the control law, the torque of the specified robotic arm is compensated to obtain the ideal state of each arm parameter under the ideal trajectory of the robotic arm;
[0053] Based on the ideal state of each arm parameter, a bounded envelope function of the control law is set, and based on the bounded envelope function, the variable structure motion law of the specified robotic arm is obtained through a preset Lyapunov function.
[0054] Obtain the planned motion path of the specified robotic arm;
[0055] Based on the aforementioned variable structure motion law, torque control is achieved on the designated robotic arm along the planned motion path.
[0056] The beneficial effects of this invention are as follows: Based on the Lagrange dynamics model, a complete control equation including the inertia matrix, centrifugal force matrix and gravity term is constructed, and a control law is introduced to characterize the modeling error and external disturbance. Furthermore, a bounded envelope function for the uncertain part is designed to achieve dynamic compensation and control of torque disturbance. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] in:
[0059] Figure 1 This is an application environment diagram of the torque compensation method for a robotic arm in one embodiment;
[0060] Figure 2 This is a flowchart of a torque compensation method for a robotic arm in one embodiment;
[0061] Figure 3 This is a structural block diagram of the torque compensation device for a robotic arm in one embodiment;
[0062] Figure 4 This is a structural block diagram of an electronic device in one embodiment. Detailed Implementation
[0063] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0064] Figure 1 This is a diagram illustrating the application environment of torque compensation for a robotic arm in one embodiment. (Refer to...) Figure 1The torque compensation method for this robotic arm is applied to a torque compensation system for the robotic arm. This torque compensation system includes a terminal 110 and a server 120. The terminal 110 and server 120 are connected via a network. The terminal 110 can be a desktop terminal or a mobile terminal; the mobile terminal can be at least one of a mobile phone, tablet, or laptop. The server 120 can be a standalone server or a server cluster consisting of multiple servers. The terminal 110 is used to acquire the joint positions and motion angles of each joint of a specified robotic arm, and the server 120 is used to implement torque control of the specified robotic arm along the planned motion path.
[0065] like Figure 2 As shown, in one embodiment, a torque compensation method for a robotic arm is provided. This method can be applied to both terminals and servers; this embodiment uses terminal application as an example. The torque compensation method for the robotic arm specifically includes the following steps:
[0066] S1: Obtain the joint positions and motion angles of each joint of the specified robotic arm, and establish the motion model of the robotic arm based on the joint positions and motion angles of each joint.
[0067] S2: Perform dynamic analysis on the motion model using the Lagrange square to obtain the control law of the robotic arm;
[0068] S3: Based on the control law, the torque of the specified robotic arm is compensated to obtain the ideal state of each arm parameter under the ideal trajectory of the robotic arm;
[0069] S4: Based on the ideal state of each arm parameter, set the bounded envelope function of the control law, and based on the bounded envelope function, obtain the variable structure motion law of the specified robotic arm through the preset Lyapunov function;
[0070] S5: Obtain the planned motion path of the specified robotic arm;
[0071] S6: Based on the variable structure motion law, torque control is achieved on the designated robotic arm along the planned motion path.
[0072] As described in step S1 above, the joint positions and motion angles of each joint of the specified robotic arm are obtained, and a motion model of the robotic arm is established based on the joint positions and motion angles of each joint. Joint positions are usually represented in coordinates, referring to the position of each joint relative to the base coordinate system within the workspace, while motion angles involve the rotation angles of each joint. Based on this data, a motion model can be established to simulate the behavior of the robotic arm. Commonly used methods include inverse kinematics and forward kinematics to solve for the pose changes of the robotic arm during motion. The motion model is the foundation of the entire control system; it defines the motion laws of the robotic arm at different joint angles and positions, including dynamic characteristics such as velocity and acceleration.
[0073] Specifically, let the motion coordinates of the robotic arm be Q(x,y), the joints be O, A, and B, and the motion angle be θ. Establish the motion model of the robotic arm as follows:
[0074]
[0075] In the formula: M is the established motion model of the robot arm. , This refers to the angle of joint movement.
[0076] As described in step S2 above, a dynamic analysis of the motion model is performed using the Lagrange square method to obtain the control laws of the robotic arm. The robotic arm motion model established in the previous step is dynamically analyzed using Lagrange mechanics. The Lagrange method is a system analysis method widely used in physics and engineering, emphasizing the conservation of energy and energy conversion processes. Lagrange equations are established, which consist of the system's kinetic and potential energy. The dynamic equations of the robotic arm are derived using the principle of energy conservation. These equations describe the dynamic characteristics of the robotic arm under the influence of external forces and internal motion, including acceleration, velocity, and position. By solving these equations, the control laws of the robotic arm can be obtained. These laws form the basis for subsequent torque compensation, ensuring the stability and flexibility of the robotic arm during operation.
[0077] Specifically, based on the established motion model of the robotic arm, assuming the position of the robotic arm is represented by ω(t), the dynamics of the robotic arm are analyzed using the square of the Lagrange multiplier:
[0078]
[0079] In the formula: L is the Lagrange function, U is the sum of the kinetic energies of the arms, and D is the sum of the potential energies of the arms. Let i be the generalized torque of joint i. Here are the coordinates of the joint. Let δ be the velocity of motion, t be the joint motion coefficient, and t be the time. Acceleration of arm joint movement.
[0080] As described in step S3 above, the torque of the specified robotic arm is compensated based on the control law to obtain the ideal state of each arm parameter under the ideal trajectory of the robotic arm. Based on the control law obtained in the first two steps, the torque of the robotic arm under the ideal working state is compensated. The purpose of torque compensation is to correct torque interference caused by environmental changes, load changes, or other external factors, so that the robotic arm can accurately execute the movement according to the preset trajectory. By comparing the current torque with the torque under the ideal state, the compensation value to be applied can be calculated. In addition, the compensation process also needs to consider the dynamic response characteristics of the robotic arm to ensure that no new unstable factors are introduced during the compensation process, so that the robotic arm can smoothly follow the ideal trajectory.
[0081] Specifically, because the robotic arm's range of motion can be freely adjusted to adapt to different working environments and it possesses high flexibility, the control law for the robotic arm's movement is derived as follows:
[0082]
[0083] in, It is the inertia matrix of the robotic arm. It is the inertia matrix of an ideal robotic arm. It is a centrifugal force matrix. It is an ideal centrifugal force matrix. It is the gravity term of the robotic arm. This is the ideal gravity term, where p represents the actual joint angle of the robotic arm. Angular velocity, Angular acceleration. Expression This represents the motion pattern of the robotic arm. 'e' represents the joint angle of the robotic arm, fed back from the model. Indicates angular velocity feedback. Indicates angular acceleration feedback, It is a diagonal gain matrix. This indicates an error term in gravity modeling, caused by incomplete modeling or parameter drift. This indicates the effect of the error term in the centrifugal force matrix on the angular velocity. This represents the error term of inertial disturbance torque caused by inaccurate inertial matrix modeling (e.g., mass, link parameters, configuration errors, etc.).
[0084] Based on the aforementioned motion laws of the robotic arm, torque compensation and processing are performed. The fuzzy and uncertain parts of the robotic arm are defined as... This allows us to obtain the state of each parameter under the ideal trajectory of the robotic arm.
[0085]
[0086] In the formula: For the parameters of the uncertain part of the robotic arm, It is a constant. For the ideal joint angle of the robotic arm, For the ideal joint angular velocity of the robotic arm, This represents the ideal joint angular acceleration for the robotic arm.
[0087] As described in step S4 above, a bounded envelope function of the control law is set according to the ideal state of each arm parameter. Based on the bounded envelope function, the variable structure motion law of the specified robotic arm is obtained through a preset Lyapunov function. The bounded envelope function of the control law is constructed based on the ideal state of the arm. This envelope function describes the motion behavior of the robotic arm, ensuring that the motion is within a safe and controllable range. Furthermore, the stability of the system can be effectively analyzed by utilizing the design of the Lyapunov function. The Lyapunov method is a classic method for analyzing the stability of nonlinear systems, proving the asymptotic stability of the system under certain conditions by constructing a positive definite Lyapunov function. Combining the bounded envelope function with the Lyapunov function can help design a variable structure controller, achieving efficient control of the robotic arm in dynamic working conditions, thereby maintaining the stability and accuracy of its motion trajectory under certain errors.
[0088] Based on the calculation results of the above steps, a bounded envelope function for the uncertain part of the robotic arm is established.
[0089]
[0090] In the formula: The impact of the uncertainty of the arm on the overall uncertainty. Let X be the equation of state for the arm.
[0091]
[0092] In the formula: x is the state variable of the arm, These are two forms of the arm moment matrix, where h(x) is the ideal robotic arm dynamics function term; The channel matrix (input gain matrix) represents the influence of the uncertainty term η on the system.
[0093] To plan the global stability of the robotic arm's motion model, a Lyapunov function needs to be established to re-acquire the variable structure motion law of the robotic arm:
[0094]
[0095] in, Here, T is the constructed Lyapunov function, b is the iterative function, b is the nonlinear switching gain coefficient in the variable structure control law, and H is the parameter of the variable structure controller. Ultimately, through the variable structure motion law of the robotic arm obtained above, torque control of the robotic arm is achieved.
[0096] As described in step S5 above, the planned motion path of the specified robotic arm is obtained. Planning the robotic arm's motion path is a crucial step in the entire control process. Effective path planning can minimize the energy consumption of the robotic arm during movement and improve work efficiency. Path planning can be accomplished using algorithms, such as the A* algorithm, Dijkstra's algorithm, or heuristic algorithms, with the goal of enabling the robotic arm to move smoothly and quickly from the starting point to the target point, taking into account factors such as collision avoidance and environmental changes during movement. Path planning not only needs to consider the geometry of the motion trajectory but also time parameters to ensure that the robotic arm's speed and acceleration on the path conform to actual conditions.
[0097] As described in step S6 above, torque control of the designated robotic arm along the planned motion path is achieved based on the variable structure motion law. The obtained control law and variable structure motion law are combined with the current state of the robotic arm, and the motion state of the robotic arm is adjusted through a real-time feedback control system to ensure that it operates accurately and effectively along the planned motion path. Torque control is particularly important in this step because the control system must adjust in real time to respond to changes in the external environment and the state of the internal system. Commonly used methods include PID control, advanced fuzzy control, and neural network control, aiming to achieve high-precision torque control to cope with various challenges that may be encountered during motion, ensuring that the robotic arm maintains stable and efficient performance throughout the process. Through this comprehensive control strategy, the robotic arm can achieve high-precision, high-stability, and high-flexibility motion.
[0098] In one embodiment, step S5 of obtaining the planned motion path of the specified robotic arm includes:
[0099] S501: Obtain the current state of each arm parameter corresponding to the specified robotic arm;
[0100] S502: Input the current state of each of the arm parameters into the preset path planning model to obtain the planned motion path of the specified robotic arm.
[0101] As described in steps S501-S502 above, the current state of each arm parameter of the robotic arm is acquired. Since the movement and performance of the robotic arm are directly related to the state of each arm parameter, these parameters typically include position, posture, velocity, acceleration, load, and joint angles. Therefore, various sensors are needed to monitor these parameters in real time. For example, position sensors (such as encoders or laser sensors) and force sensors can provide accurate real-time data to help the system understand the state of the robotic arm at a specific point in time. Furthermore, the control system needs to update this data periodically or under certain conditions to ensure immediate feedback on the motion state. The acquired current state is then input into a preset path planning model to calculate the planned motion path of the robotic arm.
[0102] In one embodiment, before step S502, which involves inputting the current state of each of the arm parameters into a preset path planning model to obtain the planned motion path of the specified robotic arm, the method further includes:
[0103] S5011: Acquire multiple sets of training data; one set of training data includes historical arm states and corresponding actual trajectories;
[0104] S5012: Input each of the historical arm states into the neural network in sequence to obtain the predicted trajectory corresponding to each of the historical arm states;
[0105] S5013: Calculate the error value between the predicted trajectory and the actual trajectory for each of the historical arm states;
[0106] S5014: Update the parameters in the neural network model based on the error value to obtain the preset path planning model.
[0107] As described in steps S5011-S5014 above, multiple sets of training data are acquired. The training data includes historical arm states and corresponding actual trajectories, forming the basis for training the neural network. Historical arm states typically refer to the records of parameters such as angles, positions, and speeds of each joint at a specific point in time, while the actual trajectory is the path actually traversed by the robotic arm during task execution. Data can be obtained by monitoring and recording the robotic arm's motion in a real environment or by generating it through simulation software. The historical arm states acquired in the first step are organized into input features and sequentially input into a pre-designed neural network. After inputting the historical arm states, the neural network utilizes its multi-layered structure, employing various weights and activation functions to process the input data and output a predicted trajectory corresponding to each historical arm state. This neural network can be a convolutional neural network (CNN) or a recurrent neural network (RNN) to better handle time-series data. The generation of the predicted trajectory is based on the neural network's understanding of historical states, aiming to teach the network how the ideal motion trajectory of the robotic arm should change under a given state. S5013: Calculate the error value between the predicted trajectory and the actual trajectory for each historical arm state. The performance of the neural network is evaluated by calculating the error value between the predicted trajectory and the actual trajectory for each historical arm state. The error value can be the mean squared error (MSE) or other loss functions to quantify the deviation between the predicted trajectory and the actual trajectory. Based on the error values calculated in the previous steps, the parameters in the neural network model are updated. By calculating the gradient of the loss function, i.e., the derivative of the error with respect to each model parameter, the method for adjusting the parameters to reduce the overall error is determined. The update rule can employ the traditional gradient descent method or its variants (such as the Adam optimization algorithm) to ensure that the parameters migrate in the optimal direction. This process is iterative, gradually improving the model's predictive ability until the error is reduced to an acceptable range. In this way, the continuously optimized neural network forms a preset path planning model, which can provide effective guidance and adjustment for the movement of the robotic arm in future path planning.
[0108] In one embodiment, after step S502, which involves inputting the current state of each of the arm parameters into a preset path planning model to obtain the planned motion path of the specified robotic arm, the method further includes:
[0109] S5031: Obtain the link length of the specified robotic arm;
[0110] S5032: Based on the link length, obtain the link offset, rotation angle of each joint, and angle between the link and the joint axis of the specified robotic arm in the planned motion path;
[0111] S5033: According to the formula Calculate the position transformation matrix; where, The rotation angle of each arm joint, This is the linkage offset. Indicates the length of the robotic arm link. This indicates the angle between the connecting rod and the joint axis. The position transformation matrix, Indicates the angle as The cosine value, Indicates the angle as The sine value;
[0112] S5034: Determine whether the planned motion path is reasonable based on the position transformation matrix.
[0113] As described in steps S5031-S5034 above, the link lengths of the specified robotic arm are obtained. Link length refers to the actual physical length of each connecting link in the robotic arm. Methods for obtaining link lengths may include direct measurement, consulting the robotic arm's design documents or parameter manuals, etc. Based on the obtained link lengths, several key parameters required for planning the motion path are further derived, including link offset, the rotation angle of each joint, and the angle between the link and the joint axis. Link offset refers to the displacement of the link relative to its initial position during actual execution in a specific motion path. During joint movement, the rotation angle of each joint refers to the specific angle the joint needs to rotate during movement, which is crucial for calculating the actual position of the robotic arm in the workspace. Furthermore, the angle between the link and the joint axis is a reference angle used to describe the specific geometric relationship between the link and the joint. Based on the obtained link lengths, joint rotation angles, and other relevant parameters, the position transformation matrix is calculated. The position transformation matrix typically describes the spatial transformations of the robotic arm during movement through a series of mathematical operations, including translation and rotation. Commonly used transformation matrix forms include homogeneous coordinate transformation, which combines the displacement and rotation of the robotic arm, and can concisely represent the spatial relationships between different joints and links in matrix form. Through mathematical formulas, such as the Denavit-Hartenberg (DH) parameter method, the length of the link and the rotation of the joint can be integrated to form a unified transformation matrix. Based on the previously calculated position transformation matrix, the rationality of the planned motion path is judged. This process can be achieved by comparing the expected end effector position with the calculated actual end effector position based on the transformation matrix. If the position represented by the transformation matrix matches the target position in the original planned motion path, then the path is considered reasonable. If they do not match, the path design is considered problematic, such as an overly steep motion curve or exceeding the joint rotation limits.
[0114] Specifically, the motion trajectory of a robotic arm can be viewed as a motion process within a coordinate system. During coordinate transformation, path planning must consider not only the angle between the length of the robotic arm link and the horizontal angle, but also the angle between the offset of the robotic arm joint and the link. Definition Let the position transformation matrix of the robot arm be defined within the spatial range.
[0115] The goal of collision detection is to determine whether the robotic arm intersects or overlaps with obstacles during its movement.
[0116] The rotation angle of each arm joint, The following formula can be used to calculate the linkage offset:
[0117]
[0118] in, Indicates the length of the robotic arm link. This represents the angle between the link and the joint axis. Let P be the kinematic chain of the robotic arm, which consists of multiple robotic arm nodes. The position transformation matrix, Indicates the angle as The cosine value, Indicates the angle as The sine value.
[0119] In one embodiment, after step S5034 of determining whether the planned motion path is reasonable based on the position transformation matrix, the method further includes:
[0120] S5035: If it is unreasonable, determine whether there are intersecting joint axes in the planned motion path;
[0121] S5036: If there are intersecting joint axes, the planned motion path is reduced in dimensionality to obtain a re-planned motion path.
[0122] As described in step S5035 above, when solving for the optimal trajectory of the robotic arm within a confined space, if its joint axes intersect at a certain point, dimensionality reduction can be performed using high-dimensional equations to solve for the optimal path. To ensure the smooth and continuous motion of the robotic arm as a whole, each node of the robotic arm is sequentially designated as the first node, second node, ... according to its connection relationship with the control terminal. Initial processing of the robotic arm is performed first, cutting off the first node. and move it to zero; move the node The degrees of freedom are set to 0, and the rotation angles and angular variables of each joint are calculated to establish a reference posture for the robotic arm at the zero point, facilitating subsequent path calculation and optimization. During this process, the degrees of freedom and rotation distance of each joint must be comprehensively considered to ensure the continuity and consistency of the robotic arm's movement. Furthermore, by setting appropriate degrees of freedom and calculating the rotation angles and angular variables, not only can the range of motion of the robotic arm in each direction be determined, but the angular differences between joints can also be obtained, thereby achieving coordinated and consistent movement of all joints.
[0123] In one embodiment, after step S6, which involves controlling the torque of the designated robotic arm on the planned motion path based on the variable structure motion law, the method further includes:
[0124] S701: Control the designated robotic arm to move based on the planned motion path, and obtain the real-time trajectory and real-time arm status of the designated robotic arm;
[0125] S702: Input the real-time arm status into a preset neural network to obtain the predicted optimal trajectory;
[0126] S703: Calculate the difference between the real-time trajectory and the predicted optimal trajectory;
[0127] S704: Update the parameters of the motion model based on the difference in the trajectories.
[0128] As described in steps S701-S704 above, a BP neural network function is introduced. By training the neural network, the motion patterns of the robotic arm under different states can be learned and fitted. After training, the BP neural network function can use the current arm state as input to predict the optimal trajectory value. Subsequently, valuable feedback error information is obtained by calculating the difference between the actual trajectory and the predicted trajectory. These feedback errors help evaluate the accuracy and precision of the robotic arm's motion model, thereby guiding improvements to the control strategy to enhance motion performance. Therefore, integrating the BP neural network function can optimize the motion control of the robotic arm, improving its accuracy and performance.
[0129] In one embodiment, in step S701, which involves controlling the designated robotic arm to move based on the planned motion path and obtaining the real-time trajectory and real-time arm status of the designated robotic arm, the step of obtaining the real-time arm status includes:
[0130] S7011: Obtain the initial state of the specified robotic arm and the motion time of the specified robotic arm;
[0131] S7012: Input the variable structure motion law, the planned motion path, the motion time, and the initial state into the preset intelligent agent to obtain the real-time arm state.
[0132] Let the learning variable be α, with an optimal value range of [0,1], the agent be γ, the equilibrium reward be αt, and the new cycle state be Zt+1. The agent γ can update the cycle state during the movement of the robotic arm. The update process of the cycle state is as follows:
[0133]
[0134] In the formula: The updated loop state value. The state of the agent. As a learning factor, This represents the initial loop state. To achieve the optimal trajectory of the robotic arm in a high-dimensional continuous space, it is beneficial to compare it with the actual trajectory and calculate the feedback error. An effective method is to introduce a BP neural network function. By training the neural network, the motion patterns of the robotic arm under different states can be learned and fitted. After training, the BP neural network function can use the current arm state as input to predict the optimal trajectory value. Subsequently, valuable feedback error information is obtained by calculating the difference between the actual trajectory and the predicted trajectory. These feedback errors help evaluate the accuracy and precision of the robotic arm's motion model, thereby guiding improvements to the control strategy to enhance motion performance. Therefore, integrating a BP neural network function can optimize the motion control of the robotic arm, improving its accuracy and performance. The formula for calculating the feedback error value of the robotic arm trajectory is as follows:
[0135]
[0136] In the formula: This is the feedback error value of the robotic arm. This is the incentive coefficient.
[0137] BQ formation update
[0138] When optimizing a robotic arm trajectory using the Q-learning algorithm, the resulting Q function can serve as an indicator for evaluating the optimal state of the output path. By establishing and initializing a Q-value table, the next motion state of the robotic arm is determined in conjunction with the R-value. Subsequently, a BP neural network is used to update the Q-values, where the input vector of the neuron is denoted as... The corresponding weight is And select an appropriate activation function to calculate the Q value of the robotic arm.
[0139]
[0140] In the formula: This is the output of the neural network model; Here, q is the weighting factor, and k is a constant. Based on the above results, the q-value of the best approximation update algorithm for neural networks is calculated using the following formula:
[0141]
[0142] in Update the final Q value. The reward value is determined when the arm's movement changes from... Become At that time, the corresponding result can be obtained. The learning factor converges faster as the Q-value iteration efficiency increases.
[0143] Reference Figure 3 The present invention also provides a torque compensation device for a robotic arm, the device comprising:
[0144] A module 902 is established to obtain the joint positions and motion angles of each joint of a specified robotic arm, and to establish a motion model of the robotic arm based on the joint positions and motion angles of each joint.
[0145] Analysis module 904 is used to perform dynamic analysis on the motion model using Lagrange squares to obtain the control law of the robotic arm;
[0146] The compensation module 906 is used to compensate the torque of the specified robotic arm based on the control law to obtain the ideal state of each arm parameter under the ideal trajectory of the robotic arm;
[0147] The setting module 908 is used to set the bounded envelope function of the control law according to the ideal state of each arm parameter, and obtain the variable structure motion law of the specified robotic arm through a preset Lyapunov function based on the bounded envelope function.
[0148] The acquisition module 910 is used to acquire the planned motion path of the specified robotic arm;
[0149] The control module 912 is used to control the torque of the specified robotic arm on the planned motion path based on the variable structure motion law.
[0150] In one embodiment, the acquisition module 910 includes:
[0151] The current state acquisition submodule is used to acquire the current state of each arm parameter corresponding to the specified robotic arm;
[0152] The current state input submodule is used to input the current state of each of the arm parameters into the preset path planning model in order to obtain the planned motion path of the specified robotic arm.
[0153] In one embodiment, the acquisition module 910 further includes:
[0154] The training data acquisition submodule is used to acquire multiple sets of training data; one set of training data includes the historical arm state and the corresponding actual trajectory.
[0155] The historical arm state input submodule is used to sequentially input each of the historical arm states into the neural network to obtain the predicted trajectory corresponding to each of the historical arm states;
[0156] The error value calculation submodule is used to calculate the error value between the predicted trajectory and the actual trajectory for each of the historical arm states;
[0157] The parameter update submodule is used to update the parameters in the neural network model according to the error value to obtain the preset path planning model.
[0158] In one embodiment, the acquisition module 910 further includes:
[0159] The link length acquisition submodule is used to acquire the link length of the specified robotic arm;
[0160] The link parameter acquisition submodule is used to acquire, based on the link length, the link offset, the rotation angle of each joint, and the angle between the link and the joint axis of the specified robotic arm in the planned motion path.
[0161] The position transformation matrix calculation submodule is used to calculate the position transformation matrix according to the formula. Calculate the position transformation matrix; where, The rotation angle of each arm joint, This is the linkage offset. Indicates the length of the robotic arm link. This indicates the angle between the connecting rod and the joint axis. The position transformation matrix, Indicates the angle as The cosine value, Indicates the angle as The sine value;
[0162] The planned motion path rationality judgment submodule is used to determine whether the planned motion path is reasonable based on the position transformation matrix.
[0163] In one embodiment, the acquisition module 910 further includes:
[0164] The joint axis intersection judgment submodule is used to determine whether there is a joint axis intersection in the planned motion path if it is unreasonable.
[0165] The dimensionality reduction submodule is used to perform dimensionality reduction processing on the planned motion path if there are intersecting joint axes, so as to obtain the replanned planned motion path.
[0166] In one embodiment, the torque compensation device for the robotic arm further includes:
[0167] The real-time arm status acquisition module is used to control the designated robotic arm to move based on the planned motion path, and to acquire the real-time trajectory and real-time arm status of the designated robotic arm.
[0168] The optimal trajectory acquisition module is used to input the real-time arm state into a preset neural network to obtain the optimal trajectory prediction.
[0169] The trajectory difference calculation module is used to calculate the trajectory difference between the real-time trajectory and the predicted optimal trajectory;
[0170] The parameter update module is used to update the parameters of the motion model based on the difference in the trajectories.
[0171] In one embodiment, the real-time arm status acquisition module includes:
[0172] The initial state acquisition submodule is used to acquire the initial state of the specified robotic arm and the motion time of the specified robotic arm;
[0173] The real-time arm status acquisition submodule is used to input the variable structure motion law, the planned motion path, the motion time, and the initial state into a preset intelligent agent to obtain the real-time arm status.
[0174] Figure 4 An internal structural diagram of an electronic device in one embodiment is shown. This electronic device can specifically be a terminal or a server, and more specifically, a computer device. Figure 4 As shown, the electronic device includes a processor, a memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a torque compensation method for the robotic arm. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to implement the torque compensation method for the robotic arm. Those skilled in the art will understand that... Figure 4The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0175] In one embodiment, an electronic device is provided, including a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the following steps:
[0176] Obtain the joint positions and motion angles of each joint of a specified robotic arm, and establish a motion model of the robotic arm based on the joint positions and motion angles of each joint.
[0177] The motion model is subjected to dynamic analysis using the Lagrange square to obtain the control law of the robotic arm;
[0178] Based on the control law, the torque of the specified robotic arm is compensated to obtain the ideal state of each arm parameter under the ideal trajectory of the robotic arm;
[0179] Based on the ideal state of each arm parameter, a bounded envelope function of the control law is set, and based on the bounded envelope function, the variable structure motion law of the specified robotic arm is obtained through a preset Lyapunov function.
[0180] Obtain the planned motion path of the specified robotic arm;
[0181] Based on the aforementioned variable structure motion law, torque control is achieved on the designated robotic arm along the planned motion path.
[0182] Based on the Lagrange dynamics model, a complete control equation including the inertia matrix, centrifugal force matrix and gravity term was constructed. Control laws were introduced to characterize modeling errors and external disturbances. Furthermore, a bounded envelope function for the uncertain part was designed to achieve dynamic compensation and control of torque disturbances.
[0183] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, causes the processor to perform the following steps:
[0184] Obtain the joint positions and motion angles of each joint of a specified robotic arm, and establish a motion model of the robotic arm based on the joint positions and motion angles of each joint.
[0185] The motion model is subjected to dynamic analysis using the Lagrange square to obtain the control law of the robotic arm;
[0186] Based on the control law, the torque of the specified robotic arm is compensated to obtain the ideal state of each arm parameter under the ideal trajectory of the robotic arm;
[0187] Based on the ideal state of each arm parameter, a bounded envelope function of the control law is set, and based on the bounded envelope function, the variable structure motion law of the specified robotic arm is obtained through a preset Lyapunov function.
[0188] Obtain the planned motion path of the specified robotic arm;
[0189] Based on the aforementioned variable structure motion law, torque control is achieved on the designated robotic arm along the planned motion path.
[0190] Based on the Lagrange dynamics model, a complete control equation including the inertia matrix, centrifugal force matrix and gravity term was constructed. Control laws were introduced to characterize modeling errors and external disturbances. Furthermore, a bounded envelope function for the uncertain part was designed to achieve dynamic compensation and control of torque disturbances.
[0191] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0192] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0193] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A torque compensation method for a robotic arm, characterized in that, The method includes: Obtain the joint positions and motion angles of each joint of a specified robotic arm, and establish a motion model of the robotic arm based on the joint positions and motion angles of each joint. The motion model is analyzed using the Lagrange equations to obtain the control laws of the robotic arm. Based on the control law, the torque of the specified robotic arm is compensated to obtain the ideal state of each arm parameter under the ideal trajectory of the robotic arm; Based on the ideal state of each arm parameter, a bounded envelope function of the control law is set, and based on the bounded envelope function, the variable structure motion law of the specified robotic arm is obtained through a preset Lyapunov function. Obtain the planned motion path of the specified robotic arm; Based on the aforementioned variable structure motion law, torque control is achieved on the designated robotic arm along the planned motion path.
2. The torque compensation method for a robotic arm according to claim 1, characterized in that, The step of obtaining the planned motion path of the specified robotic arm includes: Obtain the current state of each arm parameter corresponding to the specified robotic arm; The current state of each of the arm parameters is input into a preset path planning model to obtain the planned motion path of the specified robotic arm.
3. The torque compensation method for a robotic arm according to claim 2, characterized in that, Before the step of inputting the current state of each of the arm parameters into the preset path planning model to obtain the planned motion path of the specified robotic arm, the method further includes: Acquire multiple sets of training data; one set of training data includes historical arm states and corresponding actual trajectories; Each of the historical arm states is sequentially input into the neural network to obtain the predicted trajectory corresponding to each historical arm state; Calculate the error value between the predicted trajectory and the actual trajectory for each of the historical arm states; The parameters in the neural network model are updated based on the error value to obtain the preset path planning model.
4. The torque compensation method for a robotic arm according to claim 2, characterized in that, After the step of inputting the current state of each of the arm parameters into the preset path planning model to obtain the planned motion path of the specified robotic arm, the method further includes: Obtain the link length of the specified robotic arm; Based on the link length, the link offset, rotation angle of each joint, and angle between the link and the joint axis of the specified robotic arm are obtained in the planned motion path. According to the formula Calculate the position transformation matrix; where, The rotation angle of each arm joint, This is the linkage offset. Indicates the length of the robotic arm link. This indicates the angle between the connecting rod and the joint axis. The position transformation matrix, Indicates the angle as The cosine value, Indicates the angle as The sine value; The rationality of the planned motion path is determined based on the position transformation matrix.
5. The torque compensation method for a robotic arm according to claim 4, characterized in that, After the step of determining whether the planned motion path is reasonable based on the position transformation matrix, the method further includes: If it is unreasonable, then determine whether there are intersecting joint axes in the planned motion path; If joint axes intersect, the planned motion path is reduced in dimensionality to obtain a re-planned motion path.
6. The torque compensation method for a robotic arm according to claim 1, characterized in that, After the step of controlling the torque of the designated robotic arm on the planned motion path based on the variable structure motion law, the method further includes: The designated robotic arm is controlled to move based on the planned motion path, and the real-time trajectory and real-time arm status of the designated robotic arm are obtained. The real-time arm status is input into a preset neural network to obtain the predicted optimal trajectory; Calculate the difference between the real-time trajectory and the predicted optimal trajectory; The parameters of the motion model are updated based on the difference in the trajectories.
7. The torque compensation method for a robotic arm according to claim 6, characterized in that, In the step of controlling the designated robotic arm to move based on the planned motion path and obtaining the real-time trajectory and real-time arm status of the designated robotic arm, the step of obtaining the real-time arm status includes: Obtain the initial state of the specified robotic arm and the motion time of the specified robotic arm; The variable structure motion law, the planned motion path, the motion time, and the initial state are input into a preset intelligent agent to obtain the real-time arm state.
8. A torque compensation device for a robotic arm, characterized in that, The device includes: A module is established to obtain the joint positions and motion angles of each joint of a specified robotic arm, and to establish a motion model of the robotic arm based on the joint positions and motion angles of each joint. The analysis module is used to perform dynamic analysis on the motion model using the Lagrange equation to obtain the control law of the robotic arm. The compensation module is used to compensate the torque of the specified robotic arm based on the control law to obtain the ideal state of each arm parameter under the ideal trajectory of the robotic arm; The setting module is used to set the bounded envelope function of the control law according to the ideal state of each arm parameter, and obtain the variable structure motion law of the specified robotic arm through a preset Lyapunov function based on the bounded envelope function. The acquisition module is used to acquire the planned motion path of the specified robotic arm; The control module is used to control the torque of the specified robotic arm on the planned motion path based on the variable structure motion law.
9. A computer-readable storage medium, characterized in that, The system contains a computer program that, when executed by a processor, causes the processor to perform the steps of the torque compensation method for the robotic arm as described in any one of claims 1 to 7.
10. An electronic device, characterized in that, The device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the torque compensation method for the robotic arm as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Uncertain mechanical arm fixed time track following control method with input saturation
CN111152225A
Active control vibration isolation using dynamic manifold
US20050256613A1