A rehabilitation robot inverse kinematics solving optimization method, device and medium

By employing a collaborative optimization process combining global optimization algorithms and gradient descent, the accuracy and real-time performance issues of solving the inverse kinematics of the human upper limb were resolved, achieving high-precision, stable, and real-time motion control for rehabilitation robots.

CN120572544BActive Publication Date: 2025-11-11同济大学浙江学院
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511086462.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-05
Publication Date
2025-11-11
Estimated Expiration
2045-08-05

AI Technical Summary

Technical Problem

Existing technologies struggle to simultaneously meet the requirements of accuracy, continuity, stability, and real-time performance in solving high-dimensional nonlinear optimization problems when dealing with inverse kinematics of the human upper limb. Traditional methods are prone to getting trapped in local optima and cannot balance optimization accuracy with real-time control requirements.

Method used

The initial joint angles are determined by a global optimization algorithm, combined with gradient descent for local optimization, and corrected by global optimization when necessary, forming a three-stage collaborative optimization process to ensure the continuity and real-time updating of joint angles.

Benefits of technology

It achieves high-precision optimization of inverse kinematics solution for the human upper limb with high degrees of freedom, meets the requirements of real-time feedback control for rehabilitation robots, improves the stability and adaptability of the calculation, and is applicable to different human body structure models and rehabilitation task scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120572544B_ABST
    Figure CN120572544B_ABST
Patent Text Reader

Abstract

This application discloses an optimization method, device, and medium for inverse kinematics of a rehabilitation robot, relating to the field of robot kinematics and control technology. The method includes acquiring target trajectory data of the target limb's end-effector movements during rehabilitation training; applying a global optimization algorithm to obtain the optimal joint angles of the target limb in the initial frame; calculating the reference joint angles of the current frame based on the optimal joint angles of the previous frame using gradient descent; when the global optimization trigger mechanism is met, applying the global optimization algorithm to obtain the optimal joint angles of the current frame, and continuing to execute the local joint angle optimization steps based on the gradient descent algorithm; when the global optimization trigger mechanism is not met, continuing to execute the local joint angle optimization steps based on the gradient descent algorithm. This application employs a hybrid optimization strategy, enabling real-time and accurate optimization of the joint angles of the target limb, thereby providing real-time and accurate control data for the rehabilitation robot.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of robot kinematics and control technology, and in particular to a method, device and medium for optimizing the inverse kinematics of a rehabilitation robot. Background Technology

[0002] In the fields of robot motion control and rehabilitation robots, research on motion control strategies for the robot body is relatively mature, while research on the motion patterns of the human upper limb is relatively limited. However, the movement patterns of the human upper limb largely determine how rehabilitation robots plan and execute assisted movements. Studying the angle changes of each joint when the human upper limb executes a specific trajectory can not only provide crucial control data for rehabilitation robots but also provide theoretical support for the design of future robot motion control strategies, making robot movement more consistent with the natural movement characteristics of the human body, improving the effectiveness of rehabilitation training and the accuracy of robot-assisted movements. However, due to the multiple degrees of freedom of the human upper limb and the complex coupling relationships between joints, solving the joint angle problem in inverse kinematics of the human upper limb becomes a complex high-dimensional nonlinear optimization problem, which also places higher demands on the real-time performance, stability, and continuity of the joint angle solution.

