Robotic arm control methods, equipment and storage media
By using differential interpolation and iterative correction methods, the problem of strong coupling between the position and posture joints of the robotic arm is solved, thereby improving the reliability and stability of the robotic arm control, ensuring high precision and real-time performance, and making it suitable for precision operations such as surgical instruments in surgical robots.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUZHOU SHITONG MEDICAL TECHNOLOGY CO LTD
- Filing Date
- 2026-05-28
- Publication Date
- 2026-06-30
AI Technical Summary
The position and attitude joints of the robotic arm are strongly coupled and there is no analytical solution, which makes it impossible to use analytical methods to solve the target joint angles. Furthermore, the iterative method has poor convergence and is prone to oscillation or divergence, posing safety hazards, especially in precision operations such as the control of surgical instruments in surgical robots.
The differential target homogeneous matrix is generated by differential interpolation, and trajectory planning is performed. The initial joint angles are obtained by combining a simplified model or a deep neural network. Iterative correction is completed by combining the original configuration forward kinematics, error calculation and Jacobian pseudo-inverse, and the accurate joint angles are output, avoiding iterative divergence and trajectory jitter.
This improves the reliability and stability of robotic arm control, ensures effective convergence in each iteration, reduces the number of iterations, meets high precision and real-time requirements, and prevents the robotic arm from going out of control.
Smart Images

