Upper limb rehabilitation robot gravity compensation method, device and upper limb rehabilitation robot
By calculating the joint target angle and arm support torque through the inverse kinematics algorithm and iterative learning method, combined with feedback linear control, the difficult problem in arm gravity compensation control of the upper limb rehabilitation robot is solved, and an efficient and accurate gravity compensation effect is achieved.
Patent Information
- Application Number
- CN202210064467.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-01-20
AI Technical Summary
When existing upper limb rehabilitation robots carry out arm gravity compensation, it is difficult to accurately measure the patient's uncertainty and the shape and weight of the arm, resulting in control difficulties.
A method based on inverse kinematics algorithm and iterative learning is used to calculate the joint target angle and arm support torque, and through feedback linearized inverse kinematics control, the joint output torque is dynamically adjusted to achieve arm gravity compensation.
It achieves arm gravity compensation for different patients, improves the accuracy and efficiency of rehabilitation robot control, simplifies the algorithm, and is suitable for existing upper limb rehabilitation robots without additional deployment time.
Smart Images

Figure CN114404220B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of rehabilitation robots, and in particular to a gravity compensation method and device for an upper limb rehabilitation robot and an upper limb rehabilitation robot. Background Art
[0002] Currently, the commonly used treatment plan for upper limb rehabilitation robots is to set a target position and require the patient's limbs to reach the target position with the assistance of the robot. However, some patients (such as stroke patients) are usually unable to fully lift their arms by themselves, so the rehabilitation robot is required to provide arm gravity compensation during the rehabilitation training process.
[0003] Since the patient is uncertain, the shape and weight of the patient's upper limbs are difficult to measure accurately, and it is impossible to establish a dynamic model for compensation like gravity compensation for the robot body, which makes it difficult to control the upper limb rehabilitation robot. Summary of the invention
[0004] The present invention solves the problem of control difficulty caused by the gravity compensation mode of the patient's upper limbs in the existing upper limb rehabilitation robot.
[0005] In order to solve the above problems, the present invention provides a gravity compensation method for an upper limb rehabilitation robot, the method comprising: obtaining the starting position of the upper limb end and the target position corresponding to the rehabilitation training task, and calculating the target joint angle of each joint from the starting position and the target position based on an inverse kinematics algorithm; adjusting the arm support torque of each joint of the rehabilitation robot online based on iterative learning, and calculating the arm support torque required for each joint from the target joint angle and the actual joint angle corresponding to the target joint angle, the target joint angular velocity, and the actual joint angular velocity; performing inverse dynamics control based on feedback linearization, calculating the output torque of each joint from the target motion parameters and the actual motion parameters of each joint, and calculating the driving amount of each joint according to the output torque of each joint; and controlling the joint to be trained to apply an auxiliary torque according to the driving amount of each joint to perform rehabilitation training.
[0006] Optionally, the target joint angles of each joint are calculated from the starting position and the target position based on the inverse kinematics algorithm, including: establishing a DH coordinate system for the upper limb rehabilitation robot, determining the terminal homogeneous transformation matrix and the linear velocity Jacobian matrix, and setting a calculation convergence threshold and an iteration number threshold; cyclically calculating the following parameters in sequence: position error, joint angle error, joint angle, and number of cycles plus one; if the joint angle error is less than or equal to the calculation convergence threshold, or the number of iterations is equal to the iteration number threshold, determining that the current joint angle is the joint angle of each joint when the target position is reached; and obtaining the target joint angles of each joint based on the interpolation calculation of the joint angles of each joint.
[0007] Optionally, the following parameters are calculated cyclically starting from j=0:
[0008] Position error e j :
[0009] When j=0, e j =[x e -x s ,y e -y s ,z e -z s ], q0 = θ s ;
[0010] When j>0, ΔT=T(q j )-T(q j-1 ), e j =ΔT(1:3,4);
[0011] Joint angle error Δq j =J v (q j ) T (J v (q j )J v (q j ) T +λ 2 I) -1 e j ;
[0012] Joint angle q j+1 =q j +Δq j ;
[0013] Number of cycles j = j + 1;
[0014] If ||Δq j ||≤q th Or the loop stops when the number of iterations j = M, at which point the joint angle q j+1That is, when reaching the target position, the angles θ of each joint are e ;
[0015] Interpolate and calculate the target angles of each joint: 0≤t k ≤T;
[0016] Among them, bold represents vector or matrix; T(q)∈se(3) represents the terminal homogeneous transformation matrix; J v (q)∈R 3×n represents the linear velocity Jacobian matrix; i=1,2,…,n represents the i-th joint of the rehabilitation robot; [x s ,y s ,z s ] represents the Cartesian coordinate of the starting position of the upper limb end; θ s ∈R n Represents the angle value of each joint of the rehabilitation robot at the beginning of the rehabilitation task; θ s (i) represents θ s The i-th item of is the angle of the i-th joint at the beginning of the rehabilitation task; [x e ,y e ,z e ] represents the Cartesian coordinates of the target position of the upper limb end; θ e ∈R n Represents the joint angles of the rehabilitation robot when it reaches the target position; θ e (i) represents θ e The i-th item of is the angle of the i-th joint when reaching the target position; t k Indicates the current control moment and is reset to zero when the rehabilitation exercise task begins; T indicates the preset duration of the rehabilitation task.
[0017] Optionally, the calculation formula for the arm support torque required by each joint is as follows:
[0018] τ g,i (t k )=(1-α i Q i (t k ))·τ g,i (t k-1 )+γ i Q i (t k )·e i (t k )
[0019] Where i = 1, 2, ..., n represents the i-th joint of the robot; t k represents the current control cycle, τ g,i (tk ) is the arm support torque required by the i-th joint in the current control cycle; t k-1 represents the last control cycle, τ g,i (t k-1 ) represents the arm support torque required by the i-th joint in the previous control cycle; α i represents the preset forgetting coefficient of the ith joint; γ i represents the pre-set learning rate of the ith joint; e i (t k ) represents the gravity torque error of the i-th joint in the current control cycle, Q i (t k ) represents the smoothing coefficient of the i-th joint in the current control cycle.
[0020] Optionally, the calculation formula of the gravity moment error is as follows:
[0021]
[0022] Among them, q d,i (t k ) represents t calculated based on the inverse kinematics algorithm k The target angle of the i-th joint at the moment; Indicates t k The target angular velocity of the i-th joint at the moment; q i (t k ) indicates t k The actual joint angle of the i-th joint at the moment; Indicates t k The actual angular velocity of the i-th joint at the moment; P i represents the preset stiffness coefficient of the ith joint, D i represents the preset damping coefficient of the i-th joint;
[0023] The calculation formula of the smoothing coefficient is as follows:
[0024]
[0025] Where exp represents an exponential function with e as the base; σ i Represents the preset standard deviation of the ith joint.
[0026] The iterative learning algorithm works as follows: If the patient cannot support the arm gravity by himself, the actual joint angle q i (t k ) Unable to track the target joint angle q d,i (t k ), then the gravity moment error term e i (t k) will become larger and larger, and the arm support torque τ provided by each joint of the robot q,i (t k ) will continue to increase until it is sufficient to support the weight of the arm; if the patient can support the weight of the arm by himself, the actual joint angle q i (t k ) can track the target joint angle q d,i (t k ), then the gravity moment error term e i (t k ) will tend to zero, and the arm support torque τ provided by each joint of the robot g,i (t k ) will continue to decrease to achieve dynamic balance of torque. Because the iterative learning algorithm continuously and dynamically adjusts during the working process to achieve dynamic balance of arm gravity torque, it can be applied to different patients (for example, different stroke grades or different arm gravity).
[0027] Optionally, the inverse dynamics control based on feedback linearization, calculating the output torque of each joint from the target motion parameter and the actual motion parameter of each joint, and calculating the driving amount of each joint according to the output torque of each joint, includes:
[0028] The dynamic equation of the rehabilitation robot considering arm gravity compensation is:
[0029]
[0030] Among them, the time t is omitted in each parameter k ; Respectively represent the actual angle, angular velocity and angular acceleration vector of each joint of the rehabilitation robot; M(q)∈R n×n represents the inertia matrix of the rehabilitation robot; represents the Kirchhoff term matrix of the rehabilitation robot; represents the friction force vector of the rehabilitation robot; g(q)∈R n represents the gravity vector of the rehabilitation robot; τ g ∈R n Represents the arm support torque vector required by each joint; τ∈R n Represents the output torque vector of each joint of the rehabilitation robot;
[0031] Written in the form of the state equation
[0032]
[0033]
[0034] in,
[0035]
[0036] Among them, q d =[q d,1 ,…,q d,n ] T Represents the target angle vector of each joint obtained by the inverse kinematics algorithm, Represents the target angular velocity vector of each joint, represents the target angular velocity vector of each joint; q = [q1,…,q n ] T Represents the actual angle vector of each joint, Represents the actual angular velocity vector of each joint; K p =diag(K p,1 ,…,K p,n ) represents the diagonal matrix composed of the proportional control coefficients of each joint; K d =diag(K d,1 ,…,K d,n ) represents the diagonal matrix composed of the differential control coefficients of each joint;
[0037] The driving amount of each joint is the current required by each joint, and the calculation formula is as follows:
[0038]
[0039] Among them, K A =diag(K A,1 ,…,K A,n ) represents the diagonal matrix composed of the torque constants of the motors of each joint.
[0040] The present invention provides a gravity compensation device for an upper limb rehabilitation robot, the device comprising: an angle calculation module, used for acquiring a starting position of an upper limb end and a target position corresponding to a rehabilitation training task, and calculating a target joint angle of each joint from the starting position and the target position based on an inverse kinematics algorithm; a support torque calculation module, used for online adjusting the arm support torque of each joint of the rehabilitation robot based on iterative learning, and calculating the arm support torque required for each joint from the target joint angle and the actual joint angle corresponding to the target joint angle, the target joint angular velocity, and the actual joint angular velocity; a drive quantity calculation module, used for performing inverse dynamics control based on feedback linearization, calculating the output torque of each joint from the target motion parameters and the actual motion parameters of each joint, and calculating the drive quantity of each joint according to the output torque of each joint; and a torque control module, used for controlling the joint to be trained to apply an auxiliary torque according to the drive quantity of each joint to perform rehabilitation training.
[0041] The present invention provides an upper limb rehabilitation robot, comprising: an upper limb rehabilitation exoskeleton and a controller; the controller is used to execute the upper limb rehabilitation robot gravity compensation method.
[0042] The embodiment of the present invention adjusts the arm support torque required for each joint of the rehabilitation robot online based on iterative learning to perform arm gravity compensation. Since the iterative learning control method does not rely on the precise mathematical model of the system, it can achieve control of a nonlinear strongly coupled dynamic system with high uncertainty within a given time range with a very simple algorithm, and track a given expected trajectory with high precision. Therefore, the algorithm used in the above gravity compensation method is simple and efficient, and can be directly applied to existing upper limb rehabilitation robots without additional deployment time, and is more practical.
[0043] Furthermore, a smoothing coefficient is added in the iterative learning process to smooth the torque difference between adjacent control cycles, which can avoid excessive changes that lead to system instability. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0045] Figure 1 It is a logic schematic diagram of a gravity compensation method for an upper limb rehabilitation robot based on iterative learning in an embodiment of the present invention;
[0046] Figure 2 is a schematic flow chart of a gravity compensation method for an upper limb rehabilitation robot in an embodiment of the present invention;
[0047] Figure 3 is a schematic flow chart of another upper limb rehabilitation robot gravity compensation method in an embodiment of the present invention;
[0048] Figure 4 Schematic diagram of the structure of a gravity compensation device for an upper limb rehabilitation robot in an embodiment of the present invention.
[0049] Description of reference numerals:
[0050] 401 - angle calculation module; 402 - support torque calculation module; 403 - driving amount calculation module; 404 - torque control module. DETAILED DESCRIPTION
[0051] In order to make the above-mentioned objects, features and advantages of the present invention more clearly understood, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0052] Cerebral apoplexy, commonly known as stroke, is an acute cerebrovascular circulatory disorder caused by blockage or rupture of cerebral blood vessels. It is characterized by high morbidity, high mortality, high disability rate, and high recurrence rate. Among stroke patients, only a few mild patients can recover naturally, and most stroke patients will be left with disability. Postoperative rehabilitation training is crucial for stroke patients. In traditional stroke rehabilitation treatment, physicians usually provide one-on-one rehabilitation treatment to patients with bare hands. The physician's personal treatment methods, experience differences, subjective consciousness, and fatigue level will directly affect the treatment effect. The treatment process is labor-intensive and the nursing cost is high. In addition, the ratio of the number of physicians to patients is seriously unbalanced, making it difficult to meet the growing medical needs.
[0053] The introduction of medical rehabilitation robot equipment is a feasible solution to effectively meet the needs of rehabilitation medicine. Rehabilitation robots can assist or even replace doctors to provide patients with more continuous, effective and targeted rehabilitation training and treatment, alleviate the shortage of rehabilitation medical human resources, and can record patients' treatment data in real time, providing an objective basis for disease assessment and program improvement.
[0054] At present, the common treatment plan for upper limb rehabilitation robots is to set a certain target position and require the patient's limbs to reach the target position with the assistance of the robot. Stroke patients usually cannot fully lift their arms, so rehabilitation robots are required to provide arm gravity compensation during rehabilitation training. Since the patient is uncertain, the shape and weight of the patient's upper limbs are difficult to measure accurately, and it is impossible to establish a dynamic model for compensation like the robot itself, which makes it difficult to control the rehabilitation robot.
[0055] There is a method for dynamic compensation of limb gravity of an upper limb rehabilitation robot. The method can divide the movement of the upper limb of a human body carrying a rehabilitation robot into an active movement mode and a passive movement mode, measure the joint angles of each joint of the rehabilitation robot in different positions in the passive mode, calculate the support force of the robot arm on the upper limb of the human body, thereby obtaining a data set corresponding to the joint angle and the support force; construct a prediction model, in which the joint angle is used as input and the support force is used as output; measure the resultant force and the real-time joint angle of the upper limb of the human body in the active movement mode, use the real-time joint angle and the prediction model to obtain the upper limb gravity compensation prediction value, and use the resultant force to subtract the gravity compensation prediction value to achieve the compensation of the upper limb gravity of the human body in the active movement mode. This method requires the pre-collection of the data set in the passive mode and the construction of the radial basis function neural network prediction model using the data set, and then it can be applied to the active movement mode. The limb gravity compensation method is relatively complex, and data collection and model training take a lot of time, while the patient's single machine rehabilitation training time is short (usually about half an hour), resulting in insufficient practicality of this method.
[0056] In view of the above problems, the present invention proposes an upper limb rehabilitation robot gravity compensation method based on iterative learning, which is used to solve the problem of arm gravity compensation for different patients. This method is based on iterative learning to online adjust the arm support torque required for each joint of the rehabilitation robot to perform arm gravity compensation. The algorithm is simple and efficient, and can be directly applied to existing upper limb rehabilitation robots without additional deployment time, which is more practical. The iterative learning control method adopted in this embodiment does not rely on the precise mathematical model of the system. It can achieve the control of nonlinear strongly coupled dynamic systems with high uncertainty within a given time range with a very simple algorithm, and track the given desired trajectory with high precision.
[0057] Figure 1 is a logic schematic diagram of a gravity compensation method for an upper limb rehabilitation robot based on iterative learning in an embodiment of the present invention, Figure 1 The inverse kinematics algorithm, arm support algorithm and motion control algorithm are shown in FIG.
[0058] Specifically, the inverse kinematics algorithm can convert the arm gravity compensation task in Cartesian space to joint space; the arm support algorithm adjusts the arm support torque required for each joint of the rehabilitation robot online based on iterative learning; and the motion control algorithm performs inverse dynamics control based on feedback linearization.
[0059] Among them, for a manipulator with n degrees of freedom, the positions of all its links can be determined by a set of n joint variables. Such a set of variables is usually called an nx 1 joint vector, and the space composed of all joint vectors is called the joint space. Iterative Learning Control (ILC) is applied to repetitive tasks and belongs to feedforward control. It is a special feedforward control with self-updating (or learning) ability. The purpose is to reduce the tracking error of the subsequent tasks by recording the tracking error of the previous learning task. Inverse dynamics control means that if the position, joint velocity and joint acceleration of each joint of the robot at a certain moment are known, the driving force (torque) applied to each rod of the robot at this time can be calculated. Feedback linearization control means applying state feedback to a nonlinear system to make the resulting closed-loop system linear, or if the closed-loop system is still nonlinear, a local coordinate system (j, U) or a non-different state transformation z=j(x) defined on U can still be found to make the nonlinear system have the form of a linear control system under the new coordinates.
[0060] Figure 1 The rehabilitation training task is shown in FIG, which provides the target position to the inverse kinematics algorithm, and the inverse kinematics algorithm calculates the joint target parameters (such as the joint target angle), which are input into the arm support algorithm and the motion control algorithm, and the arm support algorithm calculates the arm support torque to compensate for the patient's arm gravity, and the motion control algorithm calculates the current required for the target joint to provide a suitable torque, and the rehabilitation robot controls the motor of the joint according to the current. The sensor of the rehabilitation robot can collect the actual joint parameters and feed them back to the arm support algorithm and the motion control algorithm, which can calculate the above arm support torque and current based on them.
[0061] Figure 2 : is a schematic flow chart of a method for upper limb rehabilitation robot gravity compensation based on iterative learning in an embodiment of the present invention, the method comprising:
[0062] S202, obtaining the starting position of the upper limb end and the target position corresponding to the rehabilitation training task, and calculating the target joint angle of each joint from the starting position and the target position based on the inverse kinematics algorithm.
[0063] After determining the rehabilitation training task of the upper limb rehabilitation robot, relevant training parameters need to be set in advance. Given the target position of the rehabilitation training task, the upper limb end can move to the target position of the task, thereby driving the patient's upper limb to perform rehabilitation exercises. Generally, the mechanical arm or exoskeleton of the rehabilitation robot includes multiple joints, and in this step, the joint angle of each joint changing over time can be obtained.
[0064] Optionally, the target angles of each joint varying with time are calculated using the starting position and target position of the upper limb end in Cartesian space according to an inverse kinematics algorithm, which can be performed in the following steps:
[0065] (1) Establish the DH coordinate system for the upper limb rehabilitation robot and determine the terminal homogeneous transformation matrix T(q)∈se(3) and the linear velocity Jacobian matrix J v (q)∈R 3×n , set the calculation convergence threshold q th and the iteration number threshold M.
[0066] (2) Calculate the following parameters in a loop: position error, joint angle error, joint angle, and the number of loops plus one. Specifically, starting from j=0, calculate the following parameters in a loop:
[0067] Position error e j :
[0068] When j=0, e j =[x e -x s ,y e -y s ,z e -z s ], q0 = θ s ;
[0069] When j>0, ΔT=T(q j )-T(q j-1 ), e j =ΔT(1:3,4);
[0070] Joint angle error Δq j =J v (q j ) T (J v (q j )J v (q j ) T +λ 2 I) -1 e j ;
[0071] Joint angle q j+1 =q j +Δq j ;
[0072] Number of cycles j = j + 1;
[0073] (3) If the joint angle error is less than or equal to the calculation convergence threshold, or the number of iterations is equal to the iteration number threshold, the current joint angle is determined to be the joint angle of each joint when reaching the target position.
[0074] When ||Δq j ||≤q th Or the loop stops when the number of iterations j = M, at which point the joint angle q j+1 It is the angle θ of each joint when reaching the target position e .
[0075] (4) The target joint angle of each joint is obtained by interpolating the joint angles of each joint.
[0076] Interpolate and calculate the target angles of each joint: 0≤t k ≤T;
[0077] In the above formula, the boldface represents a vector or matrix; i = 1, 2, ..., n represents the i-th joint of the rehabilitation robot; [x s ,y s ,z s ] represents the Cartesian coordinate of the starting position of the upper limb end; θ s ∈R n Represents the angle value of each joint of the rehabilitation robot at the beginning of the rehabilitation task; θ s (i) represents θ s The i-th item of is the angle of the i-th joint at the beginning of the rehabilitation task; [x e ,y e ,z e ] represents the Cartesian coordinates of the target position of the upper limb end; θ e ∈R n Represents the joint angles of the rehabilitation robot when it reaches the target position; θ e (i) represents θ e The i-th item of is the angle of the i-th joint when reaching the target position; t k Indicates the current control moment and is reset to zero when the rehabilitation exercise task begins; T indicates the preset duration of the rehabilitation task.
[0078] Taking a certain joint as an example, the angle value of the joint of the rehabilitation robot at the beginning of the known rehabilitation task, and the calculated joint angle of the joint when the upper limb reaches the target position, that is, the starting angle and the ending angle. Since the time from the starting angle to the ending angle is the above-mentioned duration T, based on the interpolation calculation method, the joint angle corresponding to the joint at each control moment in the duration T (that is, the above-mentioned target joint angle) can be obtained. Similarly, the target joint angle of each joint can be obtained.
[0079] S204, adjusting the arm support torque of each joint of the rehabilitation robot online based on iterative learning, and calculating the arm support torque required for each joint from the target joint angle and the actual joint angle corresponding to the target joint angle, the target joint angular velocity, and the actual joint angular velocity.
[0080] The arm support algorithm is based on iterative learning to adjust the arm support torque required for each joint of the rehabilitation robot online. The target joint angle, actual joint angle, target joint angular velocity, and actual joint angular velocity can be input. Output the arm support torque τ required for each joint g,i .
[0081] The arm support torque τ required for each joint g,i The calculation formula is as follows:
[0082] τ g,i (t k )=(1-α i Q i (t k ))·τ g,i (t k-1 )+γ i Q i (t k )·e i (t k )
[0083] Where i = 1, 2, ..., n represents the i-th joint of the robot; t k represents the current control cycle, τ g,i (t k ) is the arm support torque required by the i-th joint in the current control cycle; t k-1 represents the last control cycle, τ g,i (t k-1 ) represents the arm support torque required by the i-th joint in the previous control cycle; α i represents the preset forgetting coefficient of the ith joint; γ i represents the pre-set learning rate of the ith joint; e i (t k ) represents the gravity torque error of the i-th joint in the current control cycle, Q i (t k ) represents the smoothing coefficient of the i-th joint in the current control cycle.
[0084] Among them, the gravity moment error e i (t k ) is the gravity torque error of the i-th joint in the current control cycle, which is used to update the arm support torque required by the i-th joint and can be calculated using the following formula:
[0085]
[0086] Among them, q d,i (t k ) represents t calculated based on the inverse kinematics algorithm k The target angle of the i-th joint at the moment; Indicates t k The target angular velocity of the i-th joint at the moment; q i (t k ) indicates t k The actual joint angle of the i-th joint at the moment; Indicates t k The actual angular velocity of the i-th joint at the moment; P i represents the preset stiffness coefficient of the ith joint, D i represents the preset damping coefficient of the i-th joint;
[0087] Smoothing coefficient Q i (t k ) is the smoothing coefficient of the i-th joint in the current control cycle, which is used to smooth the torque difference between adjacent control cycles to avoid excessive changes that lead to system instability. It can be calculated using the following formula:
[0088]
[0089] Where exp represents an exponential function with e as the base; σ i Represents the preset standard deviation of the ith joint.
[0090] The iterative learning algorithm works as follows: If the patient cannot support the arm gravity by himself, the actual joint angle q i (t k ) Unable to track the target joint angle q d,i (t k ), then the gravity moment error term e i (t k ) will become larger and larger, and the arm support torque τ provided by each joint of the robot g,i (t k ) will continue to increase until it is sufficient to support the weight of the arm; if the patient can support the weight of the arm by himself, the actual joint angle q i (t k ) can track the target joint angle q d,i (t k ), then the gravity moment error term e i (t k ) will tend to zero, and the arm support torque τ provided by each joint of the robot g,i (t k) will continue to decrease to achieve dynamic balance of torque. Since the iterative learning algorithm continuously and dynamically adjusts during the working process to achieve dynamic balance of arm gravity torque, it can be applied to different patients (for example, patients with different stroke grades or different arm gravity).
[0091] The above-mentioned smoothing coefficient is added in the iterative learning process to smooth the torque difference between adjacent control cycles to avoid excessive changes that may cause system instability.
[0092] S206, performing inverse dynamics control based on feedback linearization, calculating the output torque of each joint from the target motion parameters and actual motion parameters of each joint, and calculating the driving amount of each joint based on the output torque of each joint.
[0093] The motion parameters include the target joint angle, angular velocity, angular acceleration, etc. of each joint calculated in the above steps, and the driving amount can be parameters such as current or voltage of the joint execution unit (such as a motor, etc.) corresponding to the joint.
[0094] The dynamic equation of the rehabilitation robot considering arm gravity compensation is:
[0095]
[0096] Among them, the time t is omitted in each parameter k ; Respectively represent the actual angle, angular velocity and angular acceleration vector of each joint of the rehabilitation robot; M(q)∈R n×n represents the inertia matrix of the rehabilitation robot; represents the Kirchhoff term matrix of the rehabilitation robot; represents the friction force vector of the rehabilitation robot; g(q)∈R n represents the gravity vector of the rehabilitation robot; τ g ∈R n Represents the arm support torque vector required for each joint; τ∈R n Represents the output torque vector of each joint of the rehabilitation robot;
[0097] Written in the form of the state equation
[0098]
[0099]
[0100] Where x1 = q, u = τ;
[0101]
[0102] Among them, q d =[qd,1 ,…,q d,n ] T Represents the target angle vector of each joint obtained by the inverse kinematics algorithm, Represents the target angular velocity vector of each joint, represents the target angular velocity vector of each joint; q = [q1,…,q n ] T Represents the actual angle vector of each joint, Represents the actual angular velocity vector of each joint; K p =diag(K p,1 ,…,K p,n ) represents the diagonal matrix composed of the proportional control coefficients of each joint; K d =diag(K d,1 ,…,K d,n ) represents the diagonal matrix composed of the differential control coefficients of each joint;
[0103] The driving amount of each joint is the current required by each joint, and the calculation formula is as follows:
[0104]
[0105] Among them, K A =diag(K A,1 ,…,K A,n ) represents the diagonal matrix composed of the torque constants of the motors of each joint.
[0106] S208, controlling the joints to be trained to apply auxiliary torque according to the driving amount of each joint to perform rehabilitation training.
[0107] Based on the above process of calculating the driving amount of each joint, the driving amount of the joint to be trained can be determined, and the joint to be trained can be controlled by the driving amount, thereby applying a suitable auxiliary torque so that the joint to be trained can perform rehabilitation training movements according to the target.
[0108] The upper limb rehabilitation robot gravity compensation method provided by an embodiment of the present invention adjusts the arm support torque required for each joint of the rehabilitation robot online based on iterative learning to perform arm gravity compensation. Since the iterative learning control method does not rely on the precise mathematical model of the system, it can achieve control of a nonlinear strongly coupled dynamic system with high uncertainty within a given time range with a very simple algorithm, and track a given expected trajectory with high precision. Therefore, the algorithm used in the above gravity compensation method is simple and efficient, and can be directly applied to existing upper limb rehabilitation robots without additional deployment time, and is more practical.
[0109] Furthermore, a smoothing coefficient is added in the iterative learning process to smooth the torque difference between adjacent control cycles, which can avoid excessive changes that lead to system instability.
[0110] Figure 3 is a schematic flow chart of another upper limb rehabilitation robot gravity compensation method based on iterative learning in an embodiment of the present invention, the method comprising:
[0111] S301, pre-set relevant training parameters, give the rehabilitation training task target position [x e ,y e ,z e ].
[0112] S302, the inverse kinematics algorithm is based on the starting position of the upper limb end in Cartesian space [x s ,y s ,z s ] and the target position [x e ,y e ,z e ] Calculate the target angle q of each joint d,i .
[0113] The inverse kinematics algorithm converts the arm gravity compensation task in Cartesian space to joint space, and inputs the starting position of the upper limb end in the task space (Cartesian space) [x s ,y s ,z s ] and the target position [x e ,y e ,z e ], output the target angle q of each joint d,i The specific steps are as follows:
[0114] (1) Establish the DH coordinate system for the upper limb rehabilitation robot and determine the terminal homogeneous transformation matrix T(q)∈se(3) and the linear velocity Jacobian matrix J v (q)∈R 3×n , set the calculation convergence threshold q th And the upper limit M of the number of iterations.
[0115] (2) Starting from j=0, the following parameters are calculated in a loop
[0116] Position error e j :j=0 e j =[x e -x s ,y e -y s ,z e -z s ],q0=θ s ; When j>0, ΔT=T(qj )-T(q j-1 ),e j =ΔT(1:3,4).
[0117] Joint angle error Δq j =J v (q j ) T (J v (q j )J v (q j ) T +λ 2 I) -1 e j .
[0118] Joint angle q j+1 =q j +Δq j .
[0119] The number of cycles j=j+1.
[0120] (3) When ||Δq j ||≤q th Or the loop stops when the number of iterations j = M, at which time q j+1 It is the angle θ of each joint of the upper limb when reaching the end target position e .
[0121] (4) Interpolation calculation of the target angle of each joint 0≤t k ≤T;
[0122] Among them, bold represents vector or matrix; i = 1, 2, ..., n represents the i-th joint of the rehabilitation robot; [x s ,y s ,z s ] represents the Cartesian coordinate of the starting position of the upper limb end; θ s ∈R n Represents the angle value of each joint of the rehabilitation robot at the beginning of the rehabilitation task, which can be measured by the encoder of each joint; θ s (i) represents θ s The i-th item of is the angle of the i-th joint at the beginning of the rehabilitation task; [x e ,y e ,z e ] represents the Cartesian coordinates of the target position of the upper limb end; θ e ∈R n Represents the joint angles of the rehabilitation robot when it reaches the target position; θ e (i) represents θ eThe i-th item of is the angle of the i-th joint when reaching the target position; t k Represents the current control cycle and is reset to zero when the rehabilitation exercise task begins; T represents the preset duration of the rehabilitation task.
[0123] S303, the arm support algorithm adjusts the arm support torque required for each joint of the rehabilitation robot online based on iterative learning, and inputs the target joint angle, actual joint angle, target joint angular velocity, and actual joint angular velocity. Output the arm support torque τ required for each joint g,i .
[0124] The specific algorithm is as follows:
[0125] τ g,i (t k )=(1-α i Q i (t k ))·τ g,i (t k-1 )+γ i Q i (t k )·e i (t k )
[0126] Where i = 1, 2, ..., n represents the i-th joint of the robot; t k represents the current control cycle, τ g,i (t k ) is the arm support torque required by the i-th joint in the current control cycle; t k-1 represents the last control cycle, τ g,i (t k-1 ) is the arm support torque required by the i-th joint in the previous control cycle; α i is the preset forgetting coefficient of the ith joint; γ i is the pre-set learning rate of the i-th joint;
[0127] e i (t k ) is the gravity torque error of the i-th joint in the current control cycle, which is used to update the arm support torque required by the i-th joint and can be calculated using the following formula
[0128]
[0129] where q d,i (t k ) is t calculated by the inverse kinematics algorithm k The target angle of the i-th joint at the moment; Yes kThe target angular velocity of the i-th joint at the moment can be expressed as q d,i (t k ) Differentiate to get; q i (t k ) is t k The actual joint angle of the i-th joint at the moment can be measured by the joint encoder; Yes k The actual angular velocity of the i-th joint at the moment can be obtained by q i (t k ) Differentiate to get; P i is the preset stiffness coefficient of the ith joint, D i is the preset damping coefficient of the ith joint;
[0130] Q i (t k ) is the smoothing coefficient of the i-th joint in the current control cycle, which is used to smooth the torque difference between adjacent control cycles to avoid excessive changes that may cause system instability. It can be calculated using the following formula
[0131]
[0132] Where exp represents the exponential function with e as the base; σ i is the preset standard deviation of the ith joint; the rest of the items have the same meaning as above.
[0133] S304, the motion control algorithm performs inverse dynamics control based on feedback linearization, inputs target motion parameters and actual motion parameters of each joint, and outputs current instructions for each joint.
[0134] The specific method is as follows:
[0135] The dynamic equation of the rehabilitation robot considering arm gravity compensation is:
[0136]
[0137] The time t is omitted in each parameter k ; Respectively represent the actual angle, angular velocity and angular acceleration vector of each joint of the rehabilitation robot; M(q)∈R n×n represents the inertia matrix of the rehabilitation robot; represents the Kirchhoff term matrix of the rehabilitation robot; represents the friction force vector of the rehabilitation robot; g(q)∈R n represents the gravity vector of the rehabilitation robot; τ g ∈R n is the arm support torque vector required for each joint calculated by the arm support algorithm; τ∈R nRepresents the output torque vector of each joint of the rehabilitation robot.
[0138] Written in the form of state equation
[0139]
[0140]
[0141] where x1=q, u = τ;
[0142]
[0143] where q d =[q d,1 ,…,q d,n ] T is the target angle vector of each joint obtained by the inverse kinematics algorithm, Yes d The target angular velocity vector of each joint obtained by differentiation, yes The target angular velocity vector of each joint obtained by differentiation; q = [q1,…,q n ] T is the actual angle vector of each joint obtained by each joint encoder, is the actual angular velocity vector of each joint obtained by differentiating q; K p =diag(K p,1 ,…,K p,n ) is a diagonal matrix composed of the proportional control coefficients of each joint; K d =diag(K d,1 ,…,K d,n ) is a diagonal matrix consisting of the differential control coefficients of each joint.
[0144] Calculate the current required for each joint
[0145]
[0146] Where K A =diag(K A,1 ,…,K A,n ) is a diagonal matrix composed of the torque constants of the motors of each joint, which can be given by the motor manufacturer and represents the proportional relationship between the motor current and the output torque; the meanings of the remaining items are the same as above.
[0147] S305 , the rehabilitation robot applies auxiliary torque to the joint execution unit corresponding to the joint to be trained according to the current instruction of the joint to be trained, so that the joint to be trained performs rehabilitation training movements according to the target.
[0148] The above-mentioned upper limb rehabilitation robot gravity compensation method based on iterative learning provided in an embodiment of the present invention is used to solve the problem of arm gravity compensation for different patients. This method is based on iterative learning to online adjust the arm support torque required for each joint of the rehabilitation robot to perform arm gravity compensation. The algorithm is simple and efficient, and can be directly applied to existing upper limb rehabilitation robots without additional deployment time, and is more practical.
[0149] Figure 4 : is a structural schematic diagram of a gravity compensation device for an upper limb rehabilitation robot in an embodiment of the present invention, the device comprising:
[0150] Angle calculation module 401, used to obtain the starting position of the upper limb end and the target position corresponding to the rehabilitation training task, and calculate the target joint angle of each joint from the starting position and the target position based on the inverse kinematics algorithm;
[0151] A support torque calculation module 402 is used to adjust the arm support torque of each joint of the rehabilitation robot online based on iterative learning, and calculate the arm support torque required for each joint according to the target joint angle and the actual joint angle corresponding to the target joint angle, the target joint angular velocity, and the actual joint angular velocity;
[0152] A driving amount calculation module 403 is used to perform inverse dynamics control based on feedback linearization, calculate the output torque of each joint according to the target motion parameter and the actual motion parameter of each joint, and calculate the driving amount of each joint according to the output torque of each joint;
[0153] The torque control module 404 is used to control the joint to be trained to apply auxiliary torque according to the driving amount of each joint to perform rehabilitation training.
[0154] The upper limb rehabilitation robot gravity compensation device provided in an embodiment of the present invention adjusts the arm support torque required for each joint of the rehabilitation robot online based on iterative learning to perform arm gravity compensation. Since the iterative learning control method does not rely on the precise mathematical model of the system, it can achieve control of a nonlinear strongly coupled dynamic system with high uncertainty within a given time range with a very simple algorithm, and track a given expected trajectory with high precision. Therefore, the algorithm used in the above-mentioned gravity compensation method is simple and efficient, and can be directly applied to existing upper limb rehabilitation robots without additional deployment time, and is more practical.
[0155] Optionally, the angle calculation module 401 is specifically used to:
[0156] Establish the DH coordinate system for the upper limb rehabilitation robot, determine the terminal homogeneous transformation matrix and linear velocity Jacobian matrix, and set the calculation convergence threshold and iteration number threshold;
[0157] The following parameters are calculated in sequence: position error, joint angle error, joint angle, and the number of cycles plus one;
[0158] If the joint angle error is less than or equal to the calculation convergence threshold, or the number of iterations is equal to the iteration number threshold, determining the current joint angle as the joint angle of each joint when reaching the target position;
[0159] The target joint angle of each joint is obtained by interpolating and calculating the joint angles of each joint.
[0160] Optionally, the following parameters are calculated cyclically starting from j=0:
[0161] Position error e j :
[0162] When j=0, e j =[x e -x s ,y e -y s ,z e -z s ], q0 = θ s ;
[0163] When j>0, ΔT=T(q j )-T(q j-1 ), e j =ΔT(1:3,4);
[0164] Joint angle error Δq j =J v (q j ) T (J v (q j )J v (q j ) T +λ 2 I) -1 e j ;
[0165] Joint angle q j+1 =q j +Δq j ;
[0166] Number of cycles j = j + 1;
[0167] If ||Δq j ||≤q th Or the loop stops when the number of iterations j = M, at which point the joint angle q j+1 That is, when reaching the target position, the angles θ of each joint are e ;
[0168] Interpolate and calculate the target angles of each joint: 0≤t k ≤T;
[0169] Among them, bold represents vector or matrix; T(q)∈se(3) represents the terminal homogeneous transformation matrix; J v (q)∈R 3×n represents the linear velocity Jacobian matrix; i=1,2,…,n represents the i-th joint of the rehabilitation robot; [x s ,y s ,z s ] represents the Cartesian coordinate of the starting position of the upper limb end; θ s ∈R n Represents the angle value of each joint of the rehabilitation robot at the beginning of the rehabilitation task; θ s (i) represents θ s The i-th item of is the angle of the i-th joint at the beginning of the rehabilitation task; [x e ,y e ,z e ] represents the Cartesian coordinates of the target position of the upper limb end; θ e ∈R n Represents the joint angles of the rehabilitation robot when it reaches the target position; θ e (i) represents θ e The i-th item of is the angle of the i-th joint when reaching the target position; t k Indicates the current control moment and is reset to zero when the rehabilitation exercise task begins; T indicates the preset duration of the rehabilitation task.
[0170] Optionally, the calculation formula for the arm support torque required by each joint is as follows:
[0171] τ g,i (t k )=(1-α i Q i (t k ))·τ g,i (t k-1 )+γ i Q i (t k )·e i (t k )
[0172] Where i = 1, 2, ..., n represents the i-th joint of the robot; t k represents the current control cycle, τ g,i (t k ) is the arm support torque required by the i-th joint in the current control cycle; t k-1represents the last control cycle, τ g,i (t k-1 ) represents the arm support torque required by the i-th joint in the previous control cycle; α i represents the preset forgetting coefficient of the ith joint; γ i represents the pre-set learning rate of the ith joint; e i (t k ) represents the gravity torque error of the i-th joint in the current control cycle, Q i (t k ) represents the smoothing coefficient of the i-th joint in the current control cycle.
[0173] Optionally, the calculation formula of the gravity moment error is as follows:
[0174]
[0175] Among them, q d,i (t k ) represents t calculated based on the inverse kinematics algorithm k The target angle of the i-th joint at the moment; Indicates t k The target angular velocity of the i-th joint at the moment; q i (t k ) indicates t k The actual joint angle of the i-th joint at the moment; Indicates t k The actual angular velocity of the i-th joint at the moment; P i represents the preset stiffness coefficient of the ith joint, D i represents the preset damping coefficient of the i-th joint;
[0176] The calculation formula of the smoothing coefficient is as follows:
[0177]
[0178] Where exp represents an exponential function with e as the base; σ i Represents the preset standard deviation of the ith joint.
[0179] Optionally, the driving amount calculation module 403 is specifically used to
[0180] The dynamic equation of the rehabilitation robot considering arm gravity compensation is:
[0181]
[0182] Among them, the time t is omitted in each parameter k ; Respectively represent the actual angle, angular velocity and angular acceleration vector of each joint of the rehabilitation robot; M(q)∈R n×n represents the inertia matrix of the rehabilitation robot; represents the Kirchhoff term matrix of the rehabilitation robot; represents the friction force vector of the rehabilitation robot; g(q)∈R n represents the gravity vector of the rehabilitation robot; τ g ∈R n Represents the arm support torque vector required by each joint; τ∈R n Represents the output torque vector of each joint of the rehabilitation robot;
[0183] Written in the form of the state equation
[0184]
[0185]
[0186] Where x1 = q, u = τ;
[0187]
[0188] Among them, q d =[q d,1 ,…,q d,n ] T Represents the target angle vector of each joint obtained by the inverse kinematics algorithm, Represents the target angular velocity vector of each joint, represents the target angular velocity vector of each joint; q = [q1,…,q n ] T Represents the actual angle vector of each joint, Represents the actual angular velocity vector of each joint; K p =diag(K p,1 ,…,K p,n ) represents the diagonal matrix composed of the proportional control coefficients of each joint; K d =diag(K d,1 ,…,K d,n ) represents the diagonal matrix composed of the differential control coefficients of each joint;
[0189] The driving amount of each joint is the current required by each joint, and the calculation formula is as follows:
[0190]
[0191] Among them, K A =diag(K A,1 ,…,KA,n ) represents the diagonal matrix composed of the torque constants of the motors of each joint.
[0192] An embodiment of the present invention further provides an upper limb rehabilitation robot, comprising: an upper limb rehabilitation exoskeleton and a controller; the controller is used to execute the above-mentioned upper limb rehabilitation robot gravity compensation method.
[0193] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the upper limb rehabilitation robot gravity compensation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0194] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the control device through a computer, and the program can be stored in a computer-readable storage medium. When the program is executed, it may include the processes of the above-mentioned method embodiments, wherein the storage medium may be a memory, a disk, an optical disk, etc.
[0195] In this article, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0196] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0197] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A gravity compensation method for an upper limb rehabilitation robot, characterized in that: The method comprises: Obtaining the starting position of the upper limb end and the target position corresponding to the rehabilitation training task, and calculating the target joint angle of each joint from the starting position and the target position based on an inverse kinematics algorithm; Based on iterative learning, the arm support torque of each joint of the rehabilitation robot is adjusted online, and the arm support torque required by each joint is calculated according to the target joint angle, the actual joint angle corresponding to the target joint angle, the target joint angular velocity, and the actual joint angular velocity; Performing inverse dynamics control based on feedback linearization, calculating the output torque of each joint from the target motion parameter and the actual motion parameter of each joint, and calculating the driving amount of each joint according to the output torque of each joint; Controlling the joints to be trained to apply auxiliary torque according to the driving amount of each joint to perform rehabilitation training; The calculation formula of the arm support torque required by each joint is as follows: t g,i (t k )=(1-a i Q i (t k ))·t g,i (t k-1 )+c i Q i (t k )·e i (t k ) Where i=1, 2, ..., n represents the i-th joint of the robot; t k represents the current control cycle, τ g,i (t k ) is the arm support torque required by the i-th joint in the current control cycle; t k-1 represents the last control cycle, τ g,i (t k-1 ) represents the arm support torque required by the i-th joint in the previous control cycle; α i represents the preset forgetting coefficient of the ith joint; γ i represents the pre-set learning rate of the ith joint; e i (t k ) represents the gravity torque error of the i-th joint in the current control cycle, Q i (t k ) represents the smoothing coefficient of the i-th joint in the current control cycle; The calculation formula of the gravity moment error is as follows: Among them, q d,i (t k ) represents t calculated based on the inverse kinematics algorithm k The target angle of the i-th joint at the moment; Indicates t k The target angular velocity of the i-th joint at the moment; q i (t k ) indicates t k The actual joint angle of the i-th joint at the moment; Indicates t k The actual angular velocity of the i-th joint at the moment; P i represents the preset stiffness coefficient of the ith joint, D i represents the preset damping coefficient of the i-th joint; The calculation formula of the smoothing coefficient is as follows: Where exp represents an exponential function with e as the base; σ i Represents the preset standard deviation of the ith joint.
2. The method according to claim 1, characterized in that: The method of calculating the target joint angle of each joint from the starting position and the target position based on the inverse kinematics algorithm includes: Establish the DH coordinate system for the upper limb rehabilitation robot, determine the terminal homogeneous transformation matrix and linear velocity Jacobian matrix, and set the calculation convergence threshold and iteration number threshold; The following parameters are calculated in sequence: position error, joint angle error, joint angle, and the number of cycles plus one; If the joint angle error is less than or equal to the calculation convergence threshold, or the number of iterations is equal to the iteration number threshold, determining the current joint angle as the joint angle of each joint when reaching the target position; The target joint angle of each joint is obtained by interpolating the joint angles of each joint.
3. The method according to claim 2, characterized in that: Starting from j=0, the following parameters are calculated in a loop: Position error e j : When j = 0, e j = [x e - x s , y e - y s , z e - z s , q0 = θ s ; When j > 0, ΔT = T(q j ) - T(q j-1 ), e j = ΔT(1:3, 4); Joint angle error Δq j =J v (q j ) T (J v (q j )J v (q j ) T +λ 2 I) -1 e j ; Joint angle q j+1 =q j +Δq j ; Number of cycles j = j + 1; If ||Δq j ||≤q th Or the loop stops when the number of iterations j = M, at which point the joint angle q j+1 That is, when reaching the target position, the angles θ of each joint are e ; Interpolate and calculate the target angles of each joint: Among them, bold represents vector or matrix; T(q)∈se(3) represents the terminal homogeneous transformation matrix; J v (q)∈R 3×n represents the linear velocity Jacobian matrix; i = 1, 2, ..., n represents the i-th joint of the rehabilitation robot; [x s ,y s , z s ] represents the Cartesian coordinate of the starting position of the upper limb end; θ s ∈R n Represents the angle value of each joint of the rehabilitation robot at the beginning of the rehabilitation task; θ s (i) represents θ s The i-th item of is the angle of the i-th joint at the beginning of the rehabilitation task; [x e ,y e , z e ] represents the Cartesian coordinates of the target position of the upper limb end; θ e ∈R n Represents the joint angles of the rehabilitation robot when it reaches the target position; θ e (i) represents θ e The i-th item of is the angle of the i-th joint when reaching the target position; t k Indicates the current control moment and is reset to zero when the rehabilitation exercise task begins; T indicates the preset duration of the rehabilitation task.
4. The method according to claim 1, characterized in that: The inverse dynamics control based on feedback linearization is performed, the output torque of each joint is calculated by the target motion parameter and the actual motion parameter of each joint, and the driving amount of each joint is calculated according to the output torque of each joint, including: The dynamic equation of the rehabilitation robot considering arm gravity compensation is: Among them, the time t is omitted in each parameter k ; Respectively represent the actual angle, angular velocity and angular acceleration vector of each joint of the rehabilitation robot; M(q)∈R n×n represents the inertia matrix of the rehabilitation robot; represents the Kirchhoff term matrix of the rehabilitation robot; represents the friction force vector of the rehabilitation robot; g(q)∈R n represents the gravity vector of the rehabilitation robot; τ g ∈R n Represents the arm support torque vector required by each joint; τ∈R n Represents the output torque vector of each joint of the rehabilitation robot; Written in the form of the state equation Where x1 = q, u = τ; Among them, q d =[q d,1, …, q d,n ] T Represents the target angle vector of each joint obtained by the inverse kinematics algorithm, Represents the target angular velocity vector of each joint, represents the target angular velocity vector of each joint; q = [q1, ..., q n ] T Represents the actual angle vector of each joint, Represents the actual angular velocity vector of each joint; K p =diag(K p,1 , ..., K p,n ) represents the diagonal matrix composed of the proportional control coefficients of each joint; K d =diag(K d,1 , …, K d,n ) represents the diagonal matrix composed of the differential control coefficients of each joint; The driving amount of each joint is the current required by each joint, and the calculation formula is as follows: Among them, K A =diag(K A,1 , …, K A,n ) represents the diagonal matrix composed of the torque constants of the motors of each joint.
5. A gravity compensation device for an upper limb rehabilitation robot, characterized in that: The device comprises: An angle calculation module, used to obtain the starting position of the upper limb end and the target position corresponding to the rehabilitation training task, and calculate the target joint angle of each joint from the starting position and the target position based on the inverse kinematics algorithm; A support torque calculation module is used to adjust the arm support torque of each joint of the rehabilitation robot online based on iterative learning, and calculate the arm support torque required for each joint according to the target joint angle and the actual joint angle corresponding to the target joint angle, the target joint angular velocity, and the actual joint angular velocity; A driving amount calculation module, used for performing inverse dynamics control based on feedback linearization, calculating the output torque of each joint from the target motion parameter and the actual motion parameter of each joint, and calculating the driving amount of each joint according to the output torque of each joint; A torque control module, used for controlling the joints to be trained to apply auxiliary torque according to the driving amount of each joint, so as to perform rehabilitation training; The calculation formula of the arm support torque required by each joint is as follows: t g,i (t k )=(1-a i Q i (t k ))·t g,i (t k-1 )+c i Q i (t k )·e i (t k ) Where i=1, 2, ..., n represents the i-th joint of the robot; t k represents the current control cycle, τ g,i (t k ) is the arm support torque required by the i-th joint in the current control cycle; t k-1 represents the last control cycle, τ g,i (t k-1 ) represents the arm support torque required by the i-th joint in the previous control cycle; α i represents the preset forgetting coefficient of the ith joint; γ i represents the pre-set learning rate of the ith joint; e i (t k ) represents the gravity torque error of the i-th joint in the current control cycle, Q i (t k ) represents the smoothing coefficient of the i-th joint in the current control cycle; The calculation formula of the gravity moment error is as follows: Among them, q d,i (t k ) represents t calculated based on the inverse kinematics algorithm k The target angle of the i-th joint at the moment; Indicates t k The target angular velocity of the i-th joint at the moment; q i (t k ) indicates t k The actual joint angle of the i-th joint at the moment; Indicates t k The actual angular velocity of the i-th joint at the moment; P i represents the preset stiffness coefficient of the ith joint, D i represents the preset damping coefficient of the i-th joint; The calculation formula of the smoothing coefficient is as follows: Where exp represents an exponential function with e as the base; σ i Represents the preset standard deviation of the ith joint.
6. An upper limb rehabilitation robot, characterized in that: include: Upper limb rehabilitation exoskeleton and controller; The controller is used to execute the upper limb rehabilitation robot gravity compensation method described in any one of claims 1-4.
