A control method for a lower limb exoskeleton rehabilitation robot with balance assistance function
By using reinforcement learning and temporal convolutional networks to train the gait generation network in the simulation environment, the problem of long time and high cost of balance judgment and prediction in the control of lower limb exoskeleton rehabilitation robots is solved, and timely and effective balance assistance control is achieved. Reduced dependence on sensors.
Patent Information
- Application Number
- CN202210802825.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-07
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-07-07
AI Technical Summary
Existing control methods for lower limb exoskeleton rehabilitation robots have problems such as long time, high cost, and inability to correct imbalances in time when judging and predicting the balance state. Moreover, traditional methods rely on multiple sensors and complex data processing.
The reinforcement learning algorithm is used to train the balance coding model and action generation model in the simulation environment, and the temporal convolution network is combined to establish a gait generation network. The balance prediction model is trained through the imitation learning algorithm, and the expected speed value of each joint motor of the robot is generated to achieve balance auxiliary control. , reducing reliance on additional sensors.
It achieves timely and effective balance auxiliary control on the lower limb exoskeleton rehabilitation robot, reduces training costs and time, and avoids complex data sampling and processing processes.
Smart Images

Figure CN115157247B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of lower limb exoskeleton rehabilitation robot control, and in particular to a lower limb exoskeleton rehabilitation robot control method with a balance assisting function. Background Art
[0002] In recent years, the development of robotics technology has reached an unprecedented prosperity, especially lower limb exoskeleton robots, which have shown broad application prospects in the fields of medical, military, and industry.
[0003] In the field of lower limb exoskeleton rehabilitation robot control, traditional control is to give the exoskeleton robot a predetermined and unchanging target trajectory. This control method has a certain auxiliary effect in the lower limb rehabilitation treatment of stroke and cerebral palsy patients. However, the mechanical execution target trajectory of the lower limb exoskeleton rehabilitation robot will cause balance problems such as limited posture and lack of flexibility in patients, affecting the treatment effect. To solve the above problems, researchers have created a controller based on artificial intelligence algorithms. The controller generates the motion trajectory of the lower limb exoskeleton rehabilitation robot in real time and can respond to imbalance. Artificial neural networks have strong nonlinear mapping and adaptive capabilities and are often used as carriers of artificial intelligence algorithm models. However, the training of neural network models in existing methods requires continuous real-time data interaction with exoskeleton rehabilitation robots in the real world. This training method takes a long time and has a high training cost. The existing lower limb exoskeleton rehabilitation robot control method based on artificial intelligence algorithms only uses the state information of the exoskeleton rehabilitation robot at a single time point to judge the balance state at this time point. This method requires more sensors other than the motor encoder, and can only judge the balance state at this time point, and cannot timely and effectively predict imbalance events. Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention provides a control method for a lower limb exoskeleton rehabilitation robot with a balance assisting function.
[0005] To achieve the above purpose, the technical solutions adopted are as follows:
[0006] A control method for a lower limb exoskeleton rehabilitation robot with a balance assisting function comprises the following steps:
[0007] Use any physics engine to build a simulation environment for human-robot interaction;
[0008] The designed balance encoding model and action generation model are trained in a simulation environment through a reinforcement learning algorithm, where the reward function includes a balance term.
[0009] Generate datasets using action generation models;
[0010] Establish a balance prediction model and form a gait generation network with the action generation model. Use the above dataset to train the gait generation network through imitation learning algorithm.
[0011] The trained gait generation network is used to output the expected speed value of the motors of each joint of the robot, and combined with the motor servo drive controller to realize the control of the robot.
[0012] The further improvement of this method is: using any physical engine to establish a simulation environment for human-robot interaction is as follows:
[0013] The simulation environment includes a lower limb exoskeleton rehabilitation robot model and an external environment of the lower limb exoskeleton rehabilitation robot.
[0014] The simulation environment can provide real-time status values of knee and hip joints of both legs of the robot model and information related to the balance status, including: the position, velocity, acceleration of the center of mass, and the position and velocity of the center of gravity.
[0015] A further improvement of this method is that the training of the designed balance encoding model and action generation model is completed in a simulation environment through a reinforcement learning algorithm, wherein the reward function includes a balance term specifically as follows:
[0016] The balance item reward function is any mathematical model that can quantitatively determine the balance degree of the lower limb exoskeleton rehabilitation robot;
[0017] The state space of the reinforcement learning algorithm includes an equilibrium state space and a joint state space, and the action space of the reinforcement learning algorithm is the expected speed value of each joint motor of the robot model in the simulation environment.
[0018] The input of the robot model in the simulation environment is the output of the action generation model, that is, the action space value of the reinforcement learning algorithm; the input of the balance coding model is the balance state space value, and the input of the action generation model is the output of the balance coding model and the joint state space value;
[0019] The weights and bias parameters of the balanced encoding model and the action generation model are updated according to the reward values obtained.
[0020] A further improvement of the method is that the state space of the reinforcement learning algorithm includes an equilibrium state space and a joint state space, and the action space of the reinforcement learning algorithm is the speed expectation value of each joint motor of the robot model in the simulation environment, specifically:
[0021] The balance state space includes multiple balance-related state information from the robot model, including: center of mass position, speed, acceleration, center of gravity position, speed; the joint state space includes real-time position, speed, acceleration information of knee and hip joints of both legs of the robot model.
[0022] The further improvement of this method is that the data set is generated by using the action generation model:
[0023] The data set consists of the input and output of the action generation model, the input of the action generation model is the joint state space value and the output of the balance encoding model at the corresponding moment of the joint state space value, and the output of the action generation model is the action space value corresponding to the joint state space value.
[0024] The further improvement of this method is to establish a balance prediction model, which forms a gait generation network with the action generation model, and use the above data set to train the gait generation network through the imitation learning algorithm. Specifically:
[0025] The balance prediction model is a temporal convolutional network;
[0026] The feature of the data set is the joint state space value in the data set, and the label of the feature is the output value and action space value of the balance encoding model corresponding to the joint state space value;
[0027] The balance prediction model and the action generation model in the gait generation network are connected through a fully connected layer, and the weight and bias parameters of the balance prediction model are updated through an imitation learning algorithm, so that the output value of the balance prediction model in the gait generation network imitates the output value of the balance encoding model in the data set, and the output value of the action generation model in the gait generation network imitates the output value of the action generation model in the data set.
[0028] A further improvement of the method is that the balance prediction model and the action generation model in the gait generation network are connected through a fully connected layer, and the weight and bias parameters of the balance prediction model are updated using an imitation learning algorithm, so that the output value of the balance prediction model in the gait generation network imitates the output value of the balance encoding model in the data set, and the output value of the action generation model in the gait generation network imitates the output value of the action generation model in the data set. Specifically:
[0029] The tth input feature of the balance prediction model is the N time-continuous joint state space values after t, where N is the number of historical features of the preset time convolution network input, and the tth input feature of the action generation model is the (t+N-1)th joint state space value and the output value of the balance prediction model;
[0030] The weight and bias parameters of the balanced prediction model are updated using a stochastic gradient descent algorithm, and the step size and direction of the parameter update are determined by the loss function of the stochastic gradient descent algorithm.
[0031] A further improvement of this method is that the weight and bias parameters of the balance prediction model are updated using a stochastic gradient descent algorithm, and the step size and direction of the update are determined by the loss function of the stochastic gradient descent algorithm, specifically:
[0032] The loss function is as follows:
[0033] L=(a u(t+29) -a lt ) 2 +(b u(t+29) -b lt ) 2
[0034] Among them, t represents the serial number corresponding to the feature value in the data set, a u(t+29) and b u(t+29) is the label corresponding to the t-th feature value: the output value of the action generation model in the dataset and the output value of the balanced encoding model, a lt and b lt It is the output value of the action generation model in the gait generation network and the output value of the balance prediction model when the tth eigenvalue is input.
[0035] The further improvement of this method is that the trained gait generation network is used to output the expected speed value of each joint motor of the robot, and the control of the robot is realized by combining the motor servo drive controller as follows:
[0036] The trained gait generation network interacts with the real lower limb exoskeleton rehabilitation robot system to form a gait closed-loop cycle, which includes inputting the joint state space values of the lower limb exoskeleton rehabilitation robot into the gait generation network, the gait generation network outputting the expected speed values of the motors of each joint of the lower limb exoskeleton rehabilitation robot, the motor servo drive controller executing the expected speed value, and the joint state space values of the lower limb exoskeleton rehabilitation robot being updated. This gait closed-loop cycle enables the lower limb exoskeleton rehabilitation robot to walk in a balanced and stable manner.
[0037] Compared with the prior art, the beneficial effects are as follows:
[0038] (1) A balance reward term is added to the reward function of the reinforcement learning algorithm, so that the expected value of the joint motor velocity output by the trained gait generation network has a balance auxiliary function, which can timely and effectively correct the imbalance tendency and realize end-to-end control of the lower limb exoskeleton rehabilitation robot;
[0039] (2) A balance prediction model is built based on a temporal convolutional network, and a relationship network between historical joint state information and the balance state of the lower limb exoskeleton rehabilitation robot is established, so that the trained gait generation network can predict the balance state of the lower limb exoskeleton rehabilitation robot without the need for additional sensors;
[0040] (3) The entire training process of the gait generation network is carried out offline, avoiding complex data sampling and processing, with fast training speed and low training cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A training flow chart of the gait generation network of the present invention;
[0043] Figure 2 A training structure diagram of a balanced encoding model and an action generation model of the present invention;
[0044] Figure 3 The gait generation network imitation learning training structure diagram of the present invention;
[0045] Figure 4 This is an application structure diagram of the gait generation network of the present invention. DETAILED DESCRIPTION
[0046] The technical solution of the present invention will be clearly and completely described below through specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0047] This embodiment describes the present invention in detail with reference to the accompanying drawings:
[0048] Example:
[0049] For ease of understanding, in this embodiment, a lower limb exoskeleton rehabilitation robot is taken as an example.
[0050] The present invention proposes a control method for a lower limb exoskeleton rehabilitation robot with a balance assisting function, comprising the following steps:
[0051] Among them, the training process of the gait generation network is as follows Figure 1 shown.
[0052] S1. Using any physical engine to establish a simulation environment for human-robot interaction; including the following steps:
[0053] S1.1. According to the actual patient-exoskeleton robot system interaction environment, a lower limb exoskeleton rehabilitation robot model is designed based on the MuJoCo or PyBullet physics engine. The lower limb exoskeleton rehabilitation robot model is as close as possible to the motion characteristics of the real patient-exoskeleton system. The lower limb exoskeleton rehabilitation robot model should include a sensor model to obtain corresponding sensor information and provide raw data for the state space value of the reinforcement learning algorithm, including: the position, velocity, acceleration of the center of mass, and the position and velocity of the center of gravity.
[0054] S1.2. Design the external environment of the lower limb exoskeleton rehabilitation robot based on Gym to provide a virtual scene for the lower limb exoskeleton rehabilitation robot model. Create an environment initialization file and register the newly created environment;
[0055] S1.3. The parameters of the lower limb exoskeleton rehabilitation robot model and the interaction coefficient between the robot model and the external environment are processed by the parameter randomization method to provide rich training scene samples and increase the fitness of the trained model.
[0056] In this embodiment, the parameters of the lower limb exoskeleton rehabilitation robot model that may affect the output include joint degrees of freedom, joint friction coefficient, joint friction torque parameters, human-computer interaction force and human body weight, etc.; the interaction coefficients that may affect the output include ground stiffness, ground friction coefficient, gravity acceleration, etc.
[0057] S2. The training of the designed balance encoding model and action generation model is completed in a simulation environment through a reinforcement learning algorithm, where the reward function includes a balance term. The training structure of the balance encoding model and action generation model is as follows: Figure 2 As shown, the following steps are included:
[0058] S2.1. Select a reinforcement learning algorithm and design a reward function of the reinforcement learning algorithm, wherein the balance term of the reward function is any mathematical model that can quantitatively determine the balance degree of the lower limb exoskeleton rehabilitation robot, such as the zero moment point (ZMP) balance criterion, the center of mass moment pivot (CMP) balance criterion, and the extrapolated center of mass (XcoM) balance criterion;
[0059] In this embodiment, the Trust Region Policy Optimization (TRPO) reinforcement learning algorithm is adopted, and the reward function of reinforcement learning consists of a balance reward item, a compliance reward item, and a speed reward item. The design of the balance reward item is based on the zero-moment point balance criterion, and the specific reward function is as follows:
[0060] R=0.4r b+0.3r s +0.3r v
[0061] Among them, r b is the balance reward term, r s is a soft bonus item, r v It is a speed bonus item.
[0062] Specifically, balance the reward item r b The expression is as follows:
[0063]
[0064] Among them, (x ZMP ,y ZMP ) is the projection coordinate of the zero moment point ZMP on the horizontal plane, (x CoR ,y CoR ) is the coordinate of the center point of the support region;
[0065] Smooth Bonus s The expression is as follows:
[0066]
[0067] Where f is the interaction force collected from the lower limb exoskeleton rehabilitation robot model during training, in N, and the interaction force threshold is set to 500 N;
[0068] Speed bonus item v The expression is as follows:
[0069]
[0070] Among them, v a It is the real-time speed of the center of mass of the lower limb exoskeleton rehabilitation robot model during training, in m / s, and 1m / s is the set target human body speed value.
[0071] S2.2. Create the state space and action space of the reinforcement learning algorithm.
[0072] The state space of the reinforcement learning algorithm includes the equilibrium state space and the joint state space. The equilibrium state space includes multiple balance-related state information from the lower limb exoskeleton rehabilitation robot model, including: center of mass position, speed, acceleration, center of gravity position, speed; the joint state space includes the real-time position, speed, acceleration information of the knee and hip joints of the lower limb exoskeleton rehabilitation robot model. The action space of the reinforcement learning algorithm is the expected speed value of each joint motor of the robot model in the simulation environment.
[0073] In this embodiment, the state space S is as follows:
[0074] S={Sb ,S j}
[0075] S b is the equilibrium state space, S j Joint state space.
[0076] Equilibrium state space S b The composition is as follows:
[0077]
[0078] Among them, (x ZMP ,y ZMP ) is the coordinate of the zero moment point of the lower limb exoskeleton rehabilitation robot model projected on the horizontal plane, The support domain of the lower limb exoskeleton rehabilitation robot model is equivalent to the coordinates of the four vertices P1, P2, P3, and P4 of the quadrilateral on the horizontal plane. (x CoP ,y CoP ) is the coordinate of the projection of the center of mass CoP of the lower limb exoskeleton rehabilitation robot model on the horizontal plane.
[0079] Joint state space S j The composition is as follows:
[0080] S j = {v i ,a i ,p i}
[0081] v i ,a i ,p i , where i = {1, 2, 3, 4}, respectively representing the real-time velocity, acceleration and position values of the four driving motors of the knee and hip joints of the lower limb exoskeleton rehabilitation robot model.
[0082] In this embodiment, the action space A is specifically constructed as follows:
[0083] A={v1,v2,v3,v4}
[0084] v1, v2, v3, and v4 represent the expected speed values of the four joint motors of the knee and hip joints of both legs of the lower limb exoskeleton rehabilitation robot model.
[0085] S2.3. Determine the structure of the balanced encoding model and action generation model based on the multi-layer perceptron according to the state space and action space, including the network depth, the number of neurons in each layer, and the type of activation function;
[0086] In this embodiment, the balanced coding model is set to be a multi-layer perceptron with 2 hidden layers, the number of neurons in each layer is 128 and 128 respectively, and the activation function is tanh. The action generation model is set to be a neural network with 3 intermediate layers, the number of neurons in each layer is 128, 128 and 16 respectively, and the activation function is tanh. The balanced coding model and the action generation model are connected through a concatenate fully connected layer.
[0087] S2.4. Initialize the weights and bias parameters of the balance encoding model and the action generation model, and initialize the joint positions of the lower limb exoskeleton rehabilitation robot model.
[0088] For convenience, this embodiment uses a random initialization method to initialize the weights and bias parameters of the balanced encoding model and the action generation model, and uses a method of adding random noise to initialize the joint positions of the lower limb exoskeleton rehabilitation robot model.
[0089] S2.5. Adjust the hyperparameters of the reinforcement learning algorithm and train the balanced encoding model and action generation model through the reinforcement learning algorithm.
[0090] In this embodiment, the reinforcement learning algorithm interacts with the simulation environment to form a closed loop, which includes the following steps: obtaining the original state space data of the lower limb exoskeleton rehabilitation robot model from the simulation environment; the original data is processed to obtain the balance state space value and the joint state space value; the balance coding model receives the balance state space value and outputs the balance coding value, the action generation model receives the joint state space value and the balance coding value and outputs the speed expected value of the joint motor of the lower limb exoskeleton rehabilitation robot model; the robot model executes the expected value and updates the state. In this closed loop, each state space value and action space value are added with random noise components, the experience pool of the TRPO algorithm collects the action space value in each cycle step, the state space value after executing the action space value, and the reward value corresponding to the action space value, and calculates the cumulative reward value of the current strategy, and updates the weights and bias parameters of the balance coding model and the action generation model according to the cumulative reward value, until the lower limb exoskeleton rehabilitation robot model walks out of the expected balanced and stable gait.
[0091] In this embodiment, the hyperparameters of the reinforcement learning algorithm are set as follows: the Adam optimizer is used to update the weights and bias parameters of the balanced encoding model and the action generation model, the learning rate is set to 0.001, the maximum step size of a single scene is 800, and the discount factor is 0.995.
[0092] S3, using the action generation model to generate a data set; comprising the following steps:
[0093] S3.1. The trained balance encoding model and action generation model are used as strategies to provide joint motor speed expectations for the lower limb exoskeleton rehabilitation robot model in the simulation environment. The strategy is used to control the lower limb exoskeleton rehabilitation robot model to walk.
[0094] S3.2. During the walking process described in S3.1, 100,000 continuous-time input and output data pairs of the action generation model are collected, wherein the input of the action generation model is composed of the position, velocity and acceleration values of the hip and knee joints of both legs of the lower limb exoskeleton rehabilitation robot model and the output of the balance encoding model corresponding to that moment, and the output of the action generation model is the expected value of the joint motor velocity of the lower limb exoskeleton rehabilitation robot model.
[0095] S4. Establish a balance prediction model and form a gait generation network with the action generation model. Use the above data set to train the gait generation network through imitation learning algorithm. The gait generation network imitation learning training structure is as follows: Figure 3 As shown, the following steps are included:
[0096] S4.1. Determine the structure of the balance prediction model based on the temporal convolutional network, including the number of historical joint information input, convolution form, convolution depth, filter size and activation function;
[0097] In this embodiment, the number of historical features input to the balanced prediction model is N=30, the depth of the temporal convolutional network is 4, the convolution form is a convolutional network that alternates dilated convolution and strided convolution, the filter size is fixed to 3, and there is a relu activation function after each of the first three convolutional layers, and the activation function of the fourth layer is tanh.
[0098] S4.2. Use the concatenate fully connected layer to connect the balance prediction model and the action generation model as the gait generation network.
[0099] S4.3. Determine the loss function of the imitation learning algorithm.
[0100] In an embodiment, the loss function of imitation learning is as follows:
[0101] L=(a u(t+29) -a lt ) 2 +(b u(t+29) -b lt ) 2
[0102] Among them, t represents the serial number corresponding to the feature value in the data set, a u(t+29) and b u(t+29) is the label corresponding to the t-th feature value: the output value of the action generation model in the dataset and the output value of the balanced encoding model, a lt and blt It is the output value of the action generation model in the gait generation network and the output value of the balance prediction model when the tth eigenvalue is input.
[0103] Minimizing this loss function can make the output value of the balance prediction model in the gait generation network imitate the output value of the balance encoding model in the dataset, and the output value of the action generation model in the gait generation network imitate the output value of the action generation model in the dataset.
[0104] S4.4. Based on the collected data set, use the imitation learning algorithm to train the equilibrium prediction model, and update the weight and bias parameters of the equilibrium prediction model according to the imitation learning loss function.
[0105] In this embodiment, in the data set, the tth (1<=t<=99971)th eigenvalue f t Specifically, the joint state space values of the N consecutive lower limb exoskeleton rehabilitation robot model after t {S j(t) , ..., S j(t+29)}; The label value corresponding to the t-th eigenvalue is: the output b of the balanced encoding model at the moment corresponding to the (t+29)-th joint state space value u(t+29) and the output of the action generation model a u(t+29) The t-th eigenvalue is input into the balance prediction model, and then the output of the balance prediction model and the joint state space value of the (t+29)-th lower limb exoskeleton rehabilitation robot model are input into the action generation model, and the action generation model outputs the expected value of the joint motor speed of the lower limb exoskeleton rehabilitation robot model. The outputs of the two models are supervised by imitation using the label value. The imitation learning algorithm updates the weight and bias parameters of the balance prediction model according to the loss function until the loss function is lower than the set threshold. The balance prediction model is trained and the gait generation network is trained.
[0106] S5. The trained gait generation network is used to output the expected speed value of each joint motor of the robot, and combined with the motor servo drive controller to realize the control of the robot; the application structure of the gait generation network is as follows: Figure 4 As shown, the following steps are included:
[0107] S5.1. Build the hardware platform of the lower limb exoskeleton rehabilitation robot, including the connection of hardware communication equipment and the debugging of motors, and establish data communication between the gait generation network and the lower limb exoskeleton rehabilitation robot platform on Matlab.
[0108] S5.2. The gait generation network obtains the joint information of the lower limb exoskeleton rehabilitation robot and outputs the action decision value taken under the joint information. The joint motor executes the action decision value, and the lower limb exoskeleton rehabilitation robot produces a state change and sends the joint information to the gait generation network.
[0109] S5.3 Step S5.2 forms a closed-loop gait cycle, and repeating the cycle enables the lower limb exoskeleton rehabilitation robot to assist the patient in balanced and stable walking.
Claims
1. A control method for a lower limb exoskeleton rehabilitation robot with a balance assisting function, characterized in that: The steps include: S1. Using any physical engine to establish a simulation environment for human-robot interaction, wherein the simulation environment includes a lower limb exoskeleton rehabilitation robot model and an external environment of the lower limb exoskeleton rehabilitation robot; S2. Training the designed balance encoding model and action generation model in a simulation environment is completed by a reinforcement learning algorithm, wherein the reward function includes a balance term; comprising the following steps: S2.
1. Select a reinforcement learning algorithm and design a reward function for the reinforcement learning algorithm. The reward function is as follows: R=0.4r b +0.3r s +0.3r v Among them, r b is the balance reward term, r s is a soft bonus item, r v is a speed bonus item; Specifically, balance the reward item r b The expression is as follows: Among them, (x ZMP ,y ZMP ) is the projection coordinate of the zero moment point ZMP on the horizontal plane, (x CoR ,y CoR ) is the coordinate of the center point of the support region; Smooth Bonus s The expression is as follows: Where f is the interaction force collected from the lower limb exoskeleton rehabilitation robot model during training, in N, and the interaction force threshold is set to 500 N; Speed bonus item v The expression is as follows: Among them, v a It is the real-time speed of the center of mass of the lower limb exoskeleton rehabilitation robot model during training, in m / s, where 1m / s is the target human speed value set; S2.
2. Create the state space and action space of the reinforcement learning algorithm; The state space S is as follows: S={S b ,S j } S b is the equilibrium state space, S j Joint state space; Equilibrium state space S b The composition is as follows: Among them, (x ZMP ,y ZMP ) is the coordinate of the zero moment point of the lower limb exoskeleton rehabilitation robot model projected on the horizontal plane, The support domain of the lower limb exoskeleton rehabilitation robot model is equivalent to the coordinates of the four vertices P1, P2, P3, and P4 of the quadrilateral on the horizontal plane. (x CoP ,y CoP ) is the coordinate of the projection of the center of mass CoP of the lower limb exoskeleton rehabilitation robot model on the horizontal plane; Joint state space S j The composition is as follows: S j ={v i ,a i ,p i } v i ,a i ,p i , where i = {1, 2, 3, 4}, respectively representing the real-time speed, acceleration and position values of the four driving motors of the knee and hip joints of the lower limb exoskeleton rehabilitation robot model; The action space A is specifically composed as follows: A={v1,v2,v3,v4} v1, v2, v3, and v4 represent the expected speed values of the motors at the knee and hip joints of the lower limb exoskeleton rehabilitation robot model; S2.
3. Determine the structure of the balanced encoding model and action generation model based on the multi-layer perceptron according to the state space and action space, including the network depth, the number of neurons in each layer, and the type of activation function; S2.4, initialize the weights and bias parameters of the balance encoding model and the action generation model, and initialize the joint positions of the lower limb exoskeleton rehabilitation robot model; S2.
5. Adjust the hyperparameters of the reinforcement learning algorithm and train the balanced encoding model and action generation model through the reinforcement learning algorithm; The reinforcement learning algorithm interacts with the simulation environment to form a closed loop, which includes the following steps: obtaining the original state space data of the lower limb exoskeleton rehabilitation robot model from the simulation environment; the original data is processed to obtain the balance state space value and the joint state space value; the balance coding model receives the balance state space value and outputs the balance coding value, and the action generation model receives the joint state space value and the balance coding value and outputs the speed expected value of the joint motor of the lower limb exoskeleton rehabilitation robot model; the lower limb exoskeleton rehabilitation robot model executes the expected value and updates the state; S3, generating a data set using an action generation model; S4. Establish a balance prediction model and form a gait generation network with the action generation model. Use the above data set to train the gait generation network through an imitation learning algorithm, including the following steps: S4.
1. Determine the structure of the balance prediction model based on the temporal convolutional network, including the number of historical joint information input, convolution form, convolution depth, filter size and activation function; S4.2, use the concatenate fully connected layer to connect the balance prediction model and the action generation model as the gait generation network; S4.
3. Determine the loss function of the imitation learning algorithm; The loss function of imitation learning is as follows: L=(a u(t+29) -a lt ) 2 +(b u(t+29) -b lt ) 2 Among them, t represents the serial number corresponding to the feature value in the data set, a u(t+29) and b u(t+29) is the label corresponding to the t-th feature value: the output value of the action generation model in the dataset and the output value of the balanced encoding model, a lt and b lt The output value of the action generation model and the output value of the balance prediction model in the gait generation network when the tth feature value is input; the feature of the data set is the joint state space value in the data set, and the label of the feature is the output value and action space value of the balance encoding model corresponding to the joint state space value; S4.
4. Based on the collected data set, the balance prediction model is trained using an imitation learning algorithm, and the weight and bias parameters of the balance prediction model are updated according to the imitation learning loss function; wherein the balance prediction model and the action generation model in the gait generation network are connected through a fully connected layer, and the weight and bias parameters of the balance prediction model are updated using the imitation learning algorithm, so that the output value of the balance prediction model in the gait generation network imitates the output value of the balance encoding model in the data set, and the output value of the action generation model in the gait generation network imitates the output value of the action generation model in the data set. Specifically: The tth input feature of the balance prediction model is the N time-continuous joint state space values after t, where N is the number of historical features of the preset time convolution network input, and the tth input feature of the action generation model is the (t+N-1)th joint state space value and the output value of the balance prediction model; The weight and bias parameters of the balance prediction model are updated using a stochastic gradient descent algorithm, and the step size and direction of the parameter update are determined by the loss function of the stochastic gradient descent algorithm; S5. The trained gait generation network is used to output the expected speed value of each joint motor of the robot, and combined with the motor servo drive controller to realize the control of the robot.
2. The control method of a lower limb exoskeleton rehabilitation robot with a balance assisting function according to claim 1, characterized in that: The use of any physical engine to establish a simulation environment for human-robot interaction is specifically as follows: The simulation environment can provide real-time information related to the knee and hip joint status values and balance status of both legs of the lower limb exoskeleton rehabilitation robot model, including: the position, speed, acceleration of the center of mass, and the position and speed of the center of gravity.
3. The control method of a lower limb exoskeleton rehabilitation robot with a balance assisting function according to claim 1, characterized in that: The training of the designed balance encoding model and action generation model is completed in the simulation environment through the reinforcement learning algorithm, wherein the reward function includes the balance term specifically as follows: The state space of the reinforcement learning algorithm includes an equilibrium state space and a joint state space, and the action space of the reinforcement learning algorithm is the expected speed value of each joint motor of the lower limb exoskeleton rehabilitation robot model in the simulation environment; The input of the lower limb exoskeleton rehabilitation robot model in the simulation environment is the output of the action generation model, that is, the action space value of the reinforcement learning algorithm; the input of the balance coding model is the balance state space value, and the input of the action generation model is the output of the balance coding model and the joint state space value; The weights and bias parameters of the balanced encoding model and the action generation model are updated according to the reward values obtained.
4. The control method of a lower limb exoskeleton rehabilitation robot with a balance assisting function according to claim 3, characterized in that: The state space of the reinforcement learning algorithm includes the equilibrium state space and the joint state space. The action space of the reinforcement learning algorithm is the expected speed value of each joint motor of the lower limb exoskeleton rehabilitation robot model in the simulation environment, which is specifically: The balance state space includes multiple balance-related state information from the lower limb exoskeleton rehabilitation robot model, including: center of mass position, speed, acceleration, center of gravity position, speed; the joint state space includes real-time position, speed, acceleration information of the knee and hip joints of both legs of the lower limb exoskeleton rehabilitation robot model.
5. The control method of a lower limb exoskeleton rehabilitation robot with a balance assisting function according to claim 1, characterized in that: The specific steps of generating a data set using an action generation model are as follows: The data set consists of the input and output of the action generation model, the input of the action generation model is the joint state space value and the output of the balance encoding model at the corresponding moment of the joint state space value, and the output of the action generation model is the action space value corresponding to the joint state space value.
6. The control method of a lower limb exoskeleton rehabilitation robot with a balance assisting function according to claim 1, characterized in that: The trained gait generation network is used to output the expected speed value of each joint motor of the robot, and the control of the robot is realized in combination with the motor servo drive controller as follows: The trained gait generation network interacts with the real lower limb exoskeleton rehabilitation robot system to form a gait closed-loop cycle, which includes inputting the joint state space values of the lower limb exoskeleton rehabilitation robot into the gait generation network, the gait generation network outputting the expected speed values of the motors of each joint of the lower limb exoskeleton rehabilitation robot, the motor servo drive controller executing the expected speed value, and the joint state space values of the lower limb exoskeleton rehabilitation robot being updated. This gait closed-loop cycle enables the lower limb exoskeleton rehabilitation robot to walk in a balanced and stable manner.