[0003] When solving inverse kinematics problems, many systems employ analytical methods or purely iterative numerical methods. These methods either suffer from a limited solution space (failing to cover all actual postures) or exhibit issues such as solution jumps, oscillations, and non-convergence, affecting the continuity and controllability of actual rehabilitation movements. Furthermore, traditional optimization algorithms (such as gradient descent, steepest descent, and Newton's method) often rely on favorable initial values ​​and are prone to getting trapped in local optima. This is particularly evident when dealing with high-dimensional inverse kinematics problems of the human body, as these problems are often non-convex optimization problems with complex objective functions, numerous constraints, and strong dependence on initial values, making it difficult for traditional methods to simultaneously meet the comprehensive requirements of accuracy, continuity, stability, and real-time performance.

[0004] In summary, existing technologies have significant limitations when dealing with complex inverse kinematics problems of the human upper limb, failing to balance optimization accuracy with real-time control requirements, and lacking a systematic, multi-stage collaborative optimization solution mechanism. Summary of the Invention

[0005] The purpose of this application is to provide a method, device and medium for solving and optimizing the inverse kinematics of a rehabilitation robot, which can solve and optimize the angles of each joint of the target limb in real time and accurately, thereby providing real-time and accurate control data for the rehabilitation robot.

[0006] To achieve the above objectives, this application provides the following solution:

[0007] Firstly, this application provides an optimization method for solving the inverse kinematics of a rehabilitation robot, including:

[0008] Acquire target trajectory data of the target limb's extremity movements during rehabilitation training; the target trajectory data includes the target position of several consecutive frames.

[0009] An initial population is constructed based on the range of joint angle values ​​of the target limb. A global optimization algorithm is then applied to iteratively optimize the initial population based on the target position in the initial frame to obtain the optimal joint angle of the target limb in the initial frame.

[0010] Based on the optimal joint angle of the target limb in frame k-1, the gradient descent method is used to calculate the reference joint angle of the target limb in frame k; k=2,3,...,N; N is the total number of frames contained in the motion trajectory;

[0011] Determine whether the global optimization trigger mechanism is satisfied;

[0012] If so, construct a correction population based on the optimal joint angle of the target limb in frame k-1 and the range of joint angle values ​​of the target limb, and apply a global optimization algorithm to iteratively optimize the correction population based on the target position in frame k, outputting the optimal joint angle of the target limb in frame k; let k=k+1, return to step "Calculate the reference joint angle of the target limb in frame k using the gradient descent method based on the optimal joint angle of the target limb in frame k-1".

[0013] If not, let k = k + 1, the reference joint angle is the optimal joint angle, and return to the step "Calculate the reference joint angle of the target limb in frame k using the gradient descent method based on the optimal joint angle of the target limb in frame k-1"; the optimal joint angle of the target limb in each frame is used to determine the motion state of the target limb.

[0014] Secondly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method for optimizing the inverse kinematics of a rehabilitation robot.

[0015] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method for optimizing the inverse kinematics of a rehabilitation robot.

[0016] According to the specific embodiments provided in this application, the following technical effects are disclosed:

[0017] This application provides a method, device, and medium for optimizing the inverse kinematics of a rehabilitation robot. Initially, this application uses a global optimization algorithm to determine the globally optimal joint angles, ensuring that subsequent joint angle solutions start from a globally optimal starting point. After the initial global optimization, if the global optimization triggering mechanism is not met, a continuous local optimization process is performed. When the global optimization triggering mechanism is met, the joint angles obtained from the local optimization are corrected to avoid the solved joint angles deviating from expectations, thereby providing better initial values ​​for subsequent local optimization.

[0018] This application achieves high-precision optimization of the inverse kinematics problem of the human upper limb with high degrees of freedom through a three-stage collaborative optimization process: global optimization at the initial moment, global correction when necessary, and continuous local optimization (ensuring that the calculated joint angles are continuous and updated in real time). This ensures the continuity and smoothness of the solution process and is more in line with the natural movement trajectory of the human body. It improves the real-time performance and stability of the calculation, meets the requirements of rehabilitation robots for real-time feedback control, and has good adaptability and scalability. It can be widely applied to different human body structure models and rehabilitation task scenarios. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This application provides an illustration of the application environment for an optimization method for solving inverse kinematics of a rehabilitation robot, as shown in one embodiment of this application.

[0021] Figure 2 A flowchart illustrating an optimization method for solving inverse kinematics of a rehabilitation robot, provided in one embodiment of this application;

[0022] Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0023] 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. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0024] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0025] The inverse kinematics optimization method for rehabilitation robots provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, the terminal communicates with the server via a network. The data storage system stores the data the server needs to process. The data storage system can be set up independently, integrated into the server, or placed in the cloud or on another server. The terminal can send the target trajectory data of the target limb's extremity movements during rehabilitation training to the server. After receiving the target trajectory data, the server constructs an initial population based on the joint angle range of the target limb. It then iteratively optimizes the initial population using a global optimization algorithm based on the target position of the initial frame to obtain the optimal joint angle of the target limb in the initial frame. Based on the optimal joint angle of the target limb in the (k-1)th frame, the server calculates the reference joint angle of the target limb in the kth frame using gradient descent; k = 2, 3, ..., N; N is the total number of frames contained in the motion trajectory. The server then determines whether the global optimization trigger mechanism is satisfied. If... If yes, then a calibration population is constructed based on the optimal joint angle of the target limb in frame (k-1) and the range of joint angle values ​​for the target limb. A global optimization algorithm is then applied to iteratively optimize the calibration population based on the target position in frame k, outputting the optimal joint angle of the target limb in frame k. Let k = k + 1, and return to the step "Calculate the reference joint angle of the target limb in frame k using gradient descent based on the optimal joint angle of the target limb in frame (k-1)". If no, let k = k + 1, the reference joint angle is the optimal joint angle, and return to the step "Calculate the reference joint angle of the target limb in frame k using gradient descent based on the optimal joint angle of the target limb in frame (k-1)". The server can feed back the obtained optimal joint angles of the target limbs in each frame to the terminal. Furthermore, in some embodiments, the inverse kinematics optimization method for the rehabilitation robot can also be implemented independently by the server or the terminal. For example, the terminal can directly perform inverse kinematics optimization on the target trajectory data of the target limb's end-effector movements during rehabilitation training, or the server can obtain the target trajectory data of the target limb's end-effector movements during rehabilitation training from the data storage system and perform inverse kinematics optimization on the rehabilitation robot.