Figure CN122299674A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robotic arm control technology, and more specifically, to a robotic arm control method, device, and storage medium. Background Technology
[0002] When controlling a robotic arm, the target pose can be solved analytically or iteratively to obtain the target joint angles of the robotic arm in the target pose, and then the robotic arm can be controlled based on the target joint angles.
[0003] However, if the position and attitude joints of the robotic arm are strongly coupled and there is no analytical solution, the target joint angles of the robotic arm cannot be solved analytically. Furthermore, when using iterative methods, the strong coupling between position and attitude joints leads to poor convergence. Summary of the Invention
[0004] The purpose of this application is to address the shortcomings of the prior art by providing a robotic arm control method, device, and storage medium. This addresses the issue that in the prior art, the position and attitude joints of the robotic arm are strongly coupled and lack analytical solutions, making it impossible to solve for the target joint angles of the robotic arm analytically. Furthermore, iterative methods suffer from poor convergence due to the strong coupling between the position and attitude joints.
[0005] To achieve the above objectives, the technical solution adopted in this application is as follows: In a first aspect, this application provides a robotic arm control method, the method comprising: The current pose information and target pose information of the robotic arm are obtained. The target pose information includes a target position vector and a target pose matrix. The current pose information includes a current position vector and a current pose matrix. Based on the current pose information and the target pose information, a differential target homogeneous matrix is determined, which includes: multiple intermediate position vectors and an intermediate pose matrix; Based on the current pose information, the target pose information, the differential target homogeneous matrix, and the robotic arm configuration, the initial joint angles are determined, and the initial joint angles are iteratively corrected to obtain the joint correction amount. The movement of the robotic arm is controlled based on the joint correction amount and the current joint angle of the robotic arm.
[0006] Optionally, determining the differential target homogeneous matrix based on the current pose information and the target pose information includes: Based on the current pose information and the target pose information, differential interpolation is performed to obtain a differential homogeneous matrix; The difference homogeneous matrix is smoothed to obtain the difference target homogeneous matrix.
[0007] Optionally, the step of performing differential interpolation calculation based on the current pose information and the target pose information to obtain a difference homogeneous matrix includes: Based on the current pose information and the target pose information, determine the position increment vector and the pose quaternion; Based on the position increment vector, the preset maximum step size, and the preset difference coefficient, the position increment vector is interpolated to obtain multiple intermediate position vectors. The attitude quaternions are interpolated based on the current attitude matrix, the target attitude matrix, and a preset scaling factor to obtain multiple intermediate attitude matrices.
[0008] Optionally, the step of interpolating the position increment vector based on the position increment vector, a preset maximum step size, and a preset scaling factor to obtain the intermediate position vector includes: Determine a first ratio between the position increment vector and the scaling factor; If the first ratio is greater than the maximum step size, then the intermediate position vector is generated based on the maximum step size; If the first ratio is less than or equal to the maximum step size, the position increment vector is split according to the ratio coefficient to obtain the intermediate position vector.
[0009] Optionally, the smoothing process of the difference homogeneous matrix to obtain the target difference homogeneous matrix includes: The incremental magnitude is determined based on the intermediate position vector and the current position vector; The incremental modulus is input into a preset second-order system model to obtain the smoothing coefficient; The time coefficient is obtained based on the smoothing coefficient and the incremental modulus; The quaternion parameters are determined based on the time coefficient, the intermediate attitude matrix, and the current attitude matrix. The transition position vector is determined based on the smoothing coefficient, the intermediate position vector, and the current position vector; The difference homogeneous matrix is smoothed based on the transition position vector and the quaternion parameters to obtain the difference target homogeneous matrix.
[0010] Optionally, the step of determining the initial joint angle based on the current pose information, the target pose information, the differential target homogeneous matrix, and the robotic arm configuration, and iteratively correcting the initial joint angle to obtain the joint correction amount, includes: The robotic arm configuration is simplified to obtain a simplified robotic arm structure; Based on the target pose information and the simplified structure of the robotic arm, the initial joint angles are determined. The initial joint angle is iteratively corrected based on the differential target homogeneous matrix and the current pose information to obtain the joint correction amount.
[0011] Optionally, the step of iteratively correcting the initial joint angle based on the differential target homogeneous matrix and the current pose information to obtain the joint correction amount includes: A. Perform positive kinematics calculation on the initial joint angle to obtain the temporary pose information corresponding to the initial joint angle; B. Determine the deviation information between the temporary pose information and the differential target homogeneous matrix; C. Solve the Jacobian pseudo-inverse on the current pose information to obtain the Jacobian pseudo-inverse matrix; D. Determine the correction amount based on the deviation information and the Jacobian pseudo-inverse matrix; E. Determine the sum of the correction amount and the initial joint angle, and determine whether the preset iteration termination condition is met. If not, use the sum as the new initial joint angle, and re-execute step AE until the preset iteration termination condition is met, and use the correction amount of the current round as the joint correction amount.
[0012] Optionally, the method further includes: The initial joint angles are obtained by performing an analytical inverse solution on the differential target homogeneous matrix based on a neural network model. The initial joint angle is iteratively corrected based on the differential target homogeneous matrix and the current pose information to obtain the joint correction amount.
[0013] Secondly, embodiments of this application also provide an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of a robotic arm control method as described in any one of the first aspects.
[0014] Thirdly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of a robotic arm control method as described in any one of the first aspects.
[0015] The beneficial effects of this application are as follows: This application's embodiments, by performing differential interpolation calculations on the current pose information and the target pose information, obtain a differential target homogeneous matrix. This enables trajectory planning from the current pose to the target pose, ensuring smooth and stable pose changes, avoiding iterative divergence and trajectory mutations that could lead to robot arm loss of control, thus further improving the reliability and stability of robot arm control. Iterative methods suffer from the problem of ambiguous initial values and easy divergence. This application, by determining an approximately realistic initial joint angle and iteratively correcting the initial joint angle to obtain the joint correction amount, can significantly reduce the number of iterations, improve real-time responsiveness, and ensure that each iteration effectively converges to a valid solution, preventing solution failure due to strong coupling interference.
[0016] 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
[0017] 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.
[0018] Figure 1 A schematic diagram of a robotic arm configuration provided in an embodiment of this application is shown; Figure 2 A flowchart of a robotic arm control method provided in an embodiment of this application is shown; Figure 3 This document illustrates a flowchart of a method for determining a difference target homogeneous matrix according to an embodiment of this application. Figure 4 This document illustrates a flowchart of a method for determining an intermediate position vector and an intermediate attitude matrix, as provided in an embodiment of this application. Figure 5 This document illustrates a flowchart of a method for determining an intermediate position vector according to an embodiment of this application. Figure 6 This document illustrates a flowchart of a method for determining a difference homogeneous matrix according to an embodiment of this application. Figure 7 This document illustrates a flowchart of another method for determining the homogeneous matrix of the difference objective, as provided in an embodiment of this application. Figure 8 This document illustrates a flowchart of another method for determining a difference homogeneous matrix, as provided in an embodiment of this application. Figure 9 A flowchart illustrating a method for determining joint correction amounts, as provided in an embodiment of this application, is shown. Figure 10 A simplified robotic arm configuration provided in an embodiment of this application is shown in the diagram. Figure 11 This document illustrates another flowchart for determining joint correction amounts according to an embodiment of the present application. Figure 12 A flowchart of yet another robotic arm control method provided in an embodiment of this application is shown; Figure 13 A flowchart of yet another robotic arm control method provided in an embodiment of this application is shown; Figure 14 This paper shows a schematic diagram of the structure of a robotic arm control device provided in an embodiment of this application; Figure 15 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0019] 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.
[0020] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0021] When controlling a robotic arm, the target pose can be solved analytically or iteratively to obtain the target joint angles of the robotic arm in the target pose, and then the robotic arm can be controlled based on the target joint angles.
[0022] However, for robotic arms with strong coupling between position and attitude joints and no analytical solution, analytical methods cannot be used to solve for the target joint angles. Furthermore, the fuzziness or coupling between position and attitude joints leads to poor convergence of iterative methods, easily resulting in oscillations or divergence. Moreover, for robotic arms requiring precise manipulation, such as the control of surgical instruments in surgical robots, the inability to achieve precise control could pose significant safety hazards.
[0023] Therefore, how to achieve precise control of a robotic arm with strong coupling between position and attitude and no analytical solution has become an urgent problem to be solved.
[0024] like Figure 1 As shown, this is a robotic arm configuration where position and attitude are strongly coupled, such as... Figure 1 As shown, the robotic arm consists of three links: L1, L2, and L3. Link L1 rotates via joint J1, and its extension and retraction are achieved via joint J2. Links J3 and J4 control the pitch and yaw of link L2, while joints J5 and J6 control the pitch and yaw of link L3. There is a short link segment dL1 between joints J3 and J4, and a short link segment dL2 between joints J5 and J6.
[0025] The existence of links dL1 and dL2 means that there is no analytical inverse solution for this robotic arm. Furthermore, J3 and J4 control the pitch and yaw of link L2, achieving both end-effector position and pointing motion. Similarly, J5 and J6 control the pitch and yaw of link L3, achieving both end-effector position and pointing motion. Using an iterative method to solve this problem results in slow convergence and is prone to oscillations or divergence.
[0026] Based on this, this application proposes a robotic arm control method that uses interpolation to split the pose step length and performs trajectory planning to achieve a smooth transition. Then, it obtains the initial joint angles through a simplified model analysis method or a deep neural network, and combines the original configuration forward kinematics, error calculation, and Jacobian pseudo-inverse to complete iterative correction, finally outputting accurate joint angles. This effectively avoids iterative divergence and trajectory jitter, meeting the high precision, real-time performance, and safety requirements of surgical scenarios.
[0027] Next, combine Figure 2 The present application describes a robotic arm control method, wherein the executing entity of the method can be an electronic device communicatively connected to the robotic arm, or a control module within the robotic arm, such as... Figure 2 As shown, the method includes: S201. Obtain the current pose information of the robotic arm and the target pose information.
[0028] Optionally, the target pose information includes: the target position vector and the target pose matrix, and the current pose information includes: the current position vector and the current pose matrix.
[0029] When controlling a robotic arm, the user can input the target Cartesian position and orientation to the arm, indicating the target pose information that the end effector needs to reach. The target position vector describes the coordinate position in three-dimensional space that the end effector needs to reach, as indicated by the user, denoted by (…). The target attitude matrix is used to describe the pointing state that the end effector of the robotic arm needs to achieve, such as pitch and yaw directions, as indicated by the user, and is represented by a rotation matrix.
[0030] The current pose information can be the position and orientation of the robotic arm at the current moment, including the current position vector and the current orientation matrix. The current position vector describes the coordinate position of the robotic arm's end effector in three-dimensional space at the current moment, and the current orientation matrix describes the pointing state of the robotic arm's end effector at the current moment, such as pitch and yaw directions, and is represented by a rotation matrix.
[0031] S202. Determine the differential target homogeneous matrix based on the current pose information and the target pose information.
[0032] The differential target homogeneous matrix includes: an intermediate position vector and an intermediate attitude matrix. The differential target homogeneous matrix can be a transition control matrix that integrates the intermediate position vector and the intermediate attitude matrix.
[0033] In one possible implementation, the transition position and transition posture at each time step from the current pose to the target pose can be generated based on the current pose information and the target pose information. The transition position and transition posture are then used as a differential target homogeneous matrix, which can describe the movement trajectory of the robotic arm from the current pose to the target pose.
[0034] Optionally, the intermediate position vector can be the small-step position at each time step, split by an interpolation algorithm, including the small-step transition coordinates from the current position vector to the target position vector. The intermediate attitude matrix can be the transition attitude at each time step, split by a difference algorithm, including the transition orientation from the current attitude to the target attitude.
[0035] By interpolating and decomposing the current pose information and the target pose information, a differential target homogeneous matrix is obtained. This allows direct pose transitions to be broken down into small, smooth intermediate steps, avoiding sudden jitter or impacts during robotic arm movement, thereby improving the accuracy of robotic arm control. Furthermore, even if the robotic arm has… Figure 1 As shown in the case of strong coupling and no analytical solution, the generated differential objective homogeneous matrix can also provide stable input for subsequent iterative solutions, avoiding iterative divergence.
[0036] S203. Based on the current pose information, the homogeneous matrix of the differential target, and the configuration of the robotic arm, determine the initial joint angles, and iteratively correct the initial joint angles to obtain the joint correction amount.
[0037] The mechanical configuration of the robotic arm includes the connecting rods, joints, and key dimensional parameters.
[0038] Optionally, the initial joint angles can be approximate rotation angles of each joint of the robotic arm in the target pose, serving as the basis for iterative correction. The joint correction amount can be the joint angle adjustment amount to compensate for the initial joint angles, including the angle values by which each joint needs to rotate more or less.
[0039] In the first possible implementation, the configuration of the robotic arm can be simplified to eliminate the coupling relationship between position and attitude, so that the simplified robotic arm configuration has an analytical solution. The initial joint angle is solved based on the simplified robotic arm configuration, the current pose information and the differential target homogeneous matrix. Based on the original configuration of the robotic arm and the error of the simplified configuration, the initial joint angle is iteratively corrected to obtain the joint correction amount.
[0040] In the second possible implementation, instead of simplifying the robotic arm configuration, the initial joint angles can be directly solved based on the original configuration of the robotic arm, the current pose information, and the differential target homogeneous matrix. The initial joint angles can then be iteratively corrected to obtain the joint correction amount. For example, the initial joint angles of the robotic arm can be estimated using a pre-trained neural network model based on the original configuration of the robotic arm and the target pose information.
[0041] S204. Control the movement of the robotic arm based on the joint correction amount and the current joint angle of the robotic arm.
[0042] Optionally, the current joint angle includes the angles of each joint of the robotic arm under the current pose information.
[0043] It should be noted that the initial joint angle is an approximate rotation angle of each joint of the robotic arm under the target pose information. After determining the joint correction amount, the joint correction amount can represent the angle value that each joint of the robotic arm needs to rotate from the current pose to the target pose. Then, based on the joint correction amount, the control arm is driven to reach the target pose.
[0044] In this embodiment, by performing differential interpolation calculations on the current pose information and the target pose information, a differential target homogeneous matrix is obtained. This enables trajectory planning from the current pose to the target pose, ensuring smooth and stable pose changes and avoiding robot arm loss of control caused by iterative divergence and sudden trajectory changes, thereby further improving the reliability and stability of robot arm control. Iterative methods suffer from the problem of fuzzy initial values and easy divergence. This application determines an approximately realistic initial joint angle and iteratively corrects the initial joint angle to obtain the joint correction amount. This significantly reduces the number of iterations, improves real-time responsiveness, and ensures that each iteration effectively converges to a valid solution, preventing solution failure due to strong coupling interference.
[0045] The following is a further explanation of determining the difference target homogeneous matrix based on the current pose information and the target pose information, such as... Figure 3 As shown, the above step S202 includes: S301. Perform differential interpolation calculation based on the current pose information and the target pose information to obtain the differential homogeneous matrix.
[0046] Optionally, the current pose information and the target pose information can be differentially calculated first to determine the total span from the current pose to the target pose. Then, the total span can be interpolated to divide the total span into multiple small steps, thereby dividing the current pose to the target pose into continuous intermediate poses to avoid abrupt changes in motion. Finally, the output is a differential homogeneous matrix containing intermediate positions and intermediate poses.
[0047] Optionally, position difference can be performed on the current position vector in the current pose information and the target position vector in the target pose information to calculate the total position increment vector and obtain the position span. Or, attitude difference can be performed on the current pose matrix in the current pose information and the target pose matrix in the target pose information to quantize and obtain the attitude span.
[0048] After obtaining the position span and attitude span, interpolation calculations can be performed on the position span and attitude span to break them down into multiple consecutive small steps. The position vector and attitude matrix of each small step are obtained, and the position vector and attitude matrix of each small step are combined to obtain the difference homogeneous matrix.
[0049] S302. Smooth the difference homogeneous matrix to obtain the difference target homogeneous matrix.
[0050] Smoothing the difference homogeneous matrix can be done by smoothing the span of each small step, thereby ensuring that the position vector and attitude matrix of each small step in the difference homogeneous matrix are consistent in rhythm, and ensuring smooth and safe single-step movement.
[0051] The following explains the process of calculating the difference homogeneous matrix based on the current pose information and the target pose information. Figure 4 As shown, the above step S301 includes: S401. Determine the position increment vector and attitude quaternion based on the current pose information and the target pose information.
[0052] Optionally, the position increment vector can be calculated based on the current position vector in the current pose information and the target position vector in the target pose information, and the attitude increment matrix can be calculated based on the current pose matrix in the current pose information and the target pose matrix in the target pose information.
[0053] For the input target pose information Location ( The target position vector is formed by Current pose information Current position vector Calculate the position increment vector = .
[0054] Optionally, the target pose matrix and the current pose matrix can be transformed to obtain pose quaternions. For example, the target pose matrix and the current pose matrix can be transformed based on the trace rotation matrix to obtain quaternions, and then the quaternions can be normalized to obtain pose quaternions.
[0055] S402. Based on the position increment vector, the preset maximum step size, and the preset difference coefficient, the position increment vector is interpolated to obtain multiple intermediate position vectors.
[0056] Optionally, the preset maximum step size can be the maximum step size for a single-step position movement of the robotic arm, used to limit the single-step movement distance. The preset differential coefficient can control the control parameter of the fineness of the position span division. The larger the value of the differential coefficient, the finer the single-step division. For example, with a differential coefficient of K-20, a total span of 10mm can be divided into 20 small steps of 0.5mm each.
[0057] The position increment vector can be the position span from the current position to the target position. By interpolating the position increment vector based on the preset maximum step size and preset difference coefficient, the position span can be divided into multiple small step size spans to obtain multiple intermediate position vectors.
[0058] S403. Based on the current attitude matrix, the target attitude matrix, and the preset scaling factor, interpolate the attitude quaternion to obtain multiple intermediate attitude matrices.
[0059] Optionally, the proportional coefficient t and the differential coefficient K are reciprocals of each other, i.e., t = 1 / K, thereby ensuring that the transition rhythm of position and attitude is consistent.
[0060] Attitude quaternions represent the attitude span from the current attitude to the target attitude, while the scaling factor represents the transition progress from the current attitude to the target attitude. For example, if K=10 and t=0.1, the attitude transition is 10% each time; if K=20 and t=0.05, the transition is 5% each time, ensuring a smoother attitude transition. Interpolation calculations based on attitude quaternions, the current attitude matrix, and the target attitude matrix can decompose the attitude span into multiple small step spans, resulting in multiple intermediate attitude matrices.
[0061] In this embodiment, the position increment vector and attitude quaternion from the current pose to the target pose are decomposed by the scaling factor and the difference factor. The position span and attitude span can be decomposed into multiple small step spans, resulting in multiple intermediate position vectors and intermediate attitude matrices from the current pose to the target pose, thereby realizing trajectory planning and smooth transition from the current pose to the target pose.
[0062] The following is a further explanation of how the position increment vector is interpolated based on the position increment vector, the preset maximum step size, and the preset difference coefficients to obtain multiple intermediate position vectors. Figure 5 As shown, the above step S402 includes: S501. Determine the first ratio between the position increment vector and the scaling factor.
[0063] S502. If the first ratio is greater than the maximum step size, then generate the intermediate position vector based on the maximum step size.
[0064] S503. If the first ratio is less than or equal to the maximum step size, the position increment vector is split according to the scaling factor to obtain the intermediate position vector.
[0065] Reference Figure 6 The flowchart shown indicates that if the first ratio The preset maximum step size, If the difference coefficients are used, then the intermediate position vector is generated according to the maximum step size. Otherwise, the intermediate position vector is generated by splitting according to the difference ratio to ensure smooth position increment.
[0066] Alternatively, the difference ratio K can be based on the formula Split to generate intermediate position vector .
[0067] Reference Figure 6 ,Can For attitude quaternions The scaling factor t = 1 / K, and the intermediate attitude matrix obtained by difference calculation is: .
[0068] Continue to refer to Figure 6 After obtaining the vector of the middle position and intermediate attitude matrix Then, it can be transformed into a difference homogeneous matrix. The difference homogeneous matrix is then smoothed to obtain the difference target homogeneous matrix. The following is a further explanation of step S302 above, such as... Figure 7 As shown, the above steps include: S701. Determine the incremental magnitude based on the intermediate position vector and the current position vector.
[0069] Optionally, the incremental modulus can be calculated. , It is a difference homogeneous matrix The intermediate position vector at time i. The incremental magnitude is used to quantize the actual step span from the current position vector to the intermediate position vector, and between adjacent intermediate position vectors.
[0070] S702. Input the incremental modulus into the preset second-order system model to obtain the smoothing coefficient.
[0071] S703. The time coefficient is obtained based on the smoothing coefficient and the incremental modulus.
[0072] S704. Determine the quaternion parameters based on the time coefficient, intermediate attitude matrix, and current attitude matrix.
[0073] Optionally, refer to Figure 8 The flowchart shown can be used to... as well as Convert to quaternion parameters, where For the end effector of the robotic arm The intermediate pose matrix at time i, This represents the current pose matrix of the robotic arm's end effector at time i.
[0074] S705. Determine the transition position vector based on the smoothing coefficient, the intermediate position vector, and the current position vector.
[0075] It should be noted that during the movement of the robotic arm, the current position vector and the current posture matrix of the robotic arm can be obtained in real time, and the transition position vector can be determined based on the current position vector and the intermediate position vector of the robotic arm, and the quaternion parameters can be determined based on the current posture matrix and the intermediate posture matrix of the robotic arm.
[0076] Optionally, the second-order system model can be the critical damping second-order coefficient of the user-preset model parameters, used to calculate the smoothing coefficient and avoid sudden acceleration changes in position motion.
[0077] Continuing with the above embodiments, refer to Figure 8 , Input the second-level system model to obtain the smoothing coefficient. And calculate the time coefficient t= / ; Calculate the transition position vector at time j .
[0078] in, Let represent the vector of the middle position at time i. Let represent the current position vector of the robotic arm at time i. This represents the current position vector of the robotic arm at time j. Time j can be the next adjacent time step after time i.
[0079] S706. Smooth the difference homogeneous matrix according to the transition position vector and quaternion parameters to obtain the difference target homogeneous matrix.
[0080] Continue to refer to Figure 8 The quaternion parameters were calculated. Then, the quaternion parameters and transition position vectors can be transformed into a difference objective homogeneous matrix. Among them, Represents the intermediate attitude quaternion at time i. Let i represent the current pose quaternion at time i.
[0081] The following section explains the process of determining the initial joint angles based on the current pose information, the homogeneous matrix of the differential target, and the robotic arm configuration, and iteratively correcting the initial joint angles to obtain the joint correction amount. Figure 9 As shown, step S203 above includes: S901. The configuration of the robotic arm is simplified to obtain a simplified structure of the robotic arm.
[0082] Simplifying the robotic arm configuration can involve simplifying the joints that are coupled within the robotic arm. Figure 10 A simplified schematic diagram of the robotic arm structure is shown. Figure 1 The length of the connecting rod is simplified to 0. Let dL1=0 and dL2=0, that is, the axes of J3 and J4 intersect at one point, and the axes of J5 and J6 intersect at one point.
[0083] S902. Determine the initial joint angles based on the target pose information and the simplified structure of the robotic arm.
[0084] In one possible implementation, the simplified structure of the robotic arm can be calculated using a geometric method. By taking the target pose information as input parameters, the initial joint angles of the robotic arm under the target pose information can be calculated.
[0085] S903. Based on the differential target homogeneous matrix and the current pose information, the initial joint angle is iteratively corrected to obtain the joint correction amount.
[0086] Optionally, the initial joint angles can be considered as estimated joint angles of the robotic arm in the target pose. In one possible implementation, the initial joint angles can be used as the basis for iterative correction. Based on the current pose information, the actual joint angles of the robotic arm in the current pose are determined. Based on the initial joint angles and the differential target homogeneous matrix, the estimated joint angles in the current pose can be estimated in reverse. Since the robotic arm is a simplified structure, there is a certain deviation between the estimated joint angles and the actual joint angles in the current pose. Correcting the initial joint angles based on this deviation can make the initial joint angles reach the actual joint angles in the target pose.
[0087] The following is a further explanation of the iterative correction of the initial joint angles based on the differential target homogeneous matrix and the current pose information to obtain the joint correction amount, as follows: Figure 11 As shown, the above S903 step includes: S1101. Perform forward kinematics calculation on the initial joint angles to obtain the temporary pose information corresponding to the initial joint angles.
[0088] Optionally, the initial joint angles can be solved by forward kinematics to obtain the temporary pose information of the robotic arm corresponding to the initial joint angles, including the temporary position vector and the temporary pose matrix corresponding to the initial joint angles.
[0089] The temporary position vector describes the actual position of the robotic arm's end effector at the initial joint angle, while the temporary pose matrix describes the pose and orientation of the robotic arm's end effector at the initial joint angle.
[0090] S1102. Determine the temporary pose information and the deviation information of the differential target homogeneous matrix.
[0091] It should be understood that the temporary pose information is the pose corresponding to the initial joint angle, which is calculated based on the simplified robot arm configuration. Therefore, there may be a deviation between the temporary pose information and the target pose information. The differential target homogeneous matrix can describe the intermediate position vector and intermediate posture matrix of the robot arm after each movement. Therefore, the deviation information between the temporary pose information and the differential target homogeneous matrix can be determined, thereby determining how many angles need to be moved for each movement.
[0092] In one possible implementation, the positional deviation between the intermediate position vector and the temporary position vector can be calculated, and the attitude deviation between the intermediate attitude matrix and the temporary attitude matrix can be calculated using the antisymmetric matrix-vector method. The positional deviation and attitude deviation are then used as deviation information.
[0093] S1103. Solve the Jacobian pseudo-inverse for the current pose information to obtain the Jacobian pseudo-inverse matrix.
[0094] Optionally, by solving the Jacobian pseudo-inverse for the current pose information, a mapping relationship between pose deviation and joint adjustment can be established and recorded as the Jacobian pseudo-inverse matrix. The Jacobian pseudo-inverse matrix is used to characterize how much angle each joint needs to be adjusted under each pose deviation.
[0095] S1104. Determine the correction amount based on the deviation information and the Jacobian pseudo-inverse matrix; S1105. Determine the sum of the correction amount and the initial joint angle, and determine whether the preset iteration termination condition is met. If not, use the sum as the new initial joint angle, and repeat steps S1101-S1105 until the preset iteration termination condition is met. Use the correction amount of the current round as the joint correction amount.
[0096] Alternatively, the deviation information can be multiplied by the Jacobian pseudo-inverse matrix to obtain the correction amount.
[0097] The iteration termination conditions include a deviation threshold condition and an iteration count condition. If the magnitude of the deviation information is less than a preset accuracy threshold, or if the number of iterations reaches a preset upper limit, the correction amount of the current iteration can be used as the joint correction amount.
[0098] Reference Figure 12 The flowchart shown illustrates the process of transferring target pose information. After being input into the interpolation module, the interpolation module performs difference interpolation processing to obtain the difference homogeneous matrix. , the difference homogeneous matrix After inputting into the trajectory planning module, the module performs smoothing processing to obtain the difference target homogeneous matrix. The difference target homogeneous matrix The simplified configuration of the robotic arm is also input into the analysis module. Based on the difference target homogeneous matrix and the simplified robotic arm configuration, the analysis module can determine the initial joint angles. .
[0099] Continue to refer to Figure 12 The initial joint angle can be Input the forward kinematics module to perform forward kinematics solving and obtain temporary pose information. Simultaneously, the current pose information can be input into the Jacobian module to obtain the Jacobian pseudo-inverse matrix. The temporary pose information and the homogeneous matrix of the difference target are input into the deviation module to obtain the deviation information e, and the Jacobian pseudo-inverse matrix is then input into the deviation module. Multiplying the deviation information e yields the joint correction amount. Calculate the sum of the joint correction amount and the initial joint angle. If the preset iteration termination condition is not met, continue to use the sum as the new initial joint angle and repeat the iteration until the preset iteration termination condition is met, and use the joint correction amount of the current round as the final joint correction amount.
[0100] After obtaining the joint correction amount, the current joint angle can be added to the joint correction amount to obtain the target joint angle, and the joints of the robotic arm can be adjusted to the target joint angle.
[0101] It should be noted that the movement trajectory of the robotic arm has been divided into multiple small steps in the aforementioned steps. Therefore, at each small step, the current joint angle of the robotic arm can be obtained, and the joint correction amount at the current moment can be calculated. Then, the current joint angle is added to the current joint correction amount to obtain the target joint angle for the next small step.
[0102] In one possible implementation, the configuration of the robotic arm can be simplified without directly calculating the joint corrections based on the original configuration of the robotic arm, such as... Figure 13 As shown, the method of this application further includes: The initial joint angles are obtained by analytically solving the homogeneous matrix of the differential target based on a neural network model.
[0103] The initial joint angles are iteratively corrected based on the differential target homogeneous matrix and the current pose information to obtain the joint correction amount.
[0104] Reference Figure 13 After obtaining the homogeneous difference target matrix, it can be input into a pre-trained neural network model. The neural network model predicts the initial joint angles, and then iteratively corrects these initial joint angles using the forward kinematics module, the bias module, and the Jacobian module based on the homogeneous difference target matrix and the current pose information, thus obtaining the joint correction amount. The steps for iteratively correcting the initial joint angles based on the differential target homogeneous matrix and the current pose information to obtain the joint correction amount are the same as those in S1101-S1105 above, and the specific steps will not be repeated here.
[0105] Based on the same inventive concept, this application also provides a robotic arm control device corresponding to the robotic arm control method. Since the principle of the device in this application is similar to that of the robotic arm control method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0106] Figure 14 A schematic diagram of the structure of a robotic arm control device provided in an embodiment of this application is shown.
[0107] The acquisition module 1401 is used to acquire the current pose information and target pose information of the robotic arm. The target pose information includes: target position vector and target pose matrix. The current pose information includes: current position vector and current pose matrix. The first determining module 1402 is used to determine the differential target homogeneous matrix based on the current pose information and the target pose information. The differential target homogeneous matrix includes: multiple intermediate position vectors and intermediate pose matrix. The second determining module 1403 is used to determine the initial joint angle based on the current pose information, the target pose information, the differential target homogeneous matrix and the robot arm configuration, and to iteratively correct the initial joint angle to obtain the joint correction amount. The control module 1404 is used to control the movement of the robotic arm based on the joint correction amount and the current joint angle of the robotic arm.
[0108] Optionally, the first determining module 1402 is specifically used for: Based on the current pose information and the target pose information, differential interpolation is performed to obtain the difference homogeneous matrix; The difference homogeneous matrix is smoothed to obtain the difference target homogeneous matrix.
[0109] Optionally, the first determining module 1402 is specifically used for: Based on the current pose information and the target pose information, determine the position increment vector and the pose quaternion; Based on the position increment vector, the preset maximum step size, and the preset difference coefficient, the position increment vector is interpolated to obtain multiple intermediate position vectors. Based on the current attitude matrix, the target attitude matrix, and the preset scaling factor, the attitude quaternion is interpolated to obtain multiple intermediate attitude matrices.
[0110] Optionally, the first determining module 1402 is specifically used for: Determine the first ratio between the position increment vector and the scaling factor; If the first ratio is greater than the maximum step size, then the intermediate position vector is generated based on the maximum step size; If the first ratio is less than or equal to the maximum step size, the position increment vector is split according to the scaling factor to obtain the intermediate position vector.
[0111] Optionally, the first determining module 1402 is specifically used for: Determine the incremental magnitude based on the intermediate position vector and the current position vector; Input the incremental modulus into the preset second-order system model to obtain the smoothing coefficient; The time coefficient is obtained based on the smoothing coefficient and the increment modulus; The quaternion parameters are determined based on the time coefficient, intermediate attitude matrix, and current attitude matrix. The transition position vector is determined based on the smoothing coefficient, the intermediate position vector, and the current position vector. The difference homogeneous matrix is smoothed by the transition position vector and quaternion parameters to obtain the difference target homogeneous matrix.
[0112] Optionally, the second determining module 1403 is specifically used for: The configuration of the robotic arm is simplified to obtain a simplified structure of the robotic arm. The initial joint angles are determined based on the target pose information and the simplified structure of the robotic arm. The initial joint angles are iteratively corrected based on the differential target homogeneous matrix and the current pose information to obtain the joint correction amount.
[0113] Optionally, the second determining module 1403 is specifically used for: A. Perform positive kinematics calculation on the initial joint angles to obtain the temporary pose information corresponding to the initial joint angles; B. Determine the temporary pose information and the deviation information of the homogeneous matrix of the differential target; C. Solve the Jacobian pseudo-inverse for the current pose information to obtain the Jacobian pseudo-inverse matrix; D. Determine the correction amount based on the deviation information and the Jacobian pseudo-inverse matrix; E. Determine the sum of the correction amount and the initial joint angle, and determine whether the preset iteration termination condition is met. If not, use the sum as the new initial joint angle, and re-execute step AE until the preset iteration termination condition is met, and use the correction amount of the current round as the joint correction amount.
[0114] Optionally, the second determining module 1403 is also used for: The initial joint angles are obtained by analytically solving the homogeneous matrix of the difference target based on the neural network model. The initial joint angles are iteratively corrected based on the differential target homogeneous matrix and the current pose information to obtain the joint correction amount.
[0115] This application embodiment calculates a differential target homogeneous matrix by performing differential interpolation on the current pose information and the target pose information. This enables trajectory planning from the current pose to the target pose, ensuring smooth and stable pose changes and avoiding robot arm loss of control caused by iterative divergence and sudden trajectory changes, thus further improving the reliability and stability of robot arm control. Iterative methods suffer from the problem of fuzzy initial values and easy divergence. This application determines an approximately realistic initial joint angle and iteratively corrects the initial joint angle to obtain the joint correction amount. This significantly reduces the number of iterations, improves real-time responsiveness, and ensures that each iteration effectively converges to a valid solution, preventing solution failure due to strong coupling interference.
[0116] Figure 15 This illustration shows a schematic diagram of an electronic device provided in an embodiment of this application. The electronic device may be an electronic device that is communicatively connected to a robotic arm, or an electronic device integrated and deployed inside the robotic arm. It includes: a processor 1501, a storage medium 1502, and a bus 1503. The storage medium 1502 stores machine-readable instructions executable by the processor 1501. When the electronic device runs a robotic arm control method as described in the embodiment, the processor 1501 communicates with the storage medium 1502 via the bus 1503. The processor 1501 executes the machine-readable instructions. The preamble of the method item of the processor 1501 executes the steps in the above-described robotic arm control method.
[0117] This application also provides a computer-readable storage medium storing a computer program that is executed by a processor, which performs the steps in the above-described robotic arm control method.
[0118] In this embodiment, the computer program, when run by the processor, can also execute other machine-readable instructions to perform other methods as described in the embodiments. For details on the specific execution steps and principles, please refer to the description of the embodiments, which will not be repeated here.
[0119] 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.
[0120] 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.
[0121] 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.
[0122] 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.
[0123] 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.
[0124] 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, include: The current pose information and target pose information of the robotic arm are obtained. The target pose information includes a target position vector and a target pose matrix. The current pose information includes a current position vector and a current pose matrix. Based on the current pose information and the target pose information, a differential target homogeneous matrix is determined, which includes: multiple intermediate position vectors and an intermediate pose matrix; Based on the current pose information, the target pose information, the differential target homogeneous matrix, and the robotic arm configuration, the initial joint angles are determined, and the initial joint angles are iteratively corrected to obtain the joint correction amount. The movement of the robotic arm is controlled based on the joint correction amount and the current joint angle of the robotic arm.
2. The method according to claim 1, characterized in that, The step of determining the differential target homogeneous matrix based on the current pose information and the target pose information includes: Based on the current pose information and the target pose information, differential interpolation is performed to obtain a differential homogeneous matrix; The difference homogeneous matrix is smoothed to obtain the difference target homogeneous matrix.
3. The method according to claim 2, characterized in that, The step of performing differential interpolation calculation based on the current pose information and the target pose information to obtain a difference homogeneous matrix includes: Based on the current pose information and the target pose information, determine the position increment vector and the pose quaternion; Based on the position increment vector, the preset maximum step size, and the preset difference coefficient, the position increment vector is interpolated to obtain multiple intermediate position vectors. The attitude quaternions are interpolated based on the current attitude matrix, the target attitude matrix, and a preset scaling factor to obtain multiple intermediate attitude matrices.
4. The method according to claim 3, characterized in that, The step of interpolating the position increment vector based on the position increment vector, a preset maximum step size, and a preset scaling factor to obtain the intermediate position vector includes: Determine a first ratio between the position increment vector and the scaling factor; If the first ratio is greater than the maximum step size, then the intermediate position vector is generated based on the maximum step size; If the first ratio is less than or equal to the maximum step size, the position increment vector is split according to the ratio coefficient to obtain the intermediate position vector.
5. The method according to claim 2, characterized in that, The smoothing process of the difference homogeneous matrix to obtain the target difference homogeneous matrix includes: The incremental magnitude is determined based on the intermediate position vector and the current position vector; The incremental modulus is input into a preset second-order system model to obtain the smoothing coefficient; The time coefficient is obtained based on the smoothing coefficient and the incremental modulus; The quaternion parameters are determined based on the time coefficient, the intermediate attitude matrix, and the current attitude matrix. The transition position vector is determined based on the smoothing coefficient, the intermediate position vector, and the current position vector; The difference homogeneous matrix is smoothed based on the transition position vector and the quaternion parameters to obtain the difference target homogeneous matrix.
6. The method according to claim 1, characterized in that, The step involves determining initial joint angles based on the current pose information, the target pose information, the differential target homogeneous matrix, and the robotic arm configuration, and iteratively correcting the initial joint angles to obtain joint correction amounts, including: The robotic arm configuration is simplified to obtain a simplified robotic arm structure; Based on the target pose information and the simplified structure of the robotic arm, the initial joint angles are determined. The initial joint angle is iteratively corrected based on the differential target homogeneous matrix and the current pose information to obtain the joint correction amount.
7. The method according to claim 6, characterized in that, The step of iteratively correcting the initial joint angle based on the differential target homogeneous matrix and the current pose information to obtain the joint correction amount includes: A. Perform positive kinematics calculation on the initial joint angle to obtain the temporary pose information corresponding to the initial joint angle; B. Determine the deviation information between the temporary pose information and the differential target homogeneous matrix; C. Solve the Jacobian pseudo-inverse on the current pose information to obtain the Jacobian pseudo-inverse matrix; D. Determine the correction amount based on the deviation information and the Jacobian pseudo-inverse matrix; E. Determine the sum of the correction amount and the initial joint angle, and determine whether the preset iteration termination condition is met. If not, use the sum as the new initial joint angle, and re-execute step AE until the preset iteration termination condition is met, and use the correction amount of the current round as the joint correction amount.
8. The method according to claim 1, characterized in that, The method further includes: The initial joint angles are obtained by performing an analytical inverse solution on the differential target homogeneous matrix based on a neural network model. The initial joint angle is iteratively corrected based on the differential target homogeneous matrix and the current pose information to obtain the joint correction amount.
9. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of a robotic arm control method as described in any one of claims 1 to 8.
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 a robotic arm control method as described in any one of claims 1 to 8.