Mechanical arm control method and device, computer equipment and storage medium
By parameterizing the joint space and constructing a cost function, the optimal inverse kinematics solution is selected, solving the complexity problem of solving redundant degrees of freedom robotic arms and achieving efficient and precise control of the robotic arm.
Patent Information
- Application Number
- CN202511781930.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-29
- Publication Date
- 2026-02-10
AI Technical Summary
In existing technologies, the inverse kinematics solution process of redundant degree-of-freedom robotic arms is complex, resulting in high computational resource consumption and difficulty in meeting the control response speed requirements of high real-time performance, thus limiting their application in humanoid robots and complex scenarios.
By introducing self-motion variables to parameterize the joint space of the robotic arm, a joint motion cost function is constructed. Candidate joint angles are traversed and the solution with the minimum total cost is selected. Control signals are then generated to drive the robotic arm's movement, achieving precise control of the end effector's pose.
It improves the accuracy, economy and reliability of robotic arm control, ensures the uniqueness and optimality of the inverse kinematics solution, and meets the control requirements of high real-time performance.
Smart Images

Figure CN121492029A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of automation control, in particular, to a mechanical arm control method and device, computer equipment and storage medium. BACKGROUND
[0002] With the rapid iteration of industrial automation, humanoid robots and other fields, the precision and flexibility of the motion control of the mechanical arm as the core execution component become the key to technological breakthrough. Especially the redundant degree of freedom mechanical arm such as seven degrees of freedom, because it has more joint adjustment space, can flexibly avoid obstacles in the work environment, avoid singular configuration, and is widely used in complex scenes such as precision manufacturing and human-computer collaboration. As the core link of mechanical arm control, inverse kinematics solving directly determines the implementation precision and response efficiency of the end pose.
[0003] In the inverse kinematics solving of the redundant degree of freedom mechanical arm, the existing technology often uses the generalized Jacobian matrix method. This method constrains the optimization model by taking the obstacle avoidance requirement as a secondary target, combining the primary requirements of the end pose, and then solving the unique joint angle combination to realize the precise control of the end pose.
[0004] However, the above-mentioned prior art has significant defects: the solving process of the generalized Jacobian matrix method involves complex matrix operations and iterative optimization of constraint conditions, which requires a large amount of computing resources, resulting in high delay in solving joint angles, making it difficult to meet the requirements of real-time interaction, dynamic work and other scenes of humanoid robots, and limiting the application expansion of redundant degree of freedom mechanical arms in high real-time demand scenes. SUMMARY
[0005] Therefore, the purpose of the present application is to provide a mechanical arm control method, device, computer equipment and storage medium, which can improve the precision, economy and reliability of mechanical arm control.
[0006] In a first aspect, the embodiments of the present application provide a mechanical arm control method, which comprises: obtaining a target end pose and an initial joint angle of a mechanical arm; based on the target end pose, introducing a self-motion variable to parameterize the joint space of the mechanical arm to obtain a plurality of candidate joint angles; constructing a joint motion cost function, and determining the total cost of moving from the initial joint angle to each group of candidate joint angles based on the joint motion cost function; traversing the value range of the self-motion variable, and selecting the solution with the minimum total cost from the plurality of candidate joint angles as the optimal inverse kinematics solution according to the joint motion cost function; generating a control signal based on the optimal inverse kinematics solution, and driving each joint of the robot arm to move, so that the end of the robot arm reaches the target end pose.
[0007] Optionally, based on the target end pose, a self-motion variable is introduced to parameterize the joint space of the robot arm, to obtain a plurality of groups of candidate joint angles, including: According to the target end pose, the coordinates of the origin of the wrist coordinate system in the base coordinate system are determined; Based on the coordinates of the origin of the wrist coordinate system, the coordinates of the shoulder joint, and the link length constraints of the robot arm, the motion trajectory of the elbow joint is parameterized through the self-motion variable; Based on the parameterized elbow motion trajectory, the plurality of groups of candidate joint angles are solved.
[0008] Optionally, the joint motion cost function is expressed as: ; wherein, is a preset weight of the j-th joint, is the j-th candidate joint angle corresponding to the self-motion variable is the initial angle of the j-th candidate joint.
[0009] Optionally, the configuration of the weight satisfies: The weight of the joint close to the base of the robot arm is greater than or equal to the weight of the joint close to the end.
[0010] Optionally, the range of values of the self-motion variable is traversed, and the solution with the minimum total cost is selected from the plurality of groups of candidate joint angles as the optimal inverse kinematics solution according to the joint motion cost function, including: The self-motion variable is traversed in the interval [0, 2π] with a preset step size, the candidate joint angle and the total cost corresponding to each value are calculated, and the candidate solution with the minimum total cost is selected.
[0011] Optionally, the control signal is generated based on the optimal inverse kinematics solution, and each joint of the robot arm is driven to move, so that the end of the robot arm reaches the target end pose, including: The optimal inverse kinematics solution is sent to the lower controller of the robot arm, and the lower controller combines obstacle avoidance and momentum balance control to generate the final joint driving signal.
[0012] Optionally, after obtaining the plurality of groups of candidate joint angles, before selecting the optimal inverse kinematics solution, the method further includes: Joint limit judgment is performed on the multiple sets of candidate joint angles, and invalid solutions containing angles that exceed the physical movement range of the robotic arm are discarded.
[0013] Secondly, embodiments of this application provide a robotic arm control device, the device comprising: The robotic arm data acquisition module is used to acquire the target end pose and initial joint angles of the robotic arm; The joint angle determination module is used to introduce self-motion variables to parameterize the joint space of the robotic arm based on the target end pose, and obtain multiple sets of candidate joint angles. The motion cost determination module is used to construct a joint motion cost function and determine the total cost of moving from the initial joint angle to each group of candidate joint angles based on the joint motion cost function. The inverse kinematics solution determination module is used to traverse the value range of the self-motion variables and select the solution with the minimum total cost from the multiple sets of candidate joint angles according to the joint motion cost function as the optimal inverse kinematics solution. The robotic arm control module is used to generate control signals based on the optimal inverse kinematics solution to drive the movement of each joint of the robotic arm, thereby enabling the end effector of the robotic arm to reach the target end effector pose.
[0014] Optionally, based on the target end-effector pose, the introduction of self-motion variables to parameterize the joint space of the robotic arm yields multiple sets of candidate joint angles, including: Based on the target end pose, determine the coordinates of the wrist coordinate system origin in the base coordinate system; Based on the coordinates of the origin of the wrist coordinate system, the coordinates of the shoulder joint, and the link length constraint of the robotic arm, the motion trajectory of the elbow joint is parameterized through the self-motion variable. Based on the parameterized elbow motion trajectory, the multiple sets of candidate joint angles are obtained.
[0015] Optionally, the joint motion cost function Represented as: ; in, For the first Preset weights for each joint, For the corresponding self-motion variables The Candidate joint angles For the first The initial angle of each candidate joint.
[0016] Optionally, the weight The configuration satisfies: The weight of the joints closer to the robot arm base is greater than or equal to the weight of the joints closer to the end effector.
[0017] Optionally, the step of traversing the range of values for the self-motion variables and selecting the solution with the minimum total cost from multiple candidate joint angles based on the joint motion cost function as the optimal inverse kinematic solution includes: The self-motion variables are traversed in the interval [0,2π] with a preset step size. The candidate joint angle and total cost corresponding to each value are calculated, and the candidate solution with the minimum total cost is selected.
[0018] Optionally, the step of generating control signals based on the optimal inverse kinematics solution to drive the movement of each joint of the robotic arm, thereby enabling the robotic arm end effector to reach the target end effector pose, includes: The optimal inverse kinematics solution is sent to the lower-level controller of the robotic arm, which combines obstacle avoidance and momentum balance control to generate the final joint drive signal.
[0019] Optionally, the device further includes a joint limit determination module, used for: After obtaining multiple sets of candidate joint angles, before selecting the optimal inverse kinematic solution, joint limit judgment is performed on the multiple sets of candidate joint angles, and invalid solutions containing angles that exceed the physical movement range of the robotic arm are discarded.
[0020] Thirdly, embodiments of this application provide a computer device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the robotic arm control method described in any of the optional embodiments of the first aspect are performed.
[0021] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the robotic arm control method described in any of the optional embodiments of the first aspect.
[0022] The technical solution provided in this application includes, but is not limited to, the following beneficial effects: The step of obtaining the target end-effector pose and initial joint angles of the robotic arm provides a clear input basis for the entire robotic arm control process. By accurately obtaining the end-effector pose (including position and attitude information) and initial joint angles, it ensures that all subsequent solutions and control operations have a clear benchmark and target orientation, effectively avoiding subsequent solution deviations caused by ambiguous or inaccurate input parameters, and laying the foundation for the accuracy of the control process.
[0023] By introducing self-motion variables based on the target end-effector pose to parameterize the joint space of the robotic arm, multiple sets of candidate joint angles are obtained, successfully solving the core problem that the joint angles are not unique after the end-effector pose of a robotic arm with redundant degrees of freedom is determined. Parameterizing the joint space using self-motion variables allows for a systematic traversal of feasible solutions in the joint space, generating multiple sets of candidate joint angles that meet the end-effector pose requirements. This provides a sufficient selection basis for subsequent screening of the optimal solution, ensuring the existence and diversity of the optimal solution.
[0024] A joint motion cost function was constructed, and based on this function, the total cost of moving from the initial joint angle to each group of candidate joint angles was determined, establishing an objective and quantitative solution evaluation standard. This cost function can accurately quantify the motion cost corresponding to each group of candidate joint angles, avoiding subjective judgments on candidate solutions. This provides a clear basis for comparing the merits of different candidate solutions, offering scientific quantitative support for subsequent selection of the optimal solution.
[0025] By traversing the range of values for the self-motion variables, and selecting the solution with the minimum total cost from multiple candidate joint angles based on the joint motion cost function, the optimal inverse kinematics solution is ensured. This comprehensive traversal of the self-motion variables allows for a complete examination of feasible solutions in joint space. Combining this with the cost function to select the solution with the lowest motion cost effectively reduces energy consumption and joint wear during robotic arm movement, improving the economy and reliability of the motion, while also guaranteeing the uniqueness of the inverse kinematics solution.
[0026] Control signals are generated based on the optimal inverse kinematics solution to drive the joints of the robotic arm to achieve the target pose at the end effector, completing the closed-loop control from solution to execution. This step transforms the abstract optimal joint angle solution into control signals that can directly drive joint movement, ensuring the effective implementation of the optimal solution. It enables precise control of the coordinated movement of each joint, ultimately achieving accurate end effector pose and improving the accuracy and effectiveness of robotic arm control.
[0027] In summary, the steps of the invention are progressive and synergistic, which not only solves the core problem that the inverse kinematics solution of a redundant degree-of-freedom robotic arm is not unique, but also ensures the optimality of the solution through quantitative evaluation and precise screening. Finally, through closed-loop control, the precise and economical achievement of the robotic arm's end-effector pose is realized, significantly improving the accuracy, economy and reliability of robotic arm control.
[0028] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0029] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 A flowchart of a robotic arm control method provided in Embodiment 1 of this application is shown; Figure 2 This paper shows a schematic diagram of the structure of a seven-degree-of-freedom robotic arm provided in Embodiment 1 of this application; Figure 3 A flowchart of a candidate joint angle determination method provided in Embodiment 1 of this application is shown; Figure 4 This paper shows a schematic diagram of a robotic arm structure and motion trajectory provided in Embodiment 1 of this application; Figure 5 This illustration shows a schematic diagram of a robotic arm coordinate system modeling provided in Embodiment 1 of this application; Figure 6 This paper shows a schematic diagram of a robotic arm structure in a three-dimensional coordinate system according to Embodiment 1 of this application; Figure 7 This paper shows a schematic diagram of the robotic arm structure in the second three-dimensional coordinate system provided in Embodiment 1 of this application; Figure 8 The flowchart of the inverse kinematic algorithm for a humanoid seven-DOF robotic arm provided in Embodiment 1 of this application is shown. Figure 9 This paper shows a schematic diagram of the structure of a robotic arm control device provided in Embodiment 2 of this application; Figure 10 A schematic diagram of the structure of a computer device provided in Embodiment 3 of this application is shown. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0032] Example 1 This application focuses on the inverse kinematics solution and control of a seven-DOF robotic arm (3 DDOF at the shoulder + 1 DDOF at the elbow + 3 DDOF at the wrist), which requires the combination of coordinate system construction, parametric analysis and cost calculation to achieve end-effector pose control.
[0033] To facilitate understanding of this application, the following is combined with... Figure 1 The flowchart illustrating a robotic arm control method provided in Embodiment 1 of this application will be used to describe Embodiment 1 of this application in detail.
[0034] See Figure 1 As shown, Figure 1 A flowchart of a robotic arm control method provided in Embodiment 1 of this application is shown, wherein the method includes steps S101 to S105: S101: Obtain the target end-effector pose and initial joint angle of the robotic arm.
[0035] Specifically, the target end-effector pose includes end-effector position parameters ( ) and terminal target attitude angle ( ),in These are used to describe the posture of the robotic arm's end effector in space.
[0036] See Figure 2 As shown, Figure 2 This diagram illustrates a seven-degree-of-freedom robotic arm according to Embodiment 1 of this application. The robotic arm has seven joints, starting from the base, and each joint is... Mark its joint angles. It is a rotary joint at the base. and It refers to the joints near the shoulder. For the elbow joint, , , The joints near the wrist determine the pose of the robotic arm's end effector by the angle change of each joint, reflecting the joint distribution and motion angle markings of the seven-degree-of-freedom robotic arm.
[0037] The initial joint angles are the initial angle values of each of the seven joints of the robotic arm, denoted as ( ), ~ These correspond to the initial angle states of the first to third joints of the shoulder, the fourth joint of the elbow, and the fifth to seventh joints of the wrist, respectively.
[0038] S102: Based on the target end pose, introduce self-motion variables to parameterize the joint space of the robotic arm and obtain multiple sets of candidate joint angles; Specifically, the introduced self-movement variables are denoted as... Its value ranges from [0, 2π]. This variable can be used to parameterize the motion trajectory of the elbow joint of the robotic arm. During the parameterization process, the E-coordinate system corresponding to the elbow is first defined. The trajectory of the elbow-related point B in the E-coordinate system satisfies: ; in, , The formula for calculating the included angle between the links is as follows: , The length of the link from the shoulder to the elbow. This refers to the length of the link from the elbow to the wrist. Constraints on the distance between the shoulder and wrist.
[0039] By letting By taking different values within [0, 2π], multiple sets of corresponding joint angles can be generated, namely candidate joint angles.
[0040] S103: Construct a joint motion cost function, and determine the total cost of moving from the initial joint angle to each group of candidate joint angles based on the joint motion cost function; Specifically, the expression for the joint motion cost function is as follows: ,in, For the first Preset weights for each joint, For the corresponding self-motion variables The Candidate joint angles For the first The initial angle of each candidate joint.
[0041] The total cost from the initial joint angle to the candidate joint angles requires calculating the sum of the costs of all joints for each group of candidate joint angles; that is, the expression for the total cost is: This formula can quantify the motion cost corresponding to each group of candidate joint angles.
[0042] S104: Traverse the range of values of the self-motion variables, and select the solution with the minimum total cost from the multiple sets of candidate joint angles according to the joint motion cost function as the optimal inverse kinematics solution; Specifically, self-movement variables The value range is fixed at [0, 2π]. The traversal process requires setting a preset exploration step size (the step size must be greater than 0 and less than π / 18 to ensure traversal accuracy and avoid missing potential optimal solutions).
[0043] Take samples step by step according to this step size. After considering all possible values, for each value corresponding to the candidate joint angle group, through... Calculate the cost, then compare the total cost of all valid groups, and select the candidate joint angle group with the smallest total cost.
[0044] If multiple sets of total costs have the same minimum value, it is necessary to further calculate the difference between each set and the initial joint angle. The overall deviation is considered, and the group with the smaller deviation is selected as the optimal inverse kinematic solution.
[0045] S105: Based on the optimal inverse kinematics solution, a control signal is generated to drive the movement of each joint of the robotic arm, so that the end of the robotic arm reaches the target end pose.
[0046] Specifically, the optimal inverse kinematic solution is a set of defined joint angles ( When generating control signals, it is necessary to first plan the motion trajectory parameters of each joint based on the set of angles and the motion characteristics such as the maximum speed and maximum acceleration of the robotic arm joints; then, the trajectory parameters are converted into a signal format suitable for the joint actuators, and finally sent to each joint actuator to drive the joints from the initial angle ( Move to the target angle ), to achieve end-point arrival ( The target pose corresponding to ).
[0047] In an optional implementation, see Figure 3 As shown, Figure 3 The flowchart of a candidate joint angle determination method provided in Embodiment 1 of this application is shown, wherein the step of introducing self-motion variables to parameterize the joint space of the robotic arm based on the target end pose to obtain multiple sets of candidate joint angles includes steps S301 to S303: Specifically, Figure 3 The detailed process of step S102 involves "determining wrist coordinates - parameterizing elbow trajectory - solving joint angles" and generating candidate joint angles through coordinate system transformation and geometric calculations. This process requires the use of homogeneous transformation matrices, vector operations, and trigonometric function formulas to ensure that the parameterization results match the actual structure of the robotic arm.
[0048] The coordinate system parameters are shown in the table below. Note that the twist angle may not necessarily be as shown in the table below, depending on the specific circumstances; the data in the table below is for illustrative purposes only.
[0049] S301: Determine the coordinates of the origin of the wrist coordinate system in the base coordinate system based on the target end pose; Specifically, the wrist coordinate system is the sixth coordinate system of the robotic arm, and its origin is denoted as . ;Sure When using coordinates in the base coordinate system (0th coordinate system), first consider the target end pose ( Construct the transformation matrix from the 7th coordinate system to the base coordinate system. , The expression is: ; in = , = , = Then calculate through homogeneous transformation. The coordinates are given by the formula: [ ; ; ;1]= ×[0;0;- ;1] After unfolding, you get Coordinate components: =- cos sin + , =- cos sin + , =- cos + , This represents the link offset of the 7th joint.
[0050] S302: Based on the coordinates of the origin of the wrist coordinate system, the coordinates of the shoulder joint, and the link length constraint of the robotic arm, the motion trajectory of the elbow joint is parameterized through the self-motion variable. For details, see Figure 4 As shown, Figure 4 This diagram illustrates the structure and motion trajectory of a robotic arm according to Embodiment 1 of this application. The diagram consists of two parts: the left side shows the robotic arm structure and motion trajectory, labeled with components A, B, C, and D, base O, and point E, and establishes a three-dimensional coordinate system of x, y, and z. The motion trajectory of point B is represented by a dashed ellipse. The right side shows a planar coordinate system, establishing an xy-plane coordinate system with E as the origin. Point B lies on the circle, and the angle θ is marked. The diagram demonstrates the parameterization of the motion trajectory of a certain part of the robotic arm, using angles... Describe the motion of point B in the xy plane, and combine it with a three-dimensional coordinate system to reflect its spatial motion relationship.
[0051] See Figure 5 As shown, Figure 5This diagram illustrates a coordinate system modeling method for a robotic arm according to Embodiment 1 of this application. A base coordinate system X0-Y0-Z0 is established from the origin O0 of the base. Subsequently, corresponding coordinate systems are established for the seven joints of the robotic arm, with origins from O1 to O7 respectively. Each coordinate system is equipped with X, Y, and Z axes (e.g., X1-Y1-Z1, X2-Y2-Z2, etc.). Blue arrows indicate the rotation direction of each joint. This diagram uses the DH method to model the spatial coordinate system of the robotic arm's links and joints, providing a coordinate system foundation for subsequent inverse kinematics solutions and motion trajectory planning, accurately describing the spatial position and orientation relationships between the links and joints.
[0052] The coordinates of the shoulder joint are (x1, y1, z1) of the origin O1 in the first coordinate system of the base coordinate system; the link length constraints include d2 (length of the link from shoulder to elbow), d3 (length of the link from elbow to wrist), and d5 (distance from shoulder O1 to wrist O6, i.e., AC length), and d5 satisfies m = √[(x6-x1)² + (y6-y1)²], where m is the projection distance between O1 and O6 in the xy plane; the elbow joint point corresponds to the origin O of the E coordinate system. E Transformation matrix from E coordinate system to base coordinate system for: ; in: ; ; ; ; Through self-motion variables The trajectory of parameterized OE associated point B, i.e.: ; Then through Convert the trajectory to a base coordinate system to complete the parameterization of the elbow motion trajectory.
[0053] S303: Based on the parameterized elbow motion trajectory, the multiple sets of candidate joint angles are obtained.
[0054] Specifically, when solving for candidate joint angles, first use the coordinates of point B in the base coordinate system ( )calculate : =arccos( / √( ²+ ²)); Then according to Determining the sign of the sign ( and The relationship is determined by the coordinate quadrant.
[0055] When calculating θ3, first find the coordinate difference vector between point B and point C in the base coordinate system. = ( =( , , ), B0=( , ), then Transform to the second coordinate system: ,in ( (The rotation matrix between adjacent coordinate systems), then through and coordinate quadrant determination .
[0056] The solution logic and The transformation matrix is consistent; only the transformation matrix of the corresponding coordinate system needs to be changed. ( , , (Preset angle parameters); pass =arccos((x7·z6) / 2) is used to solve for x7, which is determined by the target end pose, and z6 is the rotation matrix from the base coordinate system to the 6th coordinate system. The above formula can be used to obtain the values for each group. Corresponding candidate joint angles ( ).
[0057] See Figure 6 As shown, Figure 6 This diagram illustrates a robotic arm structure in a three-dimensional coordinate system according to Embodiment 1 of this application, wherein a coordinate system (x0-y0-z0) is established with O as the origin. The diagram includes components A, B, C, and D, where B' is the projection of B onto the (x0-y0) plane. Multiple angles are labeled. It is the angle in the (x0-y0) plane. It is the angle at point A. It's the angle at point B. The angle at point C describes the posture relationship between different parts of the robotic arm, reflecting the angular parameterization of the robotic arm in three-dimensional space and providing a geometric reference for analyzing its motion and pose.
[0058] See Figure 7 As shown, Figure 7This diagram illustrates a robotic arm structure in a second three-dimensional coordinate system, as provided in Embodiment 1 of this application. The diagram establishes a (x0-y0-z0) coordinate system with O as the origin. The diagram includes components A, B, C, and D, where B' is the projection of B onto the (x0-y0) plane. A local coordinate system (x2-y2-z2) is established at point A, and angles are labeled. Used to describe the attitude at point A. It is the angle in the (x0-y0) plane. This figure shows the coordinate system establishment and attitude parameters of the robotic arm in three-dimensional space through local coordinate system and angle annotation, providing a basis for analyzing its kinematic characteristics.
[0059] Figure 6 and Figure 7 All are based on a three-dimensional global coordinate system (x0-y0-z0) with O as the origin, all contain robotic arm components (A, B, C, D), and all are connected by B' (the projection of B onto the (x0-y0) plane) and angles. The attitude angles in the (x0-y0) plane are used to describe the basic pose relationship of the robotic arm in three-dimensional space, which serve the kinematics or pose analysis of the robotic arm.
[0060] The difference is that, Figure 6 Only the global coordinate system (x0-y0-z0) is used for labeling. , , Equal to multiple joint angles, focusing on the attitude parameterization of multiple joints; Figure 7 Add a new local coordinate system (x2-y2-z2) at point A and label it. It focuses on analyzing the local attitude and motion at point A through a local coordinate system, and the component connection form is closer to the local analysis logic of the linkage structure.
[0061] In an optional implementation, the joint motion cost function Represented as: ;in, For the first Preset weights for each joint, For the corresponding self-motion variables The Candidate joint angles For the first The initial angle of each candidate joint.
[0062] Specifically, in this function The values need to be set in conjunction with the robotic arm's drive characteristics and must satisfy the rule that "joints closer to the base have higher weights"; for example, the weights of joints 1-3 in the shoulder. , , Weight of the fourth joint of the elbow Weight of the 5th to 7th joints of the wrist , , , must meet ≥ ≥ ≥ ≥ ≥ ≥ This prioritizes reducing the exercise costs of high-energy-consuming joints.
[0063] These are the candidate angles obtained through step S203. The initial angle obtained in step S101, the square of the difference between the two and By multiplying and summing, the motion cost of a single set of candidate joint angles can be quantified.
[0064] In an optional implementation, the weights The configuration satisfies the following: the weight of the joints closer to the robot arm base is greater than or equal to the weight of the joints closer to the end effector.
[0065] Specifically, the joints associated with the robotic arm base are joints 1-3 (shoulder joints), and the joints closer to the end effector are joints 5-7 (wrist joints). The weighting configuration should reflect the characteristic that "the shoulder joint's motion energy consumption is higher than that of the wrist joint"; for example, it can be set to... =0.25、 =0.22、 =0.20、 =0.15、 =0.08、 =0.06、 =0.04 (total weights are 1), or adjust the specific value according to actual drive energy consumption data, but always ensure ≥ ≥ ≥ ≥ ≥ ≥ This ensures that the cost function can prioritize the movement of high-energy-consuming joints.
[0066] In an optional implementation, the step of traversing the range of values for the self-motion variables and selecting the solution with the minimum total cost from multiple candidate joint angles based on the joint motion cost function as the optimal inverse kinematic solution includes: using a preset step size in the range [0, 2...]. Traverse the self-motion variables within the interval, calculate the candidate joint angle and total cost corresponding to each value, and select the candidate solution with the minimum total cost.
[0067] Specifically, the preset step size is usually set to π / 36 or π / 72 (which must be greater than 0 and less than π / 18). For example, when the step size is π / 36, We need to find 72 values within the range [0, 2π] (2π ÷ π / 36 = 72); for each The value is first obtained by solving the candidate joint angles through steps S201~S203. ), then substitute Calculate the total cost; after traversal, compare all 72 sets of total costs and select the candidate joint angle with the smallest value as the optimal inverse kinematics solution; if there are two or more sets with the same minimum total cost, it is necessary to calculate the difference between each set and the initial angle. The total deviation Choose the group with the smaller total deviation.
[0068] In an optional implementation, the step of generating control signals based on the optimal inverse kinematics solution to drive the movement of each joint of the robotic arm, thereby enabling the end effector of the robotic arm to reach the target end effector pose, includes: sending the optimal inverse kinematics solution to the lower-level controller of the robotic arm, and having the lower-level controller combine obstacle avoidance and momentum balance control to generate the final joint drive signals.
[0069] Specifically, the optimal inverse kinematic solution is ( After the data is sent to the lower-level controller, the lower-level controller first verifies whether the set of angles meets the obstacle avoidance requirements (such as whether the distance to surrounding obstacles is greater than the safety threshold), and then performs fine-tuning based on the overall momentum balance conditions of the robotic arm (such as whether the joint torque is within the safe range). After fine-tuning, drive signals for each joint are generated. The drive signals need to be adapted to the control requirements of the joint servo motors, such as pulse width modulation signals or analog voltage signals. Finally, the motors drive the joints to move from the initial angle to the fine-tuned target angle, ensuring that the end effector reaches the target angle accurately. The pose corresponding to ).
[0070] In an optional implementation, after obtaining multiple sets of candidate joint angles and before selecting the optimal inverse kinematic solution, the method further includes: performing joint limit judgment on the multiple sets of candidate joint angles and discarding invalid solutions that contain angles exceeding the physical motion range of the robotic arm.
[0071] Specifically, the joints of the robotic arm have physical limitations on their range of motion (e.g. The range is [-180°, 180°]. The range is [-90°, 90°], the specific range needs to be determined according to the robotic arm structure design); when judging the limit, the angle of each group of candidate joints needs to be checked one by one. Whether the angle of each joint is within its physical range, and if the angle of a certain joint exceeds the limit (e.g. If the angle is -100°, exceeding the range of [-90°, 90°], then that group is considered invalid and discarded; only valid solutions where all joint angles are within the physical range are retained, and then based on... Select the optimal solution to avoid invalid solutions that could damage the robotic arm structure or cause motion malfunctions.
[0072] For a clearer explanation of the robotic arm control method provided in this application, please refer to [link / reference]. Figure 8 As shown, Figure 8 The flowchart illustrates an inverse kinematic algorithm for a humanoid seven-DOF robotic arm provided in Embodiment 1 of this application. The algorithm takes the "end-effector target pose" and "initial joint angles" as inputs. First, it "establishes the DH coordinate system and corresponding coordinate system parameter table based on the robotic arm structure." Next, it performs "end-effector pose representation and constructs the transformation matrix from the 7th coordinate system to the base coordinate system." Then, it completes the "solution of the origin position for each coordinate (except the elbow joint)." Finally, it "determines the self-motion variables based on joint constraints and self-collision factors." "range", and "within the above self-motion variables" The following operation is performed in a range loop: "Determine the self-motion variable". "Perform inverse solution of 7 joint angles", "Calculate the self-motion variable" "Joint motion cost"; after the loop is completed, "compare each self-motion variable". The inverse kinematics solution for the humanoid seven-DOF robotic arm is achieved by "selecting the joint angle with the minimum joint motion cost" and "finding the joint angle with the minimum joint motion cost".
[0073] Example 2 See Figure 9 As shown, Figure 9 This illustration shows a structural schematic diagram of a robotic arm control device according to Embodiment 2 of this application, wherein the device includes: The robotic arm data acquisition module 901 is used to acquire the target end pose and initial joint angle of the robotic arm. The joint angle determination module 902 is used to introduce self-motion variables to parameterize the joint space of the robotic arm based on the target end pose, and obtain multiple sets of candidate joint angles. The motion cost determination module 903 is used to construct a joint motion cost function and determine the total cost of moving from the initial joint angle to each group of candidate joint angles based on the joint motion cost function. The inverse kinematics solution determination module 904 is used to traverse the value range of the self-motion variables and select the solution with the minimum total cost from the multiple sets of candidate joint angles according to the joint motion cost function as the optimal inverse kinematics solution. The robotic arm control module 905 is used to generate control signals based on the optimal inverse kinematics solution to drive the joints of the robotic arm to move, so that the end effector of the robotic arm reaches the target end effector pose.
[0074] In an optional implementation, based on the target end-effector pose, self-motion variables are introduced to parameterize the joint space of the robotic arm, resulting in multiple sets of candidate joint angles, including: Based on the target end pose, determine the coordinates of the wrist coordinate system origin in the base coordinate system; Based on the coordinates of the origin of the wrist coordinate system, the coordinates of the shoulder joint, and the link length constraint of the robotic arm, the motion trajectory of the elbow joint is parameterized through the self-motion variable. Based on the parameterized elbow motion trajectory, the multiple sets of candidate joint angles are obtained.
[0075] In an optional implementation, the joint motion cost function Represented as: ; in, For the first Preset weights for each joint, For the corresponding self-motion variables The Candidate joint angles For the first The initial angle of each candidate joint.
[0076] In an optional implementation, the weights The configuration satisfies: The weight of the joints closer to the robot arm base is greater than or equal to the weight of the joints closer to the end effector.
[0077] In an optional implementation, the step of traversing the range of values for the self-motion variables and selecting the solution with the minimum total cost from multiple candidate joint angles based on the joint motion cost function as the optimal inverse kinematic solution includes: The self-motion variables are traversed in the interval [0,2π] with a preset step size. The candidate joint angle and total cost corresponding to each value are calculated, and the candidate solution with the minimum total cost is selected.
[0078] In an optional implementation, the step of generating control signals based on the optimal inverse kinematics solution to drive the joints of the robotic arm to move, thereby enabling the robotic arm end effector to reach the target end effector pose, includes: The optimal inverse kinematics solution is sent to the lower-level controller of the robotic arm, which combines obstacle avoidance and momentum balance control to generate the final joint drive signal.
[0079] In an optional implementation, the device further includes a joint limit determination module, used for: After obtaining multiple sets of candidate joint angles, before selecting the optimal inverse kinematic solution, joint limit judgment is performed on the multiple sets of candidate joint angles, and invalid solutions containing angles that exceed the physical movement range of the robotic arm are discarded.
[0080] Example 3 Based on the same application concept, see [link / reference] Figure 10 As shown, Figure 10 This illustration shows a structural schematic diagram of a computer device provided in Embodiment 3 of this application, wherein, as shown... Figure 10 As shown, the computer device 1000 provided in Embodiment 3 of this application includes: The system includes a processor 1001, a memory 1002, and a bus 1003. The memory 1002 stores machine-readable instructions that can be executed by the processor 1001. When the computer device 1000 is running, the processor 1001 and the memory 1002 communicate through the bus 1003. The machine-readable instructions are executed by the processor 1001 to perform the steps of the robotic arm control method shown in Embodiment 1 above.
[0081] Example 4 Based on the same concept, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the robotic arm control method described in any of the above embodiments.
[0082] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0083] The computer program product for controlling a robotic arm provided in this application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0084] The robotic arm control device provided in this application embodiment can be specific hardware on the device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in this application embodiment are the same as those in the foregoing method embodiments. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the foregoing method embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can all be referred to the corresponding processes in the above method embodiments, and will not be repeated here.
[0085] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0086] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0087] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0088] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0089] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0090] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A robotic arm control method, characterized in that, The method includes: Obtain the target end-effector pose and initial joint angles of the robotic arm; Based on the target end pose, self-motion variables are introduced to parameterize the joint space of the robotic arm, resulting in multiple sets of candidate joint angles. Construct a joint motion cost function, and determine the total cost of moving from the initial joint angle to each group of candidate joint angles based on the joint motion cost function; Traverse the range of values for the self-motion variables, and select the solution with the minimum total cost from the multiple candidate joint angles according to the joint motion cost function as the optimal inverse kinematics solution; Based on the optimal inverse kinematics solution, a control signal is generated to drive the movement of each joint of the robotic arm, thereby enabling the end effector of the robotic arm to reach the target end effector pose.
2. The method according to claim 1, characterized in that, Based on the target end-effector pose, self-motion variables are introduced to parameterize the joint space of the robotic arm, resulting in multiple sets of candidate joint angles, including: Based on the target end pose, determine the coordinates of the wrist coordinate system origin in the base coordinate system; Based on the coordinates of the origin of the wrist coordinate system, the coordinates of the shoulder joint, and the link length constraint of the robotic arm, the motion trajectory of the elbow joint is parameterized through the self-motion variable. Based on the parameterized elbow motion trajectory, the multiple sets of candidate joint angles are obtained.
3. The method according to claim 1, characterized in that, The joint motion cost function Represented as: ; in, For the first Preset weights for each joint, For the corresponding self-motion variables The Candidate joint angles For the first The initial angle of each candidate joint.
4. The method according to claim 3, characterized in that, The weight The configuration satisfies: The weight of the joints closer to the robot arm base is greater than or equal to the weight of the joints closer to the end effector.
5. The method according to claim 1, characterized in that, The process of traversing the range of values for the self-motion variables, and selecting the solution with the minimum total cost from multiple candidate joint angles based on the joint motion cost function, is the optimal inverse kinematic solution, including: The self-motion variables are traversed in the interval [0,2π] with a preset step size. The candidate joint angle and total cost corresponding to each value are calculated, and the candidate solution with the minimum total cost is selected.
6. The method according to claim 1, characterized in that, The process of generating control signals based on the optimal inverse kinematics solution to drive the movement of each joint of the robotic arm, thereby enabling the robotic arm's end effector to reach the target end effector pose, includes: The optimal inverse kinematics solution is sent to the lower-level controller of the robotic arm, which combines obstacle avoidance and momentum balance control to generate the final joint drive signal.
7. The method according to any one of claims 1 to 6, characterized in that, After obtaining multiple sets of candidate joint angles, and before selecting the optimal inverse kinematics solution, the method further includes: performing joint limit judgment on the multiple sets of candidate joint angles, and discarding invalid solutions that contain angles that exceed the physical motion range of the robotic arm.
8. A robotic arm control device, characterized in that, The device includes: The robotic arm data acquisition module is used to acquire the target end pose and initial joint angles of the robotic arm; The joint angle determination module is used to introduce self-motion variables to parameterize the joint space of the robotic arm based on the target end pose, and obtain multiple sets of candidate joint angles. The motion cost determination module is used to construct a joint motion cost function and determine the total cost of moving from the initial joint angle to each group of candidate joint angles based on the joint motion cost function. The inverse kinematics solution determination module is used to traverse the value range of the self-motion variables and select the solution with the minimum total cost from the multiple sets of candidate joint angles according to the joint motion cost function as the optimal inverse kinematics solution. The robotic arm control module is used to generate control signals based on the optimal inverse kinematics solution to drive the movement of each joint of the robotic arm, thereby enabling the end effector of the robotic arm to reach the target end effector pose.
9. A computer device, characterized in that, include: The system includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the robotic arm control method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the robotic arm control method as described in any one of claims 1 to 7.
Citation Information
Cited By
Joint angle inverse solution method, device and equipment of mechanical arm and medium
CN121989244A