[0026] The terminal can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. The server can be a standalone server or a server cluster composed of multiple servers, or it can be a cloud server.

[0027] In one exemplary embodiment, such as Figure 2As shown, an optimization method for inverse kinematics of a rehabilitation robot is provided, primarily addressing the problem of solving joint angles in the inverse kinematics of upper limb rehabilitation training. Specifically, given the trajectory of a rehabilitation movement performed by the upper limb distal in space, the method calculates the angles of each joint to achieve overall motion that satisfies a predetermined pose while maintaining continuity, smoothness, and real-time updates, providing key technical support for the design of motion control strategies for rehabilitation robots. This method can be executed by a computer device, specifically by a terminal or server alone, or by both. In this embodiment, the method is applied to... Figure 1 The following steps, 101 to 106, are used as an example to illustrate the process of using a server in the example.

[0028] Step 101: Obtain target trajectory data of the target limb's end-effector movements during rehabilitation training; the target trajectory data includes the target positions of several consecutive frames.

[0029] To provide accurate target data for solving joint angles using inverse kinematics, trajectory data of upper limb distal movements performed during rehabilitation training is collected or defined, denoted as: .in, Indicates the first The target pose of the frame, including the target position. And target attitude information. This indicates the total number of frames contained in the motion trajectory (e.g., 151 frames).

[0030] Step 102: Construct an initial population based on the range of joint angle values ​​of the target limb, and apply a global optimization algorithm to iteratively optimize the initial population based on the target position of the initial frame to obtain the optimal joint angle of the target limb in the initial frame.

[0031] The initial frame is designated as frame 1. In frame 1, the globally optimal joint vector is obtained using a global optimization method. This ensures that subsequent solutions start from a globally optimal starting point, avoiding local optimizations that begin with inferior solutions.

[0032] Step 103: Based on the optimal joint angle of the target limb in frame k-1, calculate the reference joint angle of the target limb in frame k using the gradient descent method; here, k≥2.

[0033] Using the optimal joint angle in frame k-1 Starting from this point, the joint angles in the k-th frame are quickly solved using the gradient descent method. It enables real-time, continuous, and smooth motion trajectories.

[0034] The local optimization in this step uses the joint angles solved in the previous frame to ensure the continuity of the motion trajectory, while providing error data for triggering global optimization.

[0035] Step 104: Determine whether the global optimization triggering mechanism is satisfied.

[0036] If so, proceed to step 105: construct a correction population based on the optimal joint angle of the target limb in frame (k-1) and the range of joint angle values ​​of the target limb; iteratively optimize the correction population using a global optimization algorithm based on the target position in frame k to obtain the optimal joint angle of the target limb in frame k; let k = k + 1, and return to step 103: "Calculate the reference joint angle of the target limb in frame k using the gradient descent method based on the optimal joint angle of the target limb in frame (k-1).

[0037] If not, proceed to step 106, let k = k + 1, the reference joint angle is the optimal joint angle, and return to step 103 "Calculate the reference joint angle of the target limb in frame k using the gradient descent method based on the optimal joint angle of the target limb in frame k-1"; the optimal joint angle of the target limb in each frame is used to determine the motion state of the target limb.

[0038] Finally, the solved joint angle results for all frames are output, forming complete data on the change of joint angles of the target limb over time, which can be used for the design of motion control strategies and effect evaluation of rehabilitation robots.

