Robotic arm control method and device, computer device, readable storage medium and program product
Patent Information
- Application Number
- CN202611055025.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-15
- Publication Date
- 2026-10-27
AI Technical Summary
[0004]然而,基于最小奇异值限制的避奇异方法会导致在奇异区间容易出现拖动卡顿的情况
[0041]上述机械臂控制方法、装置、计算机设备、计算机可读存储介质和计算机程序产品,首先获取机械臂末端的合外力以及当前关节角度;根据合外力以及当前关节角度,计算笛卡尔空间的第一关节速度以及关节空间的第二关节速度;能够获取机械臂在当前构型下的在末端的合外力,并根据机械臂在当前构型下的末端的合外力分别计算笛卡尔空间以及关节空间的关节速度。笛卡尔空间的第一关节速度可以避免关节超速行为而导致的卡顿,关节空间的第二关节速度是根据当前关节角度确定,无论机械臂处于何种构型,机械臂末端拖动手感均恒定参数,确保手感一致性。然后,根据当前关节角度的奇异接近度,确定融合权重系数;其中,奇异接近度表示机械臂在当前关节角度的可操作度;根据融合权重系数对第一关节速度和第二关节速度进行加权融合,确定目标关节速度;其中,目标关节速度用于控制机械臂运动。通过根据当前关节角度的融合权重系数实现笛卡尔空间和关节空间的平滑过渡,避免硬切换导致的速度突变和冲击,全程拖动顺滑自然。
Smart Images

