Lower limb exoskeleton gait learning planning method and system based on segmented DMP
By dividing the gait period into multiple segments and performing DMP teaching and learning, the problem of forced term modeling difficulty in traditional DMP methods when the trajectory start point and end point are similar, and accurate gait trajectory generalization and end point arrival are achieved.
Patent Information
- Application Number
- CN202410423308.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-09
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-04-09
AI Technical Summary
The traditional DMP method is difficult to model when the starting point and end point of the teaching trajectory are close or the same, and the generation trajectory end point does not completely reach the set end point, and it is difficult to make the DMP generalization trajectory pass through the desired intermediate point by adjusting the parameters.
The gait learning planning method for lower limb exoskeletons based on segmented DMP is used to divide the trajectory of a complete gait period into several segments, and each sub-trajectory is taught and learned, and the generalization process of the sub-trajectory is activated in sequence through the periodic activation sequence to generate a periodic anthropomorphic gait trajectory that meets the gait requirements.
It realizes the generation of new trajectories that accurately pass the expected intermediate point and maintain the original trajectory shape, avoiding the problem of forced term construction difficulties when the trajectory start point and end point are similar or equal in a certain dimension, and ensuring that each trajectory can reach the set end point.
Smart Images

Figure CN118832561B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of gait planning for lower limb robots, and in particular to a method and system for learning and planning gait for lower limb exoskeleton based on segmented DMP. Background Art
[0002] As a wearable robot, the lower limb exoskeleton robot can drive the human legs to perform prescribed movements, play a role in movement correction and movement assistance, and has a wide range of application scenarios in medical rehabilitation, military operations and other fields. In order to make the exoskeleton robot better cooperate with the human body's coordinated movements, the gait planning of the lower limb exoskeleton is usually required to be anthropomorphic. In previous anthropomorphic gait planning algorithms, curve fitting is often performed on the collected gait trajectory, but this fitting trajectory is not only prone to losing some details of the original gait, but also has weak generalization ability and cannot adjust the amplitude or period as needed.
[0003] Since its proposal, Dynamic Movement Primitives (DMP) have been widely used in various fields of robotics. DMP constructs a point attractor system that can learn the teaching trajectory, and then generates a new trajectory from the set starting point to the end point according to the set starting point and end point of the trajectory, and the shape is consistent with the teaching trajectory. Through this teaching and learning method, the robot can learn human limb movements, reproduce and generalize. However, there are some problems with the traditional DMP method: 1. When the starting point and end point of the teaching trajectory are close or the same, the forcing term is difficult to model; 2. The forcing term is difficult to return to zero at the end of the trajectory, resulting in the end point of the generated trajectory not completely reaching the set end point; 3. It is difficult to adjust the parameters to make the DMP generalized trajectory pass through the expected intermediate point. Therefore, although DMP is very suitable for robot teaching and learning, the above problems still need to be solved. Summary of the invention
[0004] To solve the above problems, an embodiment of the present invention provides a lower limb exoskeleton gait learning planning method based on segmented DMP, the method comprising: obtaining the hip and knee joint angle trajectories of normal walking, and selecting the joint angle trajectory with a duration of one gait cycle as the joint teaching trajectory; calculating the end position trajectory corresponding to the joint trajectory on the sagittal plane as the DMP teaching trajectory; selecting the expected segmentation point according to the gait phase, and segmenting the DMP teaching trajectory to obtain each segmented trajectory; according to the DMP weight training algorithm, respectively training the basis function weights of each segmented trajectory; designing a periodic segmented trajectory activation sequence according to the proportion of each gait phase in the gait cycle; selecting the basis function weights of the corresponding segmented trajectory according to the activation sequence, and then determining the expected intermediate point according to the gait requirements to generate the position trajectory of the current segment; correcting the position trajectory according to a preset trajectory correction algorithm so that the end point of the DMP generated trajectory reaches the set end point; converting the corrected position trajectory into a joint angle trajectory according to inverse kinematics.
[0005] Optionally, the method selects the desired segmentation points according to the gait phase and segments the DMP teaching trajectory to obtain each segmented trajectory, including: the first segmentation point selects the point with the smallest z-axis coordinate in the DMP teaching trajectory, the second segmentation point selects the point with the same z-axis coordinate as the set end point, and the third segmentation point selects the point with the largest z-axis coordinate in the DMP teaching trajectory; the DMP teaching trajectory is segmented according to the first segmentation point, the second segmentation point, and the third segmentation point to obtain each segmented trajectory.
[0006] Optionally, the periodic segmented trajectory activation sequence is designed according to the proportion of each gait phase in the gait cycle, including: setting the segment I trajectory to account for a% of the gait cycle, the segment II trajectory to account for b%, the segment III trajectory to account for c%, and the segment IV trajectory to account for d%, and the sum of a%, b%, c% and d% is equal to one; when the time in the current gait cycle at the current moment is <a%, the segment I trajectory is activated, and the DMP performs encoding regression according to the basis function weights obtained by training the segment I teaching trajectory to generate a segment I line type and a DMP trajectory that converges to the target point; when the time in the current gait cycle at the current moment is ≥a% and <(a+b)%, the segment II trajectory is activated, and the DMP performs encoding regression according to the basis function weights obtained by training the segment II teaching trajectory to generate a DMP trajectory that converges to the target point; The basis function weights obtained from the teaching trajectory training are encoded and regressed to generate the II segment line type and the DMP trajectory that converges to the target point; when the time in the current gait cycle at the current moment is ≥(a+b)% and <(a+b+c)%, the III segment trajectory is activated, and the DMP performs encoding and regression according to the basis function weights obtained from the III segment teaching trajectory training to generate the III segment line type and the DMP trajectory that converges to the target point; when the time in the current gait cycle at the current moment is ≥(a+b+c)%, the IV segment trajectory is activated, and the DMP performs encoding and regression according to the basis function weights obtained from the IV segment teaching trajectory training to generate the IV segment line type and the DMP trajectory that converges to the target point.
[0007] Optionally, let the current time be t and the gait cycle be T, then the time of the current moment in the current cycle is:
[0008]
[0009] Optionally, the selecting of basis function weights of the corresponding segmented trajectory according to the activation sequence, and then determining the expected middle point according to the gait requirements to generate the position trajectory of the current segment, includes: judging the corresponding segmented trajectory at the current moment according to the activation sequence, and obtaining the corresponding basis function weights; determining the target end point of the generated segmented trajectory according to the gait requirements; and generating the position trajectory of the current segment according to the corresponding basis function weights and setting the starting point, setting the end point, and the expected middle point.
[0010] Optionally, the end point of the type I trajectory is fixed to the end point of the I segment teaching trajectory, the height of the end point of the type II trajectory is consistent with the height of the end point of the II segment teaching trajectory, and the height of the end point of the type IV trajectory is consistent with the height of the end point of the IV segment teaching trajectory; the initial position and speed of the current segmented trajectory are consistent with the final position and speed of the previous segment trajectory.
[0011] Optionally, the x-axis distance between the start point of the type I trajectory and the end point of the type II trajectory is related to the step length; the height of the end point of the type III trajectory is related to the stride height, and the time scaling term is related to the gait cycle.
[0012] Optionally, the position trajectory is corrected according to a preset trajectory correction algorithm so that the DMP generated trajectory endpoint reaches a set endpoint, including: assuming the position trajectory y dmp The actual end point is g dmp , the actual end point position and the set end point g 设 The error between is: err = g 设 -g dmp ; Let the exponential function be: p = err*e -kt ; where k is a normal number. The convergence speed of the exponential function can be adjusted by adjusting the size of k. The larger k is, the faster p converges to 0. dmp The position trajectory is corrected by performing the addition in reverse order.
[0013] Optionally, the training of basis function weights of each segmented trajectory according to a DMP weight training algorithm includes:
[0014] Establish a DMP teaching learning model. The basic formula of DMP is as follows
[0015]
[0016] Among them, y represents the position vector of the exoskeleton end, represents the velocity vector, z represents the time-scaled velocity vector, g represents the target position vector; f is a nonlinear forcing term used for trajectory shape learning; α y and β y are two positive constants; τ is a time scaling term used to adjust the speed of the trajectory;
[0017] For discrete DMP, construct a regular system
[0018]
[0019] Among them, α x is a constant, and the constant τ is consistent with τ in the basic formula of DMP;
[0020] The nonlinear forcing term f is realized by the normalized linear superposition of multiple nonlinear basis functions, and f is expressed as
[0021]
[0022] in, is the basis function, c i and h i are the center and variance of the basis function respectively; ω i is the weight corresponding to each basis function, N is the number of basis functions, y 0 represents the starting state, the x term ensures that f will disappear as x converges, and gy0 Determines the amplitude of f, which is used to subsequently scale the trajectory shape;
[0023] The center c of the basis function i Select the phase x and variance h corresponding to the uniform time point i With c i The relationship is as follows
[0024]
[0025] Given teaching trajectory According to the basic formula of DMP, the target forcing term f that needs to be learned is obtained target :
[0026]
[0027] Among them, y demo Represents the position vector of the current sub-teaching trajectory, represents the velocity vector, represents the acceleration vector;
[0028] The LWR optimization method is used to train the basis function weights so that the nonlinear forcing term f approaches the target forcing term f. target ; Construct the following square loss function:
[0029]
[0030] Then use the optimization method to solve the above equation so that J i Minimize, where P represents the total number of time steps of the entire trajectory. For discrete DMP, ξ(t) = x(t)(gy 0 ); weight training phase τ=1, g 设 and 0 are the set end point and starting point of the teaching trajectory respectively. The solution of the above loss function is
[0031]
[0032] in,
[0033]
[0034]
[0035]
[0036] The embodiment of the present invention provides a lower limb exoskeleton gait learning and planning system based on segmented DMP, the system comprising: a joint teaching trajectory acquisition module, used to acquire the hip and knee joint angle trajectories of normal walking, and select the joint angle trajectory with a duration of one gait cycle as the joint teaching trajectory; a DMP teaching trajectory calculation module, used to calculate the end position trajectory corresponding to the joint trajectory on the sagittal plane, as the DMP teaching trajectory; a segmentation module, used to select the expected segmentation point according to the gait phase, and segment the DMP teaching trajectory to obtain each segmented trajectory; a training module, used to train the DMP teaching trajectory according to the DMP weight training algorithm, respectively. The basis function weights of each segmented trajectory are trained; a sequence design module is used to design a periodic segmented trajectory activation sequence according to the proportion of each gait phase in the gait cycle; a position trajectory determination module is used to select the basis function weights of the corresponding segmented trajectory according to the activation sequence, and then determine the expected intermediate point according to the gait requirements to generate the position trajectory of the current segment; a trajectory correction module is used to correct the position trajectory according to a preset trajectory correction algorithm so that the end point of the DMP-generated trajectory reaches the set end point; a joint angle trajectory conversion module is used to convert the corrected position trajectory into a joint angle trajectory according to inverse kinematics.
[0037] The segmented DMP-based lower limb exoskeleton gait learning planning method and system provided in the embodiment of the present invention can divide the trajectory of a complete gait cycle into several segments, perform teaching learning on each sub-trajectory, and activate the generalization process of the sub-trajectory in turn in a periodic activation sequence, thereby generating a periodic anthropomorphic gait trajectory that meets the gait requirements, and before the trajectory generalization activation, the sub-trajectory target point can be changed at any time as needed to realize variable gait trajectory planning within the cycle.
[0038] Different from the classic DMP that directly learns the entire teaching trajectory, the segmented DMP has better generalization ability, can generate a new trajectory that accurately passes through the expected intermediate point and maintains the shape of the original trajectory, and can avoid the problem of difficult construction of forced terms when the starting point and end point of the trajectory are similar or equal in a certain dimension. Compared with the improved DMP algorithm, there will be no deformation of the trajectory shape. In addition, this embodiment adds a compensation algorithm based on the end point position error after the DMP generalized trajectory, which can ensure that each segment of the trajectory can reach the set end point. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] 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.
[0040] Figure 1A schematic flow chart of a lower limb exoskeleton gait learning and planning method based on segmented DMP provided in an embodiment of the present invention;
[0041] Figure 2 A schematic diagram of the original joint teaching trajectory provided by an embodiment of the present invention;
[0042] Figure 3 A schematic diagram of a two-link model of a lower limb exoskeleton provided by an embodiment of the present invention;
[0043] Figure 4 A schematic diagram of a Cartesian spatial position trajectory and trajectory segmentation provided by an embodiment of the present invention;
[0044] Figure 5 A schematic diagram of an original position trajectory and a corrected DMP position trajectory passing through a desired point provided by an embodiment of the present invention;
[0045] Figure 6 A schematic diagram of a joint trajectory corresponding to a corrected DMP position trajectory provided in an embodiment of the present invention;
[0046] Figure 7 A schematic diagram of a teaching learning framework based on segmented DMP provided in an embodiment of the present invention;
[0047] Figure 8 A schematic structural diagram of a lower limb exoskeleton gait learning and planning system based on segmented DMP provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] 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.
[0049] The existing patent "Three-loop control method for lower limb exoskeleton based on dynamic motion primitives" is a method for using DMP to plan motion trajectories for lower limb exoskeleton robots, in which the three-loop control includes an outer loop of trajectory learning based on DMP, a compliant interactive middle loop based on an admittance controller, and an inner loop position controller for trajectory tracking. This patent focuses on the overall control of the robot, while trajectory learning is the focus of this patent. In the trajectory learning part of this patent, only the improved DMP is used, focusing on solving the problem that the forced term cannot be modeled when the starting point and end point of the taught trajectory are close or the same in the classic DMP. However, since the nonlinear term of the improved DMP algorithm no longer contains the position information of the starting point and the end point, after the starting point and the end point of the trajectory are changed, the newly generated trajectory may differ in shape from the taught trajectory.
[0050] The embodiment of the present invention adopts the trajectory learning framework of the classic DMP and simultaneously segments the teaching trajectory. The selection of segmentation points avoids the situation where the starting point and the end point are close or the same, while ensuring that the generated trajectory is consistent with the teaching trajectory shape.
[0051] The existing patent "A DMP-based lower limb exoskeleton stair climbing control method" uses the DMP method to plan the motion trajectory for the stair climbing action of the lower limb exoskeleton robot, and also uses the idea of trajectory segmentation, dividing the hip and knee joint angle trajectory into two sections. The front section trajectory learns the joint trajectory from the calf stepping forward to the calf landing vertically when the human body climbs the stairs, and the rear section trajectory learns the inverted trajectory of the front section trajectory, and then generates the stair climbing joint trajectory adapted to different stair heights through DMP training. Since the second half of the trajectory is a deformation of the front section trajectory, the anthropomorphism of the teaching trajectory itself is not as good as the teaching trajectory collected by the whole human body; and the patent does not mention the timing problem of trajectory segmentation, and the proportion of the upper swing dynamic trajectory and the lower support state trajectory in the gait cycle of the stair climbing gait is not set, which is relatively lacking in rigor.
[0052] In the embodiment of the present invention, the entire teaching trajectory is obtained by collecting human walking movements using an IMU (Inertial Measurement Unit) sensor, and the anthropomorphism is guaranteed. The activation sequence of the segmented trajectory is divided according to the normal walking gait cycle, and the maintenance time of each segment is corrected by the time scaling item of each segment to ensure that the time proportion of each segment in the gait cycle is reasonable.
[0053] Figure 1 : is a flow chart of a lower limb exoskeleton gait learning and planning method based on segmented DMP provided by an embodiment of the present invention, the method comprising:
[0054] S102, obtaining the hip and knee joint angle trajectories of normal walking, and selecting the joint angle trajectory with a duration of one gait cycle as the joint teaching trajectory.
[0055] Specifically, the IMU sensors can be fixed on the waist, thighs and calves of healthy people, and the IMU data can be recorded while walking. The hip and knee joint angle trajectories of healthy people's normal walking are calculated based on the IMU data, and a suitable trajectory with a duration of one gait cycle is selected as the joint teaching trajectory of the exoskeleton. Figure 2 A schematic diagram of the original joint teaching trajectory provided in an embodiment of the present invention shows the trajectory of the hip and knee joints.
[0056] S104, calculating the end position trajectory corresponding to the joint trajectory on the sagittal plane as the DMP teaching trajectory.
[0057] A two-link model is established, and the position trajectory of the joint trajectory on the sagittal plane is calculated through the robot forward kinematics according to the wearer's leg length. This is used as the DMP teaching trajectory to achieve mapping from joint space to Cartesian space.
[0058] Figure 3 Schematic diagram of the two-link model of the lower limb exoskeleton provided by the embodiment of the present invention. Assume that the length of the thigh is L 1 , calf length is L 2 , the hip joint angle is θ 1 , the knee joint angle is θ 2 , the joint angle is positive counterclockwise. Establish the XOZ coordinate system in the sagittal plane, with the center of the hip joint as the origin, the x-axis to the right as positive, and the z-axis upward as positive. The hip joint coordinates are (x h ,,z h ), the knee joint coordinates are (x k ,z k ), the end coordinate is (x a ,z a ),but
[0059]
[0060]
[0061]
[0062] The end trajectory is the position teaching trajectory of the DMP.
[0063] S106, selecting a desired segmentation point according to the gait phase, and segmenting the DMP teaching trajectory to obtain segmented trajectories.
[0064] Optionally, the DMP teaching trajectory is segmented to obtain segmented trajectories, including:
[0065] The first segmentation point is the point with the smallest z-axis coordinate in the DMP teaching trajectory, the second segmentation point is the point with the same z-axis coordinate as the set end point, and the third segmentation point is the point with the largest z-axis coordinate in the DMP teaching trajectory; then, the DMP teaching trajectory is segmented according to the first segmentation point, the second segmentation point, and the third segmentation point to obtain each segmented trajectory.
[0066] Specifically, the trajectory can be divided into several segments according to the needs. In this embodiment, the four-segment segmentation is taken as an example. Segment I is the support state trajectory from the heel touching the ground to the leg being approximately vertical; segment II is the support state trajectory from the leg being approximately vertical to the heel leaving the ground; segments III and IV are the swing dynamic trajectories. In order to facilitate the control of the stride height, the swing dynamics are divided at the maximum point of the z-axis, and the swing dynamics are divided into segment III and segment IV trajectories. Figure 4The Cartesian spatial position trajectory and trajectory segmentation schematic diagram provided for the embodiment of the present invention show the trajectory segmented into segments I, II, III and IV.
[0067] In addition to the starting point and end point of the original teaching trajectory, three split points need to be selected to split the trajectory into four segments. The first split point is the point with the smallest z-axis coordinate in the trajectory; the second split point is the point with a z-axis coordinate that is approximately the same as the z-axis coordinate of the end point; the third split point is the point with the largest z-axis coordinate in the trajectory.
[0068] S108, training the basis function weights of each segmented trajectory respectively according to the DMP weight training algorithm.
[0069] Exemplarily, the training process is as follows:
[0070] 1. Establish a DMP teaching and learning model.
[0071] The basic formula of DMP is as follows
[0072]
[0073] Among them, y represents the position vector of the exoskeleton end, represents the velocity vector, z represents the time-scaled velocity vector, g represents the target position vector; f is a nonlinear forcing term used for trajectory shape learning; α y and β y are two positive constants, equivalent to the P parameter and D parameter in the PD controller; τ is a time scaling term used to adjust the speed of the trajectory.
[0074] For discrete DMP, construct a regular system
[0075]
[0076] Among them, α x is a constant, and the constant τ is consistent with τ in the basic formula of DMP. In this system, no matter the given initial value x 0 No matter how much is, the system will eventually (when the time domain is infinite) converge monotonically to the state x=0, so x can be regarded as a phase variable.
[0077] The nonlinear forcing term f is realized by the normalized linear superposition of multiple nonlinear basis functions. f can be expressed as
[0078]
[0079] in, is the basis function. Here, the basis function uses the Gaussian basis function. i and h i are the center and variance of the basis function respectively; ωi is the weight corresponding to each basis function, and N is the number of basis functions. 0 represents the starting state, the x term can ensure that f will disappear as x converges, and gy 0 Determines the amplitude of f, which is used for subsequent scaling of the trajectory shape.
[0080] In order to make the Gaussian basis function uniformly distributed in the time dimension, the center c of the basis function i Select the phase x corresponding to the uniform time point. Variance h i With c i The relationship is as follows
[0081]
[0082] 2. Given the teaching trajectory According to the DMP formula, we can get the target forcing term f that needs to be learned. target .
[0083]
[0084] Among them, y demo Represents the position vector of the current sub-teaching trajectory, represents the velocity vector, Represents the acceleration vector.
[0085] 3. Use the LWR optimization method to train the basis function weights so that the nonlinear forcing term f approaches the target forcing term f target .
[0086] Construct the following square loss function
[0087]
[0088] Then use the optimization method to solve the above equation so that J i Minimize. Where P represents the total number of time steps of the entire trajectory. For discrete DMP, ξ(t) = x(t)(gy 0 ). Weight training phase τ=1, g 设 and 0 are the set end point and starting point of the teaching trajectory respectively. The solution process of the above loss function is a weighted linear regression problem, and its solution is
[0089]
[0090] in,
[0091]
[0092]
[0093]
[0094] S110, designing a periodic segmented trajectory activation sequence according to the proportion of each gait phase in the gait cycle.
[0095] Exemplarily, it is set that the I segment trajectory accounts for a% of the gait cycle, the II segment trajectory accounts for b%, the III segment trajectory accounts for c%, and the IV segment trajectory accounts for d%, and the sum of a%, b%, c% and d% is equal to one; let the current time be t, and the gait cycle be T;
[0096] When the time in the current gait cycle is less than a%, the I-segment trajectory is activated, and the DMP performs encoding regression based on the basis function weights obtained from the I-segment teaching trajectory training to generate the I-segment line shape and converge to the DMP trajectory of the target point;
[0097] When the time in the current gait cycle at the current moment is ≥ a% and < (a+b)%, the segment II trajectory is activated, and the DMP performs encoding regression according to the basis function weights obtained from the training of the segment II teaching trajectory to generate the segment II line type and converge to the DMP trajectory of the target point;
[0098] When the time in the current gait cycle at the current moment is ≥ (a+b)% and < (a+b+c)%, the segment III trajectory is activated, and the DMP performs encoding regression according to the basis function weights obtained from the training of the segment III teaching trajectory to generate the segment III line type and converge to the DMP trajectory of the target point;
[0099] If the time in the current gait cycle at the current moment is ≥ (a+b+c)%, the IV segment trajectory is activated, and the DMP will perform encoding regression based on the basis function weights obtained from the IV segment teaching trajectory training to generate the IV segment line shape and converge to the DMP trajectory of the target point.
[0100] According to the total maintenance time of the teaching trajectory and the maintenance time of each segmented trajectory, and according to the proportion of gait phases in the gait cycle, we set the I segment generated trajectory to account for 37% of the gait cycle, the II segment generated trajectory to account for 23%, the III segment generated trajectory to account for 12%, and the IV segment generated trajectory to account for 28%.
[0101] Assume that the current time is t and the gait cycle is T, then the time of the current moment in the current cycle is
[0102]
[0103] When tmp / T<37%, the I-segment trajectory is activated, and the DMP will perform encoding regression based on the basis function weights obtained from the I-segment teaching trajectory training to generate the I-segment line type and converge to the DMP trajectory of the target point.
[0104] When 37%≤tmp / T<60%, the segment II trajectory is activated, and the DMP will perform encoding regression based on the basis function weights obtained from the segment II teaching trajectory training to generate the segment II line type and converge to the DMP trajectory of the target point.
[0105] When 60%≤tmp / T<72%, segment III trajectory is activated, and DMP will perform encoding regression based on the basis function weights obtained from segment III teaching trajectory training to generate segment III line type and converge to the DMP trajectory of the target point.
[0106] When 72%≤tmp / T<100%, the IV segment trajectory is activated, and the DMP will perform encoding regression based on the basis function weights obtained from the IV segment teaching trajectory training, generate the IV segment line type and converge to the DMP trajectory of the target point. When tmp / T=100%, it enters the next cycle.
[0107] S112, selecting the basis function weight of the corresponding segmented trajectory according to the activation sequence, and then determining the expected middle point according to the gait requirement to generate the position trajectory of the current segment.
[0108] Among them, the basis function weights of the corresponding segments are selected according to the activation sequence, and then the splicing points between the sub-trajectories, that is, the expected middle points, are determined according to the gait requirements, and the position trajectory of the current segment is generated by the DMP regression algorithm. By changing the end point and duration of the segmented trajectory before activating the generalization of the segmented trajectory, the gait parameters such as step length and speed can be changed during the generalization of the segmented trajectory to achieve variable gait planning.
[0109] Optionally, first determine the corresponding segmented trajectory at the current moment according to the activation sequence and obtain the corresponding basis function weight; secondly, determine the target end point of the generated segmented trajectory according to the gait requirements; then generate the position trajectory of the current segment according to the corresponding basis function weight and the set starting point, set end point, and expected intermediate point.
[0110] The activation sequence designed by S110 determines the line type that should be activated at the current moment and obtains the corresponding basis function weight ω. The target end point of the generated trajectory is determined according to the gait requirements, where the end point of the type I trajectory is fixed to the end point of the I segment teaching trajectory, the height of the end point of the type II trajectory is consistent with the height of the end point of the II segment teaching trajectory, and the height of the end point of the type IV trajectory is consistent with the height of the end point of the IV segment teaching trajectory.
[0111] In order to keep the sub-trajectory coherent and smooth when splicing, the initial position and speed of the current sub-trajectory should be set to be consistent with the final position and speed of the previous trajectory. For example, the starting point of the type I trajectory should be the same as the end point of the type IV trajectory, the starting point of the type II trajectory should be the same as the end point of the type I trajectory, the starting point of the type III trajectory should be the same as the end point of the type II trajectory, and the starting point of the type IV trajectory should be the same as the end point of the type III trajectory. In particular, if the current sub-trajectory is the beginning of the total trajectory, it has no previous trajectory, its starting position is determined according to the gait requirements, and the speed is 0.
[0112] The starting point of type I trajectory and the end point of type II trajectory have the same height, and the x-axis distance affects the step length; the end point height of type III trajectory affects the stride height. The time scaling term τ affects the gait cycle. Suppose the gait cycle of the teaching trajectory is T 0 , the gait period of the new trajectory is required to be T, then the time scaling term τ=T / T 0 .
[0113] The forcing term can be obtained by normalizing the linear superposition of N nonlinear basis functions:
[0114]
[0115] Among them, y 0 Indicates the starting point of the newly generated trajectory of DMP, g 设 Indicates the set end point of the DMP generated trajectory.
[0116] According to formula (4), we have
[0117]
[0118] Next, we can use the acceleration and control period dt, calculate the speed and position y dmp .y dmp The initial value is set to the starting point y 0 , The initial value is the terminal velocity of the previous trajectory. If the current trajectory is the first trajectory, the initial velocity is 0.
[0119] S114, correcting the position trajectory according to a preset trajectory correction algorithm so that the end point of the trajectory generated by the DMP reaches the set end point.
[0120] In this embodiment, a trajectory correction algorithm is designed to enable the end point of the DMP generated trajectory of each segment to reach the set point.
[0121] Let y dmp The actual end point is g dmp , the actual end point position and the set end point g 设 The error between
[0122] err = g 设 -g dmp (17)
[0123] Let the exponential function
[0124] p=err*e -kt (18)
[0125] Among them, k is a positive constant. The convergence speed of the exponential function can be adjusted by adjusting the size of k. The larger k is, the faster p converges to 0. dmp The reverse order of can ensure that the end point of the DMP trajectory reaches the set end point accurately. To ensure that the starting point of the DMP does not shift after compensation, p must converge to 0 quickly enough and k must be large enough.
[0126] Figure 5 A schematic diagram of an original position trajectory and a corrected DMP position trajectory passing through a desired point provided for an embodiment of the present invention shows an original position trajectory and a DMP position trajectory.
[0127] S116, converting the corrected position trajectory into a joint angle trajectory according to inverse kinematics.
[0128] For example, the current end position (x a ,z a ), thigh length L 1 , calf length L 2 Now we derive the angle θ of the hip joint and knee joint through geometric relationships 1 and θ 2 .
[0129] Let the center of the hip joint be O, the center of the knee joint be K, and the end position be A. Let ∠AOK = θ Δ1 , ∠AKO=θ Δ2 .but
[0130]
[0131]
[0132]
[0133] Due to the limitation of human leg structure, the lower limit of the exoskeleton knee joint angle is set to 0 degrees, so θ 2 ≥0, then
[0134] θ 2 =|π-θ Δ2 | (22)
[0135] The angle between vector OA and the negative z-axis is
[0136]
[0137] but
[0138] θ 1 =θ OA ±θ Δ1 (twenty four)
[0139] The specific plus or minus sign can be verified by forward kinematics. For example, when calculating, let θ 1 =θ OA +θ Δ1 If -L 1 sinθ 1 -L 2 sin(θ 1 +θ 2 )≠x a or -L 1 cosθ 1 -L 2 cos(θ 1 +θ 2 )≠z a , then take θ 1 =θ OA -θ Δ1 .
[0140] Figure 6 A schematic diagram of joint trajectories corresponding to the corrected DMP position trajectory provided in an embodiment of the present invention shows the joint trajectories of the hip and knee joints.
[0141] The lower limb exoskeleton gait learning and planning method based on segmented DMP provided in an embodiment of the present invention can divide the trajectory of a complete gait cycle into several segments, perform teaching and learning on each sub-trajectory, and activate the generalization process of the sub-trajectory in sequence in a periodic activation sequence, so as to generate a periodic anthropomorphic gait trajectory that meets the gait requirements, and before the trajectory generalization activation, the sub-trajectory target point can be changed at any time as needed to realize variable gait trajectory planning within the cycle.
[0142] Different from the classic DMP that directly learns the entire teaching trajectory, the segmented DMP has better generalization ability, can generate a new trajectory that accurately passes through the expected intermediate point and maintains the shape of the original trajectory, and can avoid the problem of difficult construction of forced terms when the starting point and end point of the trajectory are similar or equal in a certain dimension. Compared with the improved DMP algorithm, there will be no deformation of the trajectory shape. In addition, this embodiment adds a compensation algorithm based on the end point position error after the DMP generalized trajectory, which can ensure that each segment of the trajectory can reach the set end point, overcoming a defect of the DMP algorithm itself.
[0143] Figure 7The schematic diagram of the teaching learning framework based on the segmented DMP provided by the embodiment of the present invention shows the framework of the segmented DMP algorithm. Figure 7 As shown in the figure, the angle teaching trajectory is obtained by forward kinematics calculation to obtain the position teaching trajectory, and then the trajectory is segmented. The DMP training weight is performed on each segmented trajectory respectively, the activation queue is designed, and the target point is selected according to the gait requirements. The DMP regression is performed to generate the position trajectory of each segment, and the trajectory correction is performed to obtain the DMP position trajectory, and the DMP angle trajectory is obtained by inverse kinematics calculation.
[0144] The above-mentioned segmented DMP algorithm includes the following key points: 1. Trajectory segmentation based on the position characteristics of gait phases in Cartesian space; 2. Design of segmented trajectory activation sequence according to the proportion of each gait phase in the gait cycle; 3. Trajectory correction algorithm based on endpoint position error; 4. Constraint relationship between the start and end position and speed of the segmented trajectory.
[0145] In this embodiment, gait phase features can be extracted, trajectory segmentation can be performed according to the position features of each gait phase in Cartesian space, and the segmented trajectory activation sequence and time scaling items can be designed according to the cycle proportion of each gait phase; a trajectory correction algorithm is designed to compensate for the position error of the DMP trajectory end point; and the position and speed of the sub-trajectory head and tail joints are constrained to achieve seamless connection between trajectories.
[0146] Figure 8 A schematic diagram of the structure of a lower limb exoskeleton gait learning and planning system based on segmented DMP provided by an embodiment of the present invention is shown, and the system includes:
[0147] The joint teaching trajectory acquisition module 801 is used to acquire the hip and knee joint angle trajectories of normal walking, and select the joint angle trajectory with a duration of one gait cycle as the joint teaching trajectory;
[0148] The DMP teaching trajectory calculation module 802 is used to calculate the end position trajectory corresponding to the joint trajectory on the sagittal plane as the DMP teaching trajectory;
[0149] A segmentation module 803 is used to select a desired segmentation point according to the gait phase, and segment the DMP teaching trajectory to obtain each segmented trajectory;
[0150] A training module 804 is used to train the basis function weights of each segmented trajectory according to a DMP weight training algorithm;
[0151] A sequence design module 805, for designing a periodic segmented trajectory activation sequence according to the proportion of each gait phase in the gait cycle;
[0152] A position trajectory determination module 806 is used to select the basis function weights of the corresponding segmented trajectory according to the activation sequence, and then determine the expected middle point according to the gait requirement to generate the position trajectory of the current segment;
[0153] A trajectory correction module 807, used to correct the position trajectory according to a preset trajectory correction algorithm so that the end point of the DMP generated trajectory reaches the set end point;
[0154] The joint angle trajectory conversion module 808 is used to convert the corrected position trajectory into a joint angle trajectory according to inverse kinematics.
[0155] The embodiment of the present invention provides a lower limb exoskeleton gait learning and planning system based on segmented DMP. The segmented DMP has better generalization ability, can generate a new trajectory that accurately passes through the expected intermediate point and maintains the shape of the original trajectory, and can avoid the problem of difficult forced term construction when the starting point and the end point of the trajectory are similar or equal in a certain dimension; there will be no deformation of the trajectory shape; after the DMP generalizes the trajectory, a compensation algorithm based on the end point position error is added to ensure that each segment of the trajectory can reach the set end point.
[0156] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the scope defined by the claims.
[0157] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used 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 "include", "comprise" 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 sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0158] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the lower limb exoskeleton gait learning planning system based on segmented DMP disclosed in the embodiment, since it corresponds to the lower limb exoskeleton gait learning planning method based on segmented DMP disclosed in the above embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0159] 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 lower limb exoskeleton gait learning and planning method based on segmented DMP, characterized in that: The method comprises: Obtaining the hip and knee joint angle trajectories of normal walking, and selecting the joint angle trajectory with a duration of one gait cycle as the joint teaching trajectory; Calculate the end position trajectory corresponding to the joint trajectory in the sagittal plane as the DMP teaching trajectory; Selecting a desired segmentation point according to the gait phase, segmenting the DMP teaching trajectory to obtain each segmented trajectory; According to the DMP weight training algorithm, the basis function weights of each segmented trajectory are trained respectively; According to the proportion of each gait phase in the gait cycle, design a periodic segmented trajectory activation sequence; Selecting basis function weights of corresponding segmented trajectories according to the activation sequence, and then determining the expected intermediate point according to the gait requirements to generate the position trajectory of the current segment; Correcting the position trajectory according to a preset trajectory correction algorithm so that the end point of the DMP generated trajectory reaches the set end point; The corrected position trajectory is converted into a joint angle trajectory according to inverse kinematics; The step of selecting a desired segmentation point according to the gait phase and segmenting the DMP teaching trajectory to obtain segmented trajectories includes: The first split point is the point with the smallest z-axis coordinate in the DMP teaching trajectory, the second split point is the point with the same z-axis coordinate as the set end point, and the third split point is the point with the largest z-axis coordinate in the DMP teaching trajectory. Segmenting the DMP teaching trajectory according to the first segmentation point, the second segmentation point, and the third segmentation point to obtain segmented trajectories; The step of training the basis function weights of each segmented trajectory according to the DMP weight training algorithm comprises: Establish a DMP teaching learning model. The basic formula of DMP is as follows Among them, y represents the position vector of the exoskeleton end, represents the velocity vector, z represents the time-scaled velocity vector, g represents the target position vector; f is a nonlinear forcing term used for trajectory shape learning; α y and β y are two positive constants; τ is a time scaling term used to adjust the speed of the trajectory; For discrete DMP, construct a regular system Among them, α x is a constant, and the constant τ is consistent with τ in the DMP formula; The nonlinear term f is realized by the normalized linear superposition of multiple nonlinear basis functions, and f is expressed as in, is the basis function, c i and h i are the center and variance of the basis function respectively; ω i is the weight corresponding to each basis function, N is the number of basis functions, y0 represents the starting state, the x term can ensure that f will disappear as x converges, and g-y0 determines the amplitude of f, which is used to subsequently scale the trajectory shape; The center c of the basis function i Select the phase x and variance h corresponding to the uniform time point i With c i The relationship is as follows Given teaching trajectory According to the DMP formula, we can get the forced term f that needs to be learned. target : Among them, y demo Represents the position vector of the current sub-teaching trajectory, represents the velocity vector, represents the acceleration vector; The LWR optimization method is used to train the basis function weights so that the forcing term f approaches the target forcing term f target ; Construct the following square loss function: Then use the optimization method to solve the above equation so that J i Minimize, where P represents the total number of time steps of the entire trajectory. For discrete DMP, ξ(t) = x(t)(g-y0); in the weight training phase, τ = 1, g and y0 are the end point and starting point of the teaching trajectory respectively; the solution of the above loss function is in, According to the proportion of each gait phase in the gait cycle, designing a periodic segmented trajectory activation sequence includes: Set the I segment trajectory to account for a% of the gait cycle, the II segment trajectory to account for b%, the III segment trajectory to account for c%, and the IV segment trajectory to account for d%, and the sum of a%, b%, c% and d% is equal to one; set the current time to t, and the gait cycle to T; When the time in the current gait cycle is less than a%, the I-segment trajectory is activated, and the DMP performs encoding regression based on the basis function weights obtained from the I-segment teaching trajectory training to generate the I-segment line shape and converge to the DMP trajectory of the target point; When the time in the current gait cycle at the current moment is ≥ a% and < (a+b)%, the segment II trajectory is activated, and the DMP performs encoding regression according to the basis function weights obtained from the training of the segment II teaching trajectory to generate the segment II line type and converge to the DMP trajectory of the target point; When the time in the current gait cycle at the current moment is ≥ (a+b)% and < (a+b+c)%, the segment III trajectory is activated, and the DMP performs encoding regression according to the basis function weights obtained from the training of the segment III teaching trajectory to generate the segment III line type and converge to the DMP trajectory of the target point; If the time in the current gait cycle at the current moment is ≥ (a+b+c)%, the IV segment trajectory is activated, and the DMP will perform encoding regression based on the basis function weights obtained from the IV segment teaching trajectory training to generate the IV segment line shape and converge to the DMP trajectory of the target point.
2. The method according to claim 1, characterized in that Assume that the current time is t and the gait cycle is set to T, then the time of the current moment in the current cycle is:
3. The method according to claim 1, characterized in that The step of selecting the basis function weights of the corresponding segmented trajectory according to the activation sequence, and then determining the expected intermediate point according to the gait requirement to generate the position trajectory of the current segment, includes: Determine the corresponding segmented trajectory at the current moment according to the activation sequence, and obtain the corresponding basis function weight; Determine the target end point of the generated segmented trajectory according to the gait requirements; The position trajectory of the current segment is generated according to the corresponding basis function weights and the set starting point, the set end point, and the expected middle point.
4. The method according to claim 3, characterized in that The end point of type I track is fixed to the end point of segment I teaching track, the height of the end point of type II track is consistent with the height of the end point of segment II teaching track, and the height of the end point of type IV track is consistent with the height of the end point of segment IV teaching track; The initial position and speed of the current segment trajectory are consistent with the final position and speed of the previous segment trajectory.
5. The method according to claim 3, characterized in that: The x-axis distance between the start point of the type I trajectory and the end point of the type II trajectory is related to the step length; the height of the end point of the type III trajectory is related to the stride height, and the time scaling term is related to the gait cycle.
6. The method according to claim 1, characterized in that The step of correcting the position trajectory according to a preset trajectory correction algorithm so that the end point of the trajectory generated by the DMP reaches a set end point includes: Let position trajectory y dmp The actual end point is g dmp , the error between the actual end point position and the set end point g is: err = gg dmp ; Let the exponential function be: p = err*e -kt ; Among them, k is a normal number. The convergence speed of the exponential function can be adjusted by adjusting the size of k. The larger k is, the faster p converges to 0. Through the exponential function p and y dmp The position trajectory is corrected by performing the addition in reverse order.
7. A lower limb exoskeleton gait learning and planning system based on segmented DMP, characterized in that: The system comprises: A joint teaching trajectory acquisition module is used to acquire the hip and knee joint angle trajectories of normal walking, and select the joint angle trajectory with a duration of one gait cycle as the joint teaching trajectory; DMP teaching trajectory calculation module, used to calculate the end position trajectory corresponding to the joint trajectory in the sagittal plane as the DMP teaching trajectory; A segmentation module, used for selecting a desired segmentation point according to a gait phase, and segmenting the DMP teaching trajectory to obtain segmented trajectories; A training module, used for training the basis function weights of each segmented trajectory according to a DMP weight training algorithm; A sequence design module, used for designing a periodic segmented trajectory activation sequence according to the proportion of each gait phase in the gait cycle; A position trajectory determination module, used for selecting the basis function weights of the corresponding segmented trajectory according to the activation sequence, and then determining the expected intermediate point according to the gait requirements to generate the position trajectory of the current segment; A trajectory correction module, used to correct the position trajectory according to a preset trajectory correction algorithm so that the end point of the trajectory generated by the DMP reaches the set end point; A joint angle trajectory conversion module, used to convert the corrected position trajectory into a joint angle trajectory according to inverse kinematics; The segmentation module is specifically used for: The first split point is the point with the smallest z-axis coordinate in the DMP teaching trajectory, the second split point is the point with the same z-axis coordinate as the set end point, and the third split point is the point with the largest z-axis coordinate in the DMP teaching trajectory. Segmenting the DMP teaching trajectory according to the first segmentation point, the second segmentation point, and the third segmentation point to obtain segmented trajectories; The training module is specifically used for: Establish a DMP teaching learning model. The basic formula of DMP is as follows Among them, y represents the position vector of the exoskeleton end, represents the velocity vector, z represents the time-scaled velocity vector, g represents the target position vector; f is a nonlinear forcing term used for trajectory shape learning; α y and β y are two positive constants; τ is a time scaling term used to adjust the speed of the trajectory; For discrete DMP, construct a regular system Among them, α x is a constant, and the constant τ is consistent with τ in the DMP formula; The nonlinear term f is realized by the normalized linear superposition of multiple nonlinear basis functions, and f is expressed as in, is the basis function, c i and h i are the center and variance of the basis function respectively; ω i is the weight corresponding to each basis function, N is the number of basis functions, y0 represents the starting state, the x term can ensure that f will disappear as x converges, and g-y0 determines the amplitude of f, which is used to subsequently scale the trajectory shape; The center c of the basis function i Select the phase x and variance h corresponding to the uniform time point i With c i The relationship is as follows Given teaching trajectory According to the DMP formula, we can get the forced term f that needs to be learned. target : Among them, y demo Represents the position vector of the current sub-teaching trajectory, represents the velocity vector, represents the acceleration vector; The LWR optimization method is used to train the basis function weights so that the forcing term f approaches the target forcing term f target ; Construct the following square loss function: Then use the optimization method to solve the above equation so that J i Minimize, where P represents the total number of time steps of the entire trajectory. For discrete DMP, ξ(t) = x(t)(g-y0); in the weight training phase, τ = 1, g and y0 are the end point and starting point of the teaching trajectory respectively; the solution of the above loss function is in, The sequence design module is specifically used for: Set the I segment trajectory to account for a% of the gait cycle, the II segment trajectory to account for b%, the III segment trajectory to account for c%, and the IV segment trajectory to account for d%, and the sum of a%, b%, c% and d% is equal to one; set the current time to t, and the gait cycle to T; When the time in the current gait cycle is less than a%, the I-segment trajectory is activated, and the DMP performs encoding regression based on the basis function weights obtained from the I-segment teaching trajectory training to generate the I-segment line shape and converge to the DMP trajectory of the target point; When the time in the current gait cycle at the current moment is ≥ a% and < (a+b)%, the segment II trajectory is activated, and the DMP performs encoding regression according to the basis function weights obtained from the training of the segment II teaching trajectory to generate the segment II line type and converge to the DMP trajectory of the target point; When the time in the current gait cycle at the current moment is ≥ (a+b)% and < (a+b+c)%, the segment III trajectory is activated, and the DMP performs encoding regression according to the basis function weights obtained from the training of the segment III teaching trajectory to generate the segment III line type and converge to the DMP trajectory of the target point; If the time in the current gait cycle at the current moment is ≥ (a+b+c)%, the IV segment trajectory is activated, and the DMP will perform encoding regression based on the basis function weights obtained from the IV segment teaching trajectory training to generate the IV segment line shape and converge to the DMP trajectory of the target point.
Citation Information
Patent Citations
Micro-nano robot assembly track learning method based on dynamic motion primitives
CN114571458A
Robot and attitude control method of robot
CN1590039A