[0039] While local optimization methods offer high computational speed, they are prone to accumulating errors between consecutive frames, leading to discontinuities in the solution and causing abrupt changes in the robot's motion trajectory, which is detrimental to the stability of rehabilitation training. Pure global optimization methods (such as genetic algorithms) can search for the global optimum over a large area, but their computational cost is high, making it difficult to meet real-time requirements. Pure local optimization methods, while obtaining solutions quickly, are prone to getting trapped in local optima and may cause errors to accumulate gradually, affecting the accuracy and stability of the robot's motion trajectory. Therefore, this application proposes a hybrid optimization strategy that combines the advantages of global and local optimization. In the initial stage, global optimization is used to obtain a better solution (joint vectors), and local optimization is used in subsequent trajectory solving to achieve fast and continuous solving. At the same time, when necessary (based on fixed time intervals or adaptive triggering conditions), the global optimization algorithm is called for correction to ensure the global optimum of the solved joint angles and the smoothness of the motion trajectory.

[0040] In another exemplary embodiment of this application, in step 105, a global optimization algorithm is applied to iteratively optimize the correction population based on the target position in the k-th frame to obtain the optimal joint angle of the target limb in the k-th frame, specifically including:

[0041] (a1) Determine the positive kinematic model of the target limb.

[0042] To ensure that the optimization process is based on a correct physical model, it is necessary to establish a mathematical model of the target limb (such as the human upper limb):

[0043] Define the joint angle vector: ;

[0044] in, For the angle vectors of each joint of the target limb; For the target limb's degrees of freedom (e.g.) ).

[0045] Set the allowable angle range for each joint:

[0046] ;

[0047] in, Let i be the angle of the i-th joint; Let represent the minimum and maximum angles of the i-th joint, respectively.

[0048] The forward kinematic equations of the target limb were established using methods such as the Denavit-Hartenberg parameter.

[0049] ;

[0050] in, Let be the homogeneous transformation matrix of the target limb distal end; It is a positive kinematic function used to calculate the position of the target limb's extremity. and posture.

[0051] (a2) Construct an objective function for solving the joint angles based on the forward kinematics model to measure the quality of the solved joint angles; the objective function includes position error terms, angle error terms, and velocity error terms. Since joint angles are typically normalized to […] -π , π Directly calculating the angle difference within the range of [-π, π] may result in abrupt changes between π and -π, affecting the stability of the optimization process. Therefore, in the angle error term described in this application, a normalization function is applied to convert the joint angle difference between two consecutive frames to a preset angle difference range (such as the range of [-π, π]) to prevent discontinuities caused by the joint angle crossing the boundary.

[0052] (a3) Apply the global optimization algorithm to iteratively optimize the correction population based on the objective function and the target position in the kth frame, and output the optimal joint angle of the target limb in the kth frame.

[0053] In another exemplary embodiment of this application, in step (a2), the expression of the objective function is:

[0054] ;

[0055] In the formula, Refers to the objective function; The actual position of the target limb end in the k-th frame is obtained from the positive kinematics model; For the angle vectors of each joint of the target limb in the kth frame; The target position in the k-th frame is extracted from the target trajectory data; This is the normalization function; This represents the angle value of the i-th joint in the k-th frame. Let be the i-th joint angle value in the (k-1)-th frame. This value is used to ensure the continuity of the solved joint angles. When using this objective function to solve for the globally optimal joint angles in the initial frame... Use preset initial values; The rate of change of each joint angle is usually calculated by the difference between the joint angles of adjacent frames. In the initial frame, it can be taken as zero or approximately zero. These represent the weights of the position error term, angle error term, and velocity error term, respectively. The initial values ​​are set based on experience and can be adjusted later through a dynamic multi-objective trade-off strategy; n represents the degree of freedom of the target limb.

[0056] The specific expression of the normalization function is as follows:

[0057] ;

[0058] In the formula, mod() represents the modulo operation. The normalization function ensures that the calculated angle difference is always within the normal range. Within the interval, prevent discontinuities caused by angles crossing boundaries.

[0059] The normalization operation described above converts the original angle difference into... The value within, for example: Suppose radian, radian, radians; calculation ,Right now We get 3.22 (approximate value), then subtract... This yields 0.08 radians, avoiding the large errors caused by directly calculating the angle difference.

[0060] Embedding angle normalization into the objective function ensures that the angle error term in the objective function remains within a smooth range, ensuring smooth and continuous error calculation each time. This helps the optimization algorithm to converge stably and provides stable support for the entire solution process.

[0061] Similarly, in step 102, a global optimization algorithm is applied to iteratively optimize the initial population based on the target position in the initial frame to obtain the optimal joint angle of the target limb in the initial frame, specifically including:

[0062] (b1) Determine the kinematic model of the target limb.

[0063] (b2) Construct an objective function for solving the joint angles based on the forward kinematics model; the objective function includes a position error term, an angle error term and a velocity error term; in the angle error term, a normalization function is applied to convert the joint angle difference between two consecutive frames to a preset angle difference range.