Figure CN122975637A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robotics technology, and in particular to a robotic arm control method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] With the rapid development of robotics technology, the application of robotic arms is becoming increasingly widespread. Among them, drag-and-drop teaching has become an important method of human-robot collaboration due to its intuitive operation and high programming efficiency. Cartesian space drag-and-drop teaching typically utilizes a six-dimensional force sensor to obtain the external force at the end of the robotic arm, calculates the change in the end-effector's pose through admittance control, and then solves the joint angles through inverse kinematics to drive the motors, thereby achieving the teaching of the robotic arm. However, when the robotic arm is in a singular configuration, or when the end-effector pose given by the admittance controller exceeds the actual reachable workspace of the robotic arm, inverse kinematics often struggles to obtain effective joint solutions, which can easily lead to inverse kinematics failure and abnormal motion.
[0003] Traditional methods for avoiding singularities through drag-and-drop teaching include two approaches: one is based on the minimum singularity constraint, where the constraint increases as the core approaches the singularity; the other is to map admittance control from Cartesian space to joint space, that is, to convert the net external force at the end of the robotic arm into the net external torque of each joint through the Jacobian transpose, and then to conduct admittance control in the joint space.
[0004] However, singularity avoidance methods based on minimum singularity constraints can easily lead to dragging stutters in singular regions. Methods that map admittance control from Cartesian space to joint space suffer from inconsistent dragging feel due to the non-constant transformation of joint space admittance control parameters to Cartesian space. This means that the dragging feel varies with the robotic arm's configuration under the same force in different postures, resulting in inconsistent end-effector response speed and damping, leading to unstable dragging feel. Summary of the Invention
[0005] Therefore, it is necessary to provide a robotic arm control method, device, computer equipment, computer-readable storage medium, and computer program product that can improve the smoothness of dragging in singular regions in response to the above-mentioned technical problems.
[0006] In a first aspect, this application provides a robotic arm control method, the method comprising:
[0007] Obtain the net external force at the end of the robotic arm and the current joint angles of all joints;
[0008] Based on the net external force and the current joint angle, calculate the first joint velocity in Cartesian space and the second joint velocity in joint space, respectively.
[0009] The fusion weight coefficient is determined based on the singular proximity of the current joint angle; wherein the singular proximity represents the operability of the robotic arm at the current joint angle.
[0010] The first joint velocity and the second joint velocity are weighted and fused according to the fusion weight coefficient to determine the target joint velocity; wherein the target joint velocity is used to control the movement of the robotic arm.
[0011] In one embodiment, calculating the first joint velocity in Cartesian space based on the resultant external force and the current joint angle includes:
[0012] Calculate the Cartesian velocity at the end of the robotic arm based on the net external force;
[0013] Determine the Jacobian pseudo-inverse matrix based on the current joint angle;
[0014] The Cartesian velocity is mapped to the first joint velocity in the Cartesian space based on the Jacobian pseudo-inverse matrix.
[0015] In one embodiment, determining the Jacobian pseudo-inverse matrix based on the current joint angle includes:
[0016] Determine the corresponding Jacobian matrix based on the current joint angle;
[0017] The pseudo-inverse of the Jacobian matrix is calculated using the damped least squares method, thus obtaining the Jacobian pseudo-inverse matrix.
[0018] In one embodiment, calculating the second joint velocity in the joint space based on the resultant external force and the current joint angle includes:
[0019] Based on the current joint angle, determine the Jacobian transpose matrix, the target inertia matrix in Cartesian space, and the target damping matrix;
[0020] The resultant external force is mapped to joint torque using the Jacobian transpose matrix.
[0021] The inertia matrix of the joint space is determined based on the target inertia matrix; the damping matrix of the joint space is determined based on the target damping matrix.
[0022] The second joint velocity of the joint space is determined based on the joint torque, the inertia matrix of the joint space, and the damping matrix.
[0023] In one embodiment, determining the fusion weight coefficient based on the singular proximity of the current joint angle includes:
[0024] Determine the singular proximity, the lower limit of singular proximity, and the upper limit of singular proximity based on the current joint angle;
[0025] The fusion weight coefficient is determined based on the singular proximity, the lower limit of the singular proximity, and the upper limit of the singular proximity.
[0026] In one embodiment, determining the fusion weight coefficient based on the singular proximity, the lower limit of the singular proximity, and the upper limit of the singular proximity includes:
[0027] When the singular proximity is lower than or equal to the singular proximity lower limit, the fusion weight coefficient is determined to be a first value;
[0028] When the singular proximity is higher than or equal to the upper limit of the singular proximity, the fusion weight coefficient is determined to be the second value;
[0029] When the singular proximity is higher than the lower limit of singular proximity and lower than the upper limit of singular proximity, the fusion weight coefficient is determined as a third value based on the ratio of the first difference and the second difference; wherein, the first difference is the difference between the singular proximity and the lower limit of singular proximity; the second difference is the difference between the upper limit of singular proximity and the lower limit of singular proximity; the third value is greater than the first value and less than the second value, and the first value is less than the second value.
[0030] In one embodiment, determining the singular proximity based on the current joint angle includes:
[0031] Obtain the Jacobian matrix and Jacobian transpose matrix of the current joint angle;
[0032] Based on the Jacobian matrix and the Jacobian transpose matrix, the singular proximity of the current joint angle is determined.
[0033] Secondly, this application also provides a robotic arm control device, the device comprising:
[0034] The acquisition module is used to acquire the net external force at the end of the robotic arm and the current joint angle of all joints;
[0035] The calculation module is used to calculate the first joint velocity in Cartesian space and the second joint velocity in joint space based on the resultant external force and the current joint angle, respectively.
[0036] The first determining module is used to determine the fusion weight coefficient based on the singular proximity of the current joint angle; wherein the singular proximity represents the operability of the robotic arm at the current joint angle.
[0037] The second determining module is used to perform weighted fusion of the first joint velocity and the second joint velocity according to the fusion weight coefficient to determine the target joint velocity; wherein the target joint velocity is used to control the movement of the robotic arm.
[0038] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.
[0039] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0040] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0041] The aforementioned robotic arm control method, device, computer equipment, computer-readable storage medium, and computer program product first acquire the net external force at the end effector of the robotic arm and the current joint angle. Based on the net external force and the current joint angle, they calculate the first joint velocity in Cartesian space and the second joint velocity in joint space. This allows them to acquire the net external force at the end effector of the robotic arm in the current configuration and calculate the joint velocities in Cartesian space and joint space based on this force. The first joint velocity in Cartesian space avoids stuttering caused by joint overspeed. The second joint velocity in joint space is determined based on the current joint angle, ensuring consistent end-effector dragging feel regardless of the robotic arm's configuration. Then, a fusion weighting coefficient is determined based on the singular proximity of the current joint angle; where singular proximity represents the operability of the robotic arm at the current joint angle. The first and second joint velocities are weighted and fused according to the fusion weighting coefficient to determine the target joint velocity, which is used to control the movement of the robotic arm. By using the fusion weight coefficient based on the current joint angle, a smooth transition between Cartesian space and joint space is achieved, avoiding sudden speed changes and shocks caused by hard switching, resulting in a smooth and natural dragging process throughout. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1This is a conventional admittance control example.
[0044] Figure 2 This is a flowchart illustrating a robotic arm control method in one embodiment;
[0045] Figure 3 This is a flowchart illustrating the calculation of the first joint velocity in Cartesian space in one embodiment.
[0046] Figure 4 This is a schematic diagram of the process for calculating the second joint velocity in the joint space in one embodiment;
[0047] Figure 5 This is a flowchart illustrating the process of determining the fusion weight coefficients in one embodiment;
[0048] Figure 6 This is a flowchart illustrating a robotic arm control method in one embodiment;
[0049] Figure 7 This is a structural block diagram of a robotic arm control device in one embodiment;
[0050] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0052] Traditional robotic arm Cartesian space actuation uses admittance control. First, a six-dimensional force sensor acquires the net external force at the end of the robotic arm. Then, the net external force is processed by the admittance controller to output Cartesian space displacement, which is then obtained through inverse kinematics to obtain the joint angle. The core idea of the admittance controller is to model the end of the robotic arm as a virtual mass (inertia)-damped virtual system. The net external force applied by the operator acts on this virtual system, driving the end of the robotic arm to produce motion (acceleration, velocity, displacement). Figure 1 The diagram shows a traditional admittance control block diagram, where x represents the pose in Cartesian space. Represents the Cartesian space velocity at the end of the robotic arm. Represents the Cartesian acceleration at the end of the robotic arm. The net external force at the end effector of the robotic arm, as measured by a six-dimensional force sensor. The joint angle is obtained through inverse kinematics, and K represents the spring stiffness coefficient of the admittance controller. Let S represent the integral and S represent the differential. In Cartesian space, the core dynamic equation of the Cartesian space admittance controller is shown in equation (1).
[0053] Formula (1)
[0054] in Let be the desired inertia matrix. Let be the desired damping matrix. The net external force at the end effector of the robotic arm, as measured by a six-dimensional force sensor. Represents the Cartesian space velocity at the end of the robotic arm. This represents the Cartesian acceleration at the end effector of the robotic arm.
[0055] In robot kinematics, the Jacobian matrix describes the mapping relationship between the joint velocities of each joint of the robotic arm and the Cartesian space velocity of the end effector of the robotic arm. The Jacobian matrix is defined as shown in formula (2), and the mapping relationship between the joint velocities of each joint of the robotic arm and the Cartesian space velocity of the end effector of the robotic arm is shown in formula (3).
[0056] Formula (2)
[0057] Formula (3)
[0058] in, The velocity in Cartesian space at the end of the robotic arm. Let be the joint velocities of each joint of the robotic arm. This is the Jacobian matrix under the current joint configuration. The number of joints in the robotic arm. Jacobian matrix. There are 6 lines in total Each column corresponds to a joint, and each row corresponds to a movement direction of the robotic arm's end effector (three translations and three rotations); these represent the joint pairs in space corresponding to the columns. The contributions in the six velocity directions are obtained by taking partial derivatives of the forward kinematics equations of the robotic arm.
[0059] The problem with traditional methods is that if Cartesian space admittance control is used, and the Cartesian space velocity of the robotic arm's end effector output from the admittance controller is inversely mapped to joint velocities via a Jacobian matrix, as the Jacobian matrix approaches singularity, its inverse matrix elements tend to infinity. This means that the Jacobian matrix, when singular, restricts motion in a certain direction. To force end-effector movement in that direction, the Jacobian inverse matrix requires the corresponding joint to rotate at an infinite speed. This is the mathematical root of joint overspeed in singular configurations.
[0060] If joint space admittance control is used, then the transpose of the Jacobian matrix is used. The net external force at the end of the robotic arm is mapped into the equivalent torque of the joint. Then, admittance control is performed in joint space. This does not involve the inverse of the Jacobian matrix. This method mathematically avoids the risk of joint overspeed, ensuring consistent stability and safety. However, the joint space admittance parameter (the inertia matrix of the joint space) is a concern. Damping matrix of joint space If set to a fixed value, its equivalent inertia and damping in Cartesian space will change with the configuration of the robotic arm. This will cause the speed, direction and damping of the robotic arm end to be inconsistent when the operator applies the same force in different postures, which will seriously affect the stability of the dragging feel.
[0061] In one embodiment, such as Figure 2 As shown, a robotic arm control method is provided. This embodiment illustrates the method applied to a terminal, but it is understood that the method can also be applied to a server, or to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps S202 to S208. Wherein:
[0062] Step S202: Obtain the net external force at the end of the robotic arm and the current joint angles of all joints.
[0063] Optionally, a six-dimensional force sensor installed at the end of the robotic arm can be used to collect the net external force applied by the operator in real time, including forces in three directions. ) and torque in three directions ( As shown in formula (4), the terminal obtains the net external force at the end of the robotic arm through a six-dimensional force sensor.
[0064] Formula (4)
[0065] Optionally, each joint of the robotic arm is equipped with an encoder, which directly measures the angle rotated by the motor of each joint. The terminal reads the current angle of all joints in each control cycle from the encoder in real time, i.e., the current joint angle. The current configuration of the robotic arm can be determined based on the current joint angle.
[0066] Step S204: Calculate the first joint velocity in Cartesian space and the second joint velocity in joint space based on the net external force and the current joint angle.
[0067] Among them, the velocity of the first joint and the velocity of the second joint are both dimensional vector, This represents the number of joints in the robotic arm. Among them, It is a positive integer.
[0068] Optionally, the terminal calculates the first joint velocity in Cartesian space for each joint in the corresponding control cycle based on the net external force and the current joint angle. and the corresponding second joint velocity in the joint space This yields the joint velocities in both spaces.
[0069] Step S206: Determine the fusion weight coefficient based on the singularity of the current joint angle.
[0070] Among them, singular proximity This indicates the maneuverability of the robotic arm at the current joint angle. It quantitatively describes how close the robotic arm's current configuration is to a singular configuration; configuration refers to the current combination of angular positions of the robotic arm's joints. Singularity proximity reflects the robotic arm's ability to move its end effector in all directions at the current joint angle, i.e., maneuverability. Higher maneuverability indicates a more flexible robotic arm, moving away from a singularity; lower maneuverability indicates a robotic arm closer to a singularity, with limited movement capabilities.
[0071] Fusion weighting coefficient It is used to determine the output ratio of the first joint speed and the second joint speed in the current control cycle.
[0072] Optionally, the terminal determines the fusion weight coefficients based on the singular proximity of the current joint angle, wherein, It is the fusion weighting coefficient.
[0073] Fully employing Cartesian space admittance control, this provides the best operating feel when the robotic arm is far from singular configurations and in good joint condition. In this case, the fusion weight coefficient can be set to 1.
[0074] Fully employing joint space admittance control is used when the robotic arm is near a singular configuration or the joint is close to its limit, prioritizing safety. In this case, the fusion weight coefficient can be set to 0.
[0075] By proportionally mixing the outputs of the two channels, a smooth transition from Cartesian control to joint control is achieved, avoiding speed abrupt changes and mechanical shocks caused by hard switching. At this time, the fusion weight coefficient can be set between 0 and 1.
[0076] Step S208: The velocity of the first joint and the velocity of the second joint are weighted and fused according to the fusion weight coefficient to determine the target joint velocity.
[0077] The target joint speed includes the rotation direction and speed of the corresponding joint, which is used to control the movement of the robotic arm.
[0078] Optionally, the terminal adjusts the first joint velocity according to the fusion weighting coefficient using formula (5). Second joint velocity Weighted fusion is performed to determine the target joint velocity for each joint in each control cycle.
[0079] Formula (5)
[0080] In the formula, Let be the velocity of the first joint in Cartesian space; The second joint velocity in the joint space; This represents the velocity of the target joint after fusion. In the working region far from the singularity, The fusion result is mainly output from the Cartesian channel; in the singular region, The fusion result is automatically converted into a safe output for the joint channel. The entire process is continuous and smooth, with no hard switching.
[0081] For example, a robotic arm includes n joints, where n is a positive integer. Taking 3 as an example, the terminal calculates the first joint velocity and the second joint velocity corresponding to the three joints, obtaining the target joint velocities. The first joint velocity of one joint is 0.5 rad / s, meaning that the joint rotates at a speed of 0.5 rad / s in its predefined positive direction (e.g., clockwise); the second joint velocity is -0.2 rad / s, rotating at a speed of -0.2 rad / s in its predefined opposite direction (e.g., counterclockwise).
[0082] The terminal integrates the target joint velocity to obtain the joint angle command, and sends the command to the motor, as shown in formula (6).
[0083] Formula (6)
[0084] In the formula, To control the cycle; The joint angle for the (k-1)th control cycle; Represents the fused target joint velocity after the k-th control cycle; Let be the joint angle in the kth control cycle.
[0085] In the aforementioned robotic arm control method, the net external force at the end effector of the robotic arm and the current joint angle are first obtained. Based on the net external force and the current joint angle, the first joint velocity in Cartesian space and the second joint velocity in joint space are calculated. This allows the acquisition of the net external force at the end effector of the robotic arm in the current configuration, and the calculation of the joint velocities in Cartesian space and joint space based on the net external force at the end effector of the robotic arm in the current configuration. The first joint velocity in Cartesian space can avoid stuttering caused by joint overspeed behavior. The second joint velocity in joint space is determined based on the current joint angle, ensuring a constant dragging feel at the end effector of the robotic arm regardless of its configuration, thus ensuring consistent feel. Furthermore, since it does not involve the Jacobian inverse matrix, safety is also guaranteed. Then, a fusion weighting coefficient is determined based on the singular proximity of the current joint angle; where singular proximity represents the operability of the robotic arm at the current joint angle. The first and second joint velocities are weighted and fused according to the fusion weighting coefficient to determine the target joint velocity, which is used to control the movement of the robotic arm. By using the fusion weight coefficient based on the current joint angle, a smooth transition between Cartesian space and joint space is achieved, avoiding sudden speed changes and shocks caused by hard switching, resulting in a smooth and natural dragging process throughout.
[0086] In one exemplary embodiment, such as Figure 3 As shown, the first joint velocity in Cartesian space is calculated based on the net external force and the current joint angle, including the following steps S302 to S306. Wherein:
[0087] Step S302: Calculate the Cartesian velocity at the end of the robotic arm based on the net external force.
[0088] Optionally, the terminal calculates the velocity response that the end of the robotic arm should produce in Cartesian space based on the resultant external force, and discretizes the core dynamic equation of the Cartesian space admittance controller, namely formula (1), to obtain the Cartesian velocity update formula for each control cycle as shown in formula (7).
[0089] Formula (7)
[0090] In the formula, The Cartesian space velocity of the robotic arm's end effector, calculated for the k-th control cycle. Let be the Cartesian space velocity of the robotic arm's end effector during the (k-1)th control cycle. The target inertia matrix represents the Cartesian space. The target damping matrix represents the Cartesian space.
[0091] Step S304: Determine the Jacobian pseudo-inverse matrix based on the current joint angle.
[0092] Each configuration (a set of joint angles) uniquely determines a Jacobian matrix.
[0093] Optionally, the corresponding Jacobian matrix can be determined based on the current joint angle. Each element of the Jacobian matrix is obtained by taking the partial derivative of the forward kinematics equations of the robotic arm, as shown in formula (2). The Jacobian pseudo-inverse matrix is determined by the standard pseudo-inverse matrix or the damped least squares method. .
[0094] Step S306: Map the Cartesian velocity to the first joint velocity in Cartesian space based on the Jacobian pseudo-inverse matrix.
[0095] Optionally, the terminal uses formula (8) based on the Jacobian pseudo-inverse matrix. The Cartesian space velocity of the robotic arm's end effector during the kth control cycle. Mapped to the first joint velocity in Cartesian space at the end of the robotic arm .
[0096] Formula (8)
[0097] In this embodiment, the Jacobi pseudo-inverse matrix is used instead of the Jacobi inverse matrix. This avoids the joint overspeed behavior caused by the Jacobi inverse matrix requiring the corresponding joint to rotate at an infinite speed in order to force the end effector of the robotic arm to move in that direction. This can prevent joint overspeed phenomena from occurring in the singular region.
[0098] In an exemplary embodiment, determining the Jacobian pseudo-inverse matrix based on the current joint angle includes: determining the corresponding Jacobian matrix based on the current joint angle; and calculating the pseudo-inverse of the Jacobian matrix using the damped least squares method to obtain the Jacobian pseudo-inverse matrix.
[0099] Optionally, since each configuration (a set of joint angles) uniquely determines a Jacobian matrix, the terminal determines the corresponding Jacobian matrix based on the current joint angle. To prevent overspeeding in the singular region, the damped least squares (DLS) method is used to calculate the Jacobi pseudo-inverse matrix of Jacobi as shown in formula (9) to replace the Jacobi inverse matrix, thereby mapping the Cartesian space velocity of the end of the robotic arm to the joint space velocity and ensuring that no overspeeding occurs.
[0100] Formula (9)
[0101] In the formula, It is the Jacobian pseudo-inverse matrix. I is the identity matrix, where the coefficients are adaptively adjusted based on singular proximity.
[0102] When away from the strange, The mapping is close to the exact inverse mapping; it approaches the singularity. Gradually increasing, it actively suppresses joint velocity output in unusual directions, preventing velocity command explosions at the source. This ensures that even with the fusion weighting coefficients... Even if the speed has not completely decreased to zero (e.g., at the edge of a singular region), the Cartesian channel itself will not output dangerous speed commands, further enhancing the robustness of the system.
[0103] In this embodiment, the pseudo-inverse of the Jacobian matrix is calculated using the damped least squares (DLS) method instead of direct inversion. In the singular region, joint space admittance control is automatically used, which mathematically eliminates the risk of joint overspeed and impact.
[0104] In one exemplary embodiment, such as Figure 4 As shown, the second joint velocity in the joint space is calculated based on the resultant external force and the current joint angle, including steps S402 to S408. Wherein:
[0105] Step S402: Determine the Jacobian transpose matrix, the target inertia matrix in Cartesian space, and the target damping matrix based on the current joint angle.
[0106] Optionally, the terminal determines the corresponding Jacobian matrix based on the current joint angle. According to the Jacobian matrix Determine the Jacobian transpose matrix .
[0107] The terminal determines the target inertial matrix in Cartesian space based on the current joint angle. and target damping matrix , which are fixed constants. That is, the inertia matrix and damping matrix in Cartesian space as desired by the operator.
[0108] Step S404: Map the resultant external force into joint torque using the Jacobian transpose matrix.
[0109] Optionally, the terminal maps the resultant external force into joint torque through the Jacobian transpose matrix, as shown in Equation (10).
[0110] Formula (10)
[0111] In the formula, The net external force at the end of the robotic arm is mapped to the equivalent torque of each joint, also known as the joint torque.
[0112] The Jacobian transpose and the Jacobian inverse are fundamentally different: the Jacobian inverse either does not exist or tends to infinity at singular configurations, while the Jacobian transpose is always bounded. At singular configurations, the Jacobian transpose only makes the joint torque of some joints approach zero, indicating a reduction in the flexibility of the robotic arm in that direction, but it does not produce infinite joint velocities. This is the mathematical guarantee of the safety of the joint space passage.
[0113] Step S406: Determine the inertia matrix of the joint space based on the target inertia matrix; determine the damping matrix of the joint space based on the target damping matrix.
[0114] To address the inconsistency in feel during pure joint space admittance control, a configuration-adaptive admittance parameter design is employed. The admittance parameters of the joint space are designed to change in real time with the configuration of the robotic arm, as shown in formulas (11) and (12).
[0115] Formula (11)
[0116] Formula (12)
[0117] In the formula, Let the target inertia matrix be in Cartesian space. Let be the target damping matrix in Cartesian space. and All are fixed constants. Let be the inertia matrix in joint space. The damping matrix in joint space changes with the joint position. The key significance of this design is that although admittance control is performed in joint space, its equivalent inertia and damping in Cartesian space remain constant. The Cartesian equivalent inertia matrix calculated using this formula is always equal to the target inertia matrix. This is independent of the robotic arm configuration. Similarly, the equivalent damping matrix is always equal to the target damping matrix. This ensures that the robotic arm's end effector produces a consistent motion response regardless of the operator's application of the same force in any configuration. In other words, the operator can obtain a consistent motion speed and damping feel by applying the same net external force to the robotic arm's end effector in any configuration, thus completely solving the problem of haptic feedback.
[0118] Step S408: Determine the second joint velocity in the joint space based on the joint torque, the inertia matrix of the joint space, and the damping matrix.
[0119] Optionally, the second joint velocity in the joint space is determined based on the joint torque, the inertia matrix, and the damping matrix determined by the current joint angle. Based on the above adaptive parameters, the discretized update formula of the joint space admittance controller is shown in formula (13), from which the second joint velocity calculated by the joint space admittance control channel can be calculated. .
[0120] Formula (13)
[0121] In the formula, The velocity of the second joint in the kth control cycle; The velocity of the second joint in the (k-1)th control cycle; Represents joint torque; The inverse matrix representing the inertia matrix in joint space, The damping matrix represents the joint space.
[0122] In this embodiment, when admittance control is performed in joint space, and the discretized update formula is shown in Equation (13), although the control is performed in joint space, the response of the robotic arm end effector to the net external force in Cartesian space is equivalent to a target inertial matrix in Cartesian space. Target damping matrix in Cartesian space The virtual system, and the equivalent characteristics are independent of the real-time configuration of the robotic arm, can ensure that the dragging feel of the robotic arm end is constant and equal to the Cartesian space target inertia and target damping set by the operator, regardless of the configuration of the robotic arm, thus completely solving the problem of feel drift.
[0123] In an exemplary embodiment, determining the fusion weight coefficient based on the singular proximity of the current joint angle includes: determining the singular proximity, the lower limit of singular proximity, and the upper limit of singular proximity based on the current joint angle; and determining the fusion weight coefficient based on the singular proximity, the lower limit of singular proximity, and the upper limit of singular proximity.
[0124] Optionally, the terminal determines the singular proximity based on the current joint angle, including: obtaining the Jacobian matrix and the Jacobian transpose matrix of the current joint angle; and determining the singular proximity of the current joint angle based on the Jacobian matrix and the Jacobian transpose matrix, as shown in formula (14).
[0125] Formula (14)
[0126] In the formula, The singular proximity, representing the current joint angle, is also known as the maneuverability of the robotic arm in its current configuration. .when When the value is large, the robotic arm's posture is relaxed, and the end effector's motion transmission capability in all directions is balanced, avoiding strangeness and exhibiting high flexibility; when When the value is small, the robotic arm's posture approaches singularity, with its movement capability in at least one direction approaching zero, resulting in low dexterity. When When the value approaches 0, the robotic arm approaches a singular configuration, and the Jacobian matrix is deficient in row rank. `det()` represents the determinant operation.
[0127] Furthermore, the terminal obtains the lower limit and upper limit of singular proximity, and determines the fusion weight coefficient based on the singular proximity, the lower limit and the upper limit of singular proximity.
[0128] It should be noted that for scenarios with high flexibility requirements, the lower and upper limits of singular proximity can be set relatively small to retain a larger Cartesian workspace. For scenarios with high security requirements, the lower and upper limits of singular proximity can be set relatively large to intervene in the joint channel earlier.
[0129] In this embodiment, the singular proximity is determined by determining the current joint angle, which quantifies the abstract "singular risk" into a continuous and calculable index. The singular proximity is then determined by determining the current joint angle to determine the fusion weight coefficient, thus avoiding the sudden speed changes and shocks caused by switching between Cartesian space and joint space, thereby achieving a smooth, gradual, and predictable transition between the two spatial modes.
[0130] In one exemplary embodiment, such as Figure 5 As shown, the fusion weight coefficients are determined based on the singular proximity, the lower limit of singular proximity, and the upper limit of singular proximity, including steps S502 to S506. Wherein:
[0131] Step S502: When the singular proximity is lower than or equal to the lower limit of singular proximity, the fusion weight coefficient is determined as the first value.
[0132] Step S504: When the singular proximity is higher than or equal to the upper limit of singular proximity, the fusion weight coefficient is determined to be the second value.
[0133] The first value is, for example, 0; the second value is, for example, 1.
[0134] Step S506: When the singular proximity is higher than the lower limit of singular proximity and lower than the upper limit of singular proximity, the fusion weight coefficient is determined as the third value according to the ratio of the first difference and the second difference.
[0135] The first difference is the difference between the singular proximity and the lower limit of singular proximity; the second difference is the difference between the upper limit of singular proximity and the lower limit of singular proximity; the third value is greater than the first value and less than the second value, and the first value is less than the second value.
[0136] The fusion weight coefficient is determined as shown in formula (15).
[0137] Formula (15)
[0138] in It is the fusion weighting coefficient. For singular proximity, This is the lower bound for singular proximity. is the upper limit of singular proximity, and is a constant defined based on the actual drag feel.
[0139] Fusion weighting coefficient The physical meaning is as follows:
[0140] when When fully controlled by Cartesian space admittance, the robotic arm is far from singular configurations and in good joint condition, providing the best operating feel.
[0141] when When the robotic arm is in a singular configuration or the joint is close to its limit, the control is switched to joint space admittance control. This is for situations where the robotic arm is in a singular configuration or the joint is close to its limit, prioritizing safety.
[0142] when At the same time, the outputs of the two channels are mixed proportionally to achieve a smooth transition from Cartesian control to joint control, avoiding speed abrupt changes and mechanical shocks caused by hard switching.
[0143] In this embodiment, The larger the value, the further away from the strange. The smaller the value, the closer it is to singularity. When When it exceeds the preset upper limit, It fully adopts Cartesian space admittance control to ensure a good drag feel; when When it is less than the preset lower limit, Completely switch to joint space admittance control to ensure safety; when When it is between the upper and lower limits, By continuously varying between 0 and 1 (e.g., linear interpolation), a smooth transition between the two control modes can be achieved, avoiding sudden speed changes and shocks caused by hard switching.
[0144] In one exemplary embodiment, such as Figure 6 As shown, the terminal uses a six-dimensional force sensor installed at the end of the robotic arm to collect the net external force applied by the operator in real time, and reads the current joint angle in each control cycle from the encoder in real time. The current configuration of the robotic arm can be determined based on the current joint angle.
[0145] The terminal calculates the velocity response of the robotic arm end in Cartesian space based on the net external force. The core dynamic equation of the Cartesian space admittance controller, i.e., equation (1), is discretized to obtain the Cartesian space velocity update equation for the robotic arm end in each control cycle, as shown in equation (7). The corresponding Jacobian matrix is determined based on the current joint angle. Each element of the Jacobian matrix is obtained by taking the partial derivative of the forward kinematics equations of the robotic arm, as shown in formula (2). The pseudo-inverse of the Jacobian matrix is calculated using the damped least squares (DLS) method as shown in formula (9). To replace the Jacobian inverse matrix. The terminal uses formula (8) based on the Jacobian pseudo-inverse matrix. The Cartesian space velocity at the end of the robotic arm First joint velocity mapped to Cartesian space .
[0146] The terminal determines the corresponding Jacobian matrix based on the current joint angle. According to the Jacobian matrix Determine the Jacobian transpose matrix The terminal determines the target inertial matrix in Cartesian space based on the current joint angle. The target damping matrix in Cartesian space , which are fixed constants. That is, the Cartesian space fixed inertia matrix and damping matrix expected by the operator. The terminal maps the resultant external force into joint torque through the Jacobian transpose matrix, as shown in formula (10). The inertia matrix of the joint space is determined by the target inertia matrix; the damping matrix of the joint space is determined by the target damping matrix, as shown in formulas (11) and (12). The second joint velocity of the joint space is determined by the joint torque, the inertia matrix and the damping matrix of the joint space determined by the current joint angle. Based on the above adaptive parameters, the discretized update formula of the joint space admittance controller is shown in formula (13), from which the second joint velocity calculated by the joint space admittance control channel can be calculated. .
[0147] The terminal obtains the Jacobian matrix and Jacobian transpose matrix of the current joint angle; based on the Jacobian matrix and Jacobian transpose matrix, the singular proximity of the current joint angle is determined, as shown in formula (14). According to the singular proximity, the lower limit of singular proximity, and the upper limit of singular proximity, the fusion weight coefficient is determined by formula (15). .
[0148] The terminal uses formula (5) to adjust the velocity of the first joint according to the fusion weighting coefficient. Second joint velocity Weighted fusion is performed to determine the target joint speed for each control cycle. The target joint speed is integrated to obtain the joint angle command, which is then sent to the motor, as shown in formula (6).
[0149] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0150] Based on the same inventive concept, this application also provides a robotic arm control device for implementing the robotic arm control method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more embodiments of the robotic arm control device provided below can be found in the limitations of the robotic arm control method described above, and will not be repeated here.
[0151] In one exemplary embodiment, such as Figure 7 As shown, a robotic arm control device is provided, comprising: an acquisition module 701, a calculation module 702, a first determination module 703, and a second determination module 704, wherein:
[0152] The acquisition module 701 is used to acquire the resultant external force at the end of the robotic arm and the current joint angle of all joints.
[0153] The calculation module 702 is used to calculate the first joint velocity in Cartesian space and the second joint velocity in joint space based on the net external force and the current joint angle.
[0154] The first determining module 703 is used to determine the fusion weight coefficient based on the singular proximity of the current joint angle; wherein, the singular proximity represents the operability of the robotic arm at the current joint angle.
[0155] The second determining module 704 is used to perform weighted fusion of the first joint velocity and the second joint velocity according to the fusion weight coefficient to determine the target joint velocity; wherein the target joint velocity is used to control the movement of the robotic arm.
[0156] In an exemplary embodiment, the calculation module 702 is further configured to calculate the Cartesian velocity of the end effector of the robotic arm based on the resultant external force; determine the Jacobian pseudo-inverse matrix based on the current joint angle; and map the Cartesian velocity to the first joint velocity in Cartesian space based on the Jacobian pseudo-inverse matrix.
[0157] In an exemplary embodiment, the calculation module 702 is further configured to determine the corresponding Jacobian matrix based on the current joint angle; and calculate the pseudo-inverse of the Jacobian matrix using the damped least squares method to obtain the Jacobian pseudo-inverse matrix.
[0158] In an exemplary embodiment, the calculation module 702 is further configured to: determine the Jacobian transpose matrix, the target inertia matrix in Cartesian space, and the target damping matrix based on the current joint angle; map the resultant external force into joint torque using the Jacobian transpose matrix; determine the inertia matrix of the joint space based on the target inertia matrix; determine the damping matrix of the joint space based on the target damping matrix; and determine the second joint velocity of the joint space based on the joint torque, the inertia matrix of the joint space, and the damping matrix.
[0159] In an exemplary embodiment, the first determining module 703 is configured to determine the singular proximity, the lower limit of singular proximity, and the upper limit of singular proximity based on the current joint angle; and to determine the fusion weight coefficient based on the singular proximity, the lower limit of singular proximity, and the upper limit of singular proximity.
[0160] In an exemplary embodiment, the first determining module 703 is configured to: determine the fusion weight coefficient as a first value when the singular proximity is lower than or equal to the lower limit of singular proximity; determine the fusion weight coefficient as a second value when the singular proximity is higher than or equal to the upper limit of singular proximity; and determine the fusion weight coefficient as a third value based on the ratio of the first difference and the second difference when the singular proximity is higher than the lower limit of singular proximity and lower than the upper limit of singular proximity; wherein the first difference is the difference between the singular proximity and the lower limit of singular proximity; the second difference is the difference between the upper limit of singular proximity and the lower limit of singular proximity; and the third value is greater than the first value and less than the second value, and the first value is less than the second value.
[0161] In an exemplary embodiment, the first determining module 703 is used to obtain the Jacobian matrix and the Jacobian transpose matrix of the current joint angle; and to determine the singular proximity of the current joint angle based on the Jacobian matrix and the Jacobian transpose matrix.
[0162] Each module in the aforementioned robotic arm control device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0163] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores robotic arm control data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a robotic arm control method.
[0164] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0165] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0166] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0167] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0168] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0169] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0170] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A robotic arm control method, characterized in that, The method includes: Obtain the net external force at the end of the robotic arm and the current joint angles of all joints; Based on the net external force and the current joint angle, calculate the first joint velocity in Cartesian space and the second joint velocity in joint space, respectively. The fusion weight coefficient is determined based on the singular proximity of the current joint angle; wherein the singular proximity represents the operability of the robotic arm at the current joint angle. The first joint velocity and the second joint velocity are weighted and fused according to the fusion weight coefficient to determine the target joint velocity; wherein the target joint velocity is used to control the movement of the robotic arm.
2. The method according to claim 1, characterized in that, Based on the net external force and the current joint angle, calculate the first joint velocity in Cartesian space, including: Calculate the Cartesian velocity at the end of the robotic arm based on the net external force; Determine the Jacobian pseudo-inverse matrix based on the current joint angle; The Cartesian velocity is mapped to the first joint velocity in the Cartesian space based on the Jacobian pseudo-inverse matrix.
3. The method according to claim 2, characterized in that, The step of determining the Jacobian pseudo-inverse matrix based on the current joint angle includes: Determine the corresponding Jacobian matrix based on the current joint angle; The pseudo-inverse of the Jacobian matrix is calculated using the damped least squares method, thus obtaining the Jacobian pseudo-inverse matrix.
4. The method according to claim 1, characterized in that, Based on the resultant external force and the current joint angle, calculate the second joint velocity in the joint space, including: Based on the current joint angle, determine the Jacobian transpose matrix, the target inertia matrix in Cartesian space, and the target damping matrix; The resultant external force is mapped to joint torque using the Jacobian transpose matrix. The inertia matrix of the joint space is determined based on the target inertia matrix; the damping matrix of the joint space is determined based on the target damping matrix. The second joint velocity of the joint space is determined based on the joint torque, the inertia matrix of the joint space, and the damping matrix.
5. The method according to claim 1, characterized in that, The step of determining the fusion weight coefficient based on the singular proximity of the current joint angle includes: Determine the singular proximity, the lower limit of singular proximity, and the upper limit of singular proximity based on the current joint angle; The fusion weight coefficient is determined based on the singular proximity, the lower limit of the singular proximity, and the upper limit of the singular proximity.
6. The method according to claim 5, characterized in that, The step of determining the fusion weight coefficient based on the singular proximity, the lower limit of the singular proximity, and the upper limit of the singular proximity includes: When the singular proximity is lower than or equal to the singular proximity lower limit, the fusion weight coefficient is determined to be a first value; When the singular proximity is higher than or equal to the upper limit of the singular proximity, the fusion weight coefficient is determined to be the second value; When the singular proximity is higher than the lower limit of singular proximity and lower than the upper limit of singular proximity, the fusion weight coefficient is determined as a third value based on the ratio of the first difference and the second difference; wherein, the first difference is the difference between the singular proximity and the lower limit of singular proximity; the second difference is the difference between the upper limit of singular proximity and the lower limit of singular proximity; the third value is greater than the first value and less than the second value, and the first value is less than the second value.
7. The method according to claim 5, characterized in that, The determination of singular proximity based on the current joint angle includes: Obtain the Jacobian matrix and Jacobian transpose matrix of the current joint angle; Based on the Jacobian matrix and the Jacobian transpose matrix, the singular proximity of the current joint angle is determined.
8. A robotic arm control device, characterized in that, The device includes: The acquisition module is used to acquire the net external force at the end of the robotic arm and the current joint angle of all joints; The calculation module is used to calculate the first joint velocity in Cartesian space and the second joint velocity in joint space based on the resultant external force and the current joint angle, respectively. The first determining module is used to determine the fusion weight coefficient based on the singular proximity of the current joint angle; wherein the singular proximity represents the operability of the robotic arm at the current joint angle. The second determining module is used to perform weighted fusion of the first joint velocity and the second joint velocity according to the fusion weight coefficient to determine the target joint velocity; wherein the target joint velocity is used to control the movement of the robotic arm.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.