[0064] The objective function in step (b2) is the same as the objective function expression above, except that the data corresponding to the initial frame needs to be substituted in.

[0065] (b3) Based on the objective function and the target position of the initial frame, the global optimization algorithm is applied to iteratively optimize the initial population to obtain the optimal joint angle of the target limb in the initial frame.

[0066] As an example, a global optimization algorithm can be performed using a genetic algorithm (GA), with the following steps:

[0067] Population initialization: Randomly generate several candidate solutions within the allowed range of joint angle values.

[0068] Fitness evaluation: Calculate the objective function for each candidate solution. value.

[0069] Selection, crossover, and mutation: candidate solutions are gradually optimized through iterative operations.

[0070] Termination condition: Output the optimal solution when the preset number of iterations is reached or the objective function converges.

[0071] Output: Obtain the initial globally optimal joint angles. .

[0072] The initial global optimization provides initial conditions for subsequent continuous local optimization, ensuring that the solution starts from a globally optimal state.

[0073] Global optimization algorithms can also employ other algorithms, such as particle swarm optimization.

[0074] In another exemplary embodiment of this application, during the process of solving the joint angles of each frame, the errors (position error, angle error, velocity error) in the objective function of different frames may change to different degrees, and the weights of each item in the objective function are dynamically adjusted. This is done to achieve an optimal balance between position, angle, and velocity errors, thereby improving the accuracy of the solved joint angles and the smoothness of the motion trajectory. The initial weights are set to fixed values ​​based on prior knowledge, such as... , , After solving for the joint angles in each frame, calculate the proportion of each error to the total error. For example, calculate the proportion of position error. Angular error percentage and the percentage of speed error According to preset rules, if a certain error ratio exceeds or falls below the expected range, the corresponding weight is dynamically adjusted. For example, if the angle error ratio is large, it is increased or decreased to enhance angle smoothness; if the position error suddenly increases, it is increased to ensure that the actual position of the target limb's end matches the target position. Therefore, after performing the above step (a3) ​​"applying a global optimization algorithm to iteratively optimize the correction population based on the objective function and the target position in the kth frame, and outputting the optimal joint angle of the target limb in the kth frame," the rehabilitation robot inverse kinematics solution optimization method further includes:

[0075] (b1) Calculate the proportion of position error in the kth frame to the total error based on the position error term in the objective function, and obtain the position error percentage; the total error refers to the sum of position error, angle error and velocity error.

[0076] (b2) Calculate the proportion of the angle error in the kth frame to the total error based on the angle error term in the objective function, and obtain the proportion of angle error.

[0077] (b3) Calculate the proportion of velocity error in the kth frame to the total error based on the velocity error term in the objective function, and obtain the velocity error percentage.

[0078] (b4) Calculate the weight of the position error term in the objective function when solving the problem in the (k+1)th frame based on the current position error percentage and the weight of the position error term in the objective function when solving the problem in the kth frame.

[0079] (b5) Calculate the weight of the angle error term in the objective function when solving the problem in the (k+1)th frame based on the current angle error percentage and the weight of the angle error term in the objective function when solving the problem in the kth frame.

[0080] (b6) Calculate the weight of the velocity error term in the objective function when solving the problem in the (k+1)th frame based on the current velocity error percentage and the weight of the velocity error term in the objective function when solving the problem in the kth frame.

[0081] (b7) Update the objective function for solving the k+1 frame according to the weights of the position error term, angle error term and velocity error term in the objective function when solving the k+1 frame, and obtain the objective function for solving the k+1 frame.

[0082] In another exemplary embodiment of this application, in step (b4), the weight calculation formula for the position error term in the objective function during the (k+1)th frame solution is as follows:

[0083] ;

[0084] In step (b5), the formula for calculating the weight of the angle error term in the objective function during the (k+1)th frame solution is as follows:

[0085] ;

[0086] In step (b6), the formula for calculating the weight of the velocity error term in the objective function during the (k+1)th frame solution is as follows:

[0087] ;

[0088] In the formula, , , These represent the weights of the position error term, angle error term, and velocity error term in the objective function during the (k+1)th frame solution; , , These represent the weights of the position error term, angle error term, and velocity error term in the objective function when solving for the k-th frame; , , These represent the percentages of position error, angle error, and velocity error at the k-th frame, respectively. , , These represent the preset position target error ratio, angle target error ratio, and velocity target error ratio, respectively. This represents the adjustment coefficient, used to control the magnitude of weight adjustment.

[0089] Assuming initial Angular target error ratio After calculating the joint angles in a certain frame, the actual angle error accounts for the percentage of the total angle. (Ratio of error to target) If the weight is high, then the weight can be updated as follows: If we take ,but This strengthens the influence of angle error on the objective function, prompting subsequent optimization to pay more attention to the angle continuity of the solution.

[0090] The weights of each error term in the objective function adopt a dynamic multi-objective trade-off strategy, which enables the objective function to be adaptively adjusted and updated in real time during the solution process. This helps to take into account position, angle and velocity errors at different stages, thereby optimizing the overall solution effect.

[0091] This application introduces angle normalization and dynamic multi-objective trade-off strategies, which can improve the stability of inverse kinematics solutions and the applicability of motion control for rehabilitation robots.

[0092] In another exemplary embodiment of this application, in step 103, the objective function of the k-th frame is constructed. The current target position is taken And with the optimal joint angle of the target limb in frame k-1. As the initial value, the formula for calculating the reference joint angle of the target limb in the k-th frame is:

[0093] ;

[0094] In the formula, The reference joint angle of the target limb in the k-th frame; The optimal joint angle for the target limb in the (k-1)th frame; The learning rate controls the step size for each update. For the objective function in The gradient at a given point is calculated using the finite difference method. For each component: In practical numerical calculations, in order to solve the objective function... Regarding each joint angle The partial derivatives (gradient components) are usually approximated using the finite difference method. For the objective function, the joint angle vector Each component is subject to a different error penalty (e.g., end-effector position error, angular continuity error, joint change rate, etc.). The objective function is used to evaluate the current solution. The smaller the deviation from the expected target, the better the solution. Joint angle vector The Middle The nth component represents the nth component. The angle of each joint. Indicates will The Middle Each component increases by a small amount. The objective function value was then calculated. (This is based on...) Observe the objective function by making small perturbations. How it changes, and thus how to estimate the impact of that variable on... The degree of sensitivity. This represents the small positive perturbation used in finite difference calculations, ensuring that the perturbation is sufficiently small so that the difference result approximates the true derivative value. A common value is 0.001, which can be adjusted according to the specific problem and numerical stability requirements.

[0095] To ensure that the new solution after global optimization and correction can seamlessly connect to the subsequent local optimization process and maintain the continuity of the motion trajectory, the new solution obtained from global optimization is... As the current frame solution Then, it proceeds to the next frame for local optimization, effectively connecting global correction and local optimization to form a closed-loop solution and ensure continuous updates. The calculation formula for the connection of the solution after global optimization is as follows:

[0096] .

[0097] In another exemplary embodiment of this application, in step 104, regarding the global optimization triggering mechanism, two triggering schemes are provided, and the user can choose one according to actual needs. The global optimization triggering mechanism includes a fixed triggering mechanism and an adaptive triggering mechanism.

[0098] Fixed trigger scheme: Every preset number of frames (e.g., every 50 frames), the global optimization function is automatically invoked to correct the angle vector solved in the current frame.

[0099] ;

[0100] in, This represents the global optimization function, utilizing the currently solved joint angles. As the initial population basis, the corrected solution is obtained. Therefore, the fixed triggering mechanism refers to the k-th frame being the preset corrected frame.

[0101] Adaptive triggering scheme:

[0102] Calculate the change in joint angle between two consecutive frames:

[0103] ;

[0104] in, and These represent the i-th optimal joint angles obtained in the (k-1)-th and (k-2)-th frames, respectively.

[0105] when Exceeding the preset difference At that time, the global optimization function is called:

[0106] ;

[0107] And update the joint angles in frame k:

[0108] .

[0109] In other words, the adaptive triggering mechanism means that the difference between the reference joint angle of the target limb in frame k and frame k-1 is greater than a preset difference. . This represents the joint angle obtained in the (k-1)th frame. Indicated by joint angle The optimal joint angle is obtained by constructing a population based on the population and performing global optimization. This represents the optimal joint angle in the k-th frame.

[0110] As an alternative implementation, the adaptive triggering mechanism solution may further include that the cumulative error of joint angles between the k-th frame and the k-n-th frame exceeds a preset threshold; n < k. During the local optimization process, when the solution result has a large jump or the error accumulation exceeds the preset threshold, global optimization is performed for correction to ensure the global optimality and stability of the solved joint vector.

[0111] The global optimization triggering mechanism plays a correction role during the local optimization process, ensuring that the solved joint angles do not deviate from the expectation due to error accumulation, thereby providing a better initial value for subsequent local optimization. Whether it is fixed triggering or adaptive triggering, after calling global optimization, the new solution will be used as the solution for this frame and then enter the next stage of local optimization to ensure the continuity and real-time nature of the entire trajectory.

[0112] In this application, by establishing an accurate forward kinematics model of the target limb and adopting a hybrid optimization strategy of global initialization, continuous local optimization, global optimization triggering and its subsequent solution process, at the same time using angle normalization to solve the problem of angle mutation, and introducing a dynamic multi-objective trade-off strategy to dynamically adjust the weights of each term of the objective function according to the real-time solution error, the efficient, continuous, smooth and real-time solution of the inverse kinematics solution (joint angles) of the target limb rehabilitation motion trajectory is achieved. This method not only utilizes the global search ability of global optimization, but also ensures real-time response through local optimization, and effectively solves the discontinuity and accuracy problems of the solved joint angles through automatic correction and adaptive trade-off strategies, providing strong technical support for the design of the rehabilitation robot motion control strategy. In addition, applying the hybrid optimization algorithm of this application can solve the problem of "due to the multi-degree-of-freedom characteristics of the joints of the target limb, different combinations of joint angles may achieve the same end pose, making the inverse kinematics problem non-linear and having multiple solutions, increasing the complexity of the solution".

[0113] This application also provides an application scenario that applies the above-mentioned inverse kinematics solution optimization method for a rehabilitation robot. Specifically: The inverse kinematics solution optimization method for a rehabilitation robot provided in this embodiment can be applied in a rehabilitation robot control scenario. This scenario includes an inverse kinematics solution optimization link for the rehabilitation trajectory and a control design link; the inverse kinematics solution optimization link for the rehabilitation trajectory is used to optimize the joint angles of each frame according to the inverse kinematics of the limb target rehabilitation trajectory; the control design link is used to design the execution strategy of the rehabilitation robot action according to the optimized joint angles of each frame. The inverse kinematics solution optimization method for a rehabilitation robot provided in this embodiment belongs to the inverse kinematics solution optimization link for the rehabilitation trajectory.

[0114] In an exemplary embodiment, a computer device is provided. The computer device can be a server or a terminal, and its internal structure diagram can be as Figure 3As shown, the 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 operating system and computer programs in the non-volatile storage media to run. The database stores the joint angle data for each frame after optimization through inverse kinematics of the rehabilitation movement trajectory. The I / O interfaces are used for information exchange 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 an optimization method for inverse kinematics of a rehabilitation robot.

[0115] Those skilled in the art will understand that Figure 3 The structures shown are merely block diagrams of some structures related to the present application and do 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 shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0116] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0117] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0118] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile 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).

[0119] 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, etc., and are not limited to these.

[0120] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0121] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for optimizing the inverse kinematics of a rehabilitation robot, characterized in that, include: Acquire target trajectory data of the movements performed at the end of the target limb during rehabilitation training; The target trajectory data includes the target position of several consecutive frames; An initial population is constructed based on the range of joint angle values ​​of the target limb. A global optimization algorithm is then applied to iteratively optimize the initial population based on the target position in the initial frame to obtain the optimal joint angle of the target limb in the initial frame. Based on the optimal joint angle of the target limb in frame k-1, the gradient descent method is used to calculate the reference joint angle of the target limb in frame k; k=2,3,...,N; N is the total number of frames contained in the motion trajectory; Determine whether the global optimization trigger mechanism is satisfied; If so, construct a correction population based on the optimal joint angle of the target limb in frame k-1 and the range of joint angle values ​​of the target limb, and apply a global optimization algorithm to iteratively optimize the correction population based on the target position in frame k to obtain the optimal joint angle of the target limb in frame k; let k=k+1, and return to the step "Calculate the reference joint angle of the target limb in frame k using the gradient descent method based on the optimal joint angle of the target limb in frame k-1". If not, let k = k + 1, the reference joint angle is the optimal joint angle, and return to the step "Calculate the reference joint angle of the target limb in frame k using the gradient descent method based on the optimal joint angle of the target limb in frame k-1"; the optimal joint angle of the target limb in each frame is used to determine the motion state of the target limb.

2. The inverse kinematics optimization method for rehabilitation robots according to claim 1, characterized in that, Based on the target position in the k-th frame, a global optimization algorithm is applied to iteratively optimize the correction population to obtain the optimal joint angle of the target limb in the k-th frame, specifically including: Determine the positive kinematic model of the target limb; An objective function for solving joint angles is constructed based on a forward kinematics model. The objective function includes a position error term, an angle error term, and a velocity error term. In the angle error term, a normalization function is applied to convert the joint angle difference between two consecutive frames to a preset angle difference range. Based on the objective function and the target position in the kth frame, a global optimization algorithm is applied to iteratively optimize the correction population, and the optimal joint angle of the target limb in the kth frame is output.

3. The inverse kinematics optimization method for rehabilitation robots according to claim 2, characterized in that, The expression for the objective function is: ; In the formula, Refers to the objective function; The actual position of the target limb end in the k-th frame is obtained from the positive kinematics model; For the angle vectors of each joint of the target limb in the kth frame; The target position in the k-th frame; This is the normalization function; This represents the angle value of the i-th joint in the k-th frame. This is the angle value of the i-th joint in the (k-1)-th frame; The rate of change of the angles of each joint; These are the weights of the position error term, angle error term, and velocity error term, respectively. n represents the degree of freedom of the target limb.

4. The inverse kinematics optimization method for rehabilitation robots according to claim 3, characterized in that, The specific expression for the normalization function is: ; In the formula, mod() represents the modulo operation.

5. The inverse kinematics optimization method for a rehabilitation robot according to claim 3, characterized in that, After executing the step "applying a global optimization algorithm to iteratively optimize the correction population based on the objective function and the target position in the kth frame, and outputting the optimal joint angle of the target limb in the kth frame", the inverse kinematics optimization method for the rehabilitation robot further includes: The position error in the k-th frame is calculated based on the position error term in the objective function, thus yielding the position error percentage. The total error is the sum of position error, angle error, and velocity error. Calculate the proportion of angle error in the k-th frame to the total error based on the angle error term in the objective function, and obtain the angle error percentage. Calculate the proportion of velocity error in the k-th frame to the total error based on the velocity error term in the objective function, and obtain the velocity error percentage. The weight of the position error term in the objective function during the (k+1)th frame is calculated based on the current position error percentage and the weight of the position error term in the objective function during the kth frame solution. The weight of the angle error term in the objective function during the (k+1)th frame is calculated based on the current angle error percentage and the weight of the angle error term in the objective function during the kth frame solution. The weight of the velocity error term in the objective function during the (k+1)th frame is calculated based on the current velocity error percentage and the weight of the velocity error term in the objective function during the kth frame solution. The objective function for solving the problem in frame k is updated based on the weights of the position error term, angle error term, and velocity error term in the objective function when solving the problem in frame k+1, thus obtaining the objective function for solving the problem in frame k+1.

6. The inverse kinematics optimization method for a rehabilitation robot according to claim 5, characterized in that, The formula for calculating the weight of the position error term in the objective function when solving for the (k+1)th frame is: ; The formula for calculating the weight of the angle error term in the objective function when solving for the (k+1)th frame is: ; The formula for calculating the weight of the velocity error term in the objective function when solving for the (k+1)th frame is: ; In the formula, , , These represent the weights of the position error term, angle error term, and velocity error term in the objective function during the (k+1)th frame solution; , , These represent the weights of the position error term, angle error term, and velocity error term in the objective function when solving for the k-th frame; , , These represent the percentages of position error, angle error, and velocity error at the k-th frame, respectively. , , These represent the preset position target error ratio, angle target error ratio, and velocity target error ratio, respectively. This represents the adjustment coefficient.

7. The inverse kinematics optimization method for a rehabilitation robot according to claim 3 or 5, characterized in that, The formula for calculating the reference joint angle of the target limb in the k-th frame is: ; In the formula, The reference joint angle of the target limb in the k-th frame; The optimal joint angle for the target limb in the (k-1)th frame; The learning rate; For the objective function in The gradient at that point.

8. The inverse kinematics optimization method for a rehabilitation robot according to claim 1, characterized in that, The global optimization triggering mechanism includes a fixed triggering mechanism and an adaptive triggering mechanism; the fixed triggering mechanism means that the k-th frame is a preset correction frame. The adaptive triggering mechanism refers to the difference between the reference joint angle of the target limb in frame k and frame (k-1) being greater than a preset difference, or the cumulative error of the joint angle between frames k and kn exceeding a preset threshold; n <k。 9. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the inverse kinematics optimization method for a rehabilitation robot as described in any one of claims 1-8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the inverse kinematics optimization method for rehabilitation robots as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Method for solving robot inverse kinematics based on particle swarm optimization algorithm

    CN108932216A

  • Mechanical arm trajectory planning method based on improved particle swarm optimization

    CN120363172A