Humanoid robot torque control method based on position ring pre-training

The humanoid robot torque control method based on position loop pre-training solves the problem of low control accuracy in dynamic environments, achieves stable and flexible movement in a variety of environments, and improves the robustness and generalization of robot control. .

CN118809606AActive Publication Date: 2024-10-22HARBIN INST OF TECH

Patent Information

Application Number
CN202411099835.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-10-22
Estimated Expiration
2044-08-12

AI Technical Summary

Technical Problem

Existing humanoid robot control methods are difficult to maintain robustness and versatility in dynamic environments. They lack a unified method and good generalization, resulting in low control accuracy. In addition, methods that directly generate torque through strategies have training convergence problems. It is difficult to achieve flexible movement and stable control in the plane.

Method used

The humanoid robot torque control method based on position loop pre-training is used to construct the position control strategy network and torque control strategy network of the multi-layer perceptron by determining the state space and action space, and using the reward function of the style item, task item and regularization item Train for end-to-end torque control without modeling the robotic system.

Benefits of technology

It achieves stable and flexible movement of humanoid robots in dynamic environments, improves control accuracy and generalization, simplifies parameter adjustment, and enhances the robot's adaptability and stability in various environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118809606A_ABST
    Figure CN118809606A_ABST
Patent Text Reader

Abstract

The invention discloses a humanoid robot torque control method based on position ring pre-training, relates to the humanoid robot torque control method based on position ring pre-training, and belongs to the technical field of humanoid robot motion control. The objective of the invention is to solve the problem that the existing method is difficult to maintain robustness and universality in a dynamic environment in robot control. The method comprises the following steps: determining a state space and an action space according to the structure of the humanoid robot; determining network structures of a position control strategy network, a moment control strategy network and a value network; training related parameters are set; constructing a reward function of the position control strategy network; the reward function is composed of a style item, a task item and a regularization item; obtaining a trained position control strategy network and a moment control strategy network; the current state of the robot is input into the trained torque control strategy network, the trained torque control strategy network outputs torque, and the humanoid robot is controlled in real time according to the torque.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a humanoid robot torque control method based on position loop pre-training, and belongs to the technical field of humanoid robot motion control. Background Art

[0002] In recent years, thanks to the progress of artificial intelligence and robotics, the motion control problem of humanoid robots has once again attracted widespread attention. Traditional robot control algorithms usually rely on precise mathematical models and predefined motion planning, which have been proven to be very effective in the motion tasks of quadrupeds, bipeds and humanoid robots in the past. Notably, Boston Dynamics' Atlas and Spot robots have demonstrated extremely high maneuverability in various demonstrations by using model predictive control (MPC) algorithms, proving the effectiveness of these methods. However, these algorithms rely heavily on accurate modeling of the environment, which can pose significant challenges in terms of robustness and versatility, especially in unknown or dynamically changing environments, where the performance of traditional control algorithms can drop significantly, limiting their effectiveness in a wider range of application scenarios. In addition, this reliance on precise modeling requires a high level of expertise to build and maintain these models, increasing the complexity of development and debugging.

[0003] In contrast, reinforcement learning algorithms can infer the dynamic characteristics of humanoid robots from the interaction with the environment without explicit modeling, thereby achieving more precise motion control. This data-driven approach enables robots to better adapt and perform tasks in complex and dynamic environments, showing greater flexibility and adaptability. Although traditional control methods perform well under specific conditions, their reliance on precise models and limitations in dynamic environments make emerging reinforcement learning methods have important application prospects in the field of future robot control. By combining deep learning and reinforcement learning techniques, robots can autonomously learn and optimize their behavior in diverse and highly uncertain environments, thereby enhancing the breadth and effectiveness of their practical applications. In the study of HRP humanoid robots, Rohan was able to achieve set footprint walking and turning operations through periodic reward items and foothold planning.

[0004] In the above studies, the policy network trained by reinforcement learning is usually used to generate the desired position, and then the PD controller is used to generate torque to interact with the environment. However, in actual deployment, it is often necessary to select different PD parameters for different tasks, which adds additional workload. In addition, there is no unified method for determining the PD gain in reinforcement learning. It is usually determined empirically, which leads to the need to experiment with different PD parameters for different robots, and thus lacks good generalization. The method of generating torque directly from the policy is mainly implemented on quadruped robots, and there are not many solutions applied to bipedal robots. In addition, there is also the problem of difficulty in training convergence when generating torque directly through the policy.

[0005] Therefore, despite the great potential of reinforcement learning in robot control, many challenges still need to be addressed in practical applications, especially in bipedal humanoid robots. Traditional algorithms rely on precise modeling and have difficulty maintaining robustness and versatility in dynamic environments. Reinforcement learning-based methods can improve control accuracy, but existing schemes often require PD parameter adjustment for different tasks, lack a unified method and good generalization. In addition, methods that directly generate torque through strategies have not yet been widely used in bipedal robots, and there are problems with training convergence, making it difficult to achieve flexible motion and stable control in a plane. Summary of the invention

[0006] The purpose of the present invention is to solve the problems that existing methods in robot control are difficult to maintain robustness and versatility in dynamic environments, lack of unified methods and good generalization, and have training convergence problems, making it difficult to achieve flexible movement and stable control in a plane, resulting in low control accuracy of humanoid robots. A humanoid robot torque control method based on position loop pre-training is proposed.

[0007] A humanoid robot torque control method based on position loop pre-training. The specific process is as follows:

[0008] Step 1: Determine the state space and action space according to the structure of the humanoid robot;

[0009] Step 2: Determine the position control strategy network Torque Control Strategy Network and value network V Φ The network structure;

[0010] Position Control Strategy Network Torque Control Strategy Network and value network V Φ All are multi-layer perceptrons;

[0011] Where θ and φ are the network parameters of the position control strategy network and the torque control strategy network, respectively, and Φ is the network parameter of the value network;

[0012] Step 3: Set training related parameters;

[0013] Step 4: Construct the reward function for position control strategy network training and formal training;

[0014] The position control strategy network training and formal training use the same reward function, which consists of three parts: style term, task term, and regularization term.

[0015] Step 5: Based on steps 1, 2, 3, and 4, a trained position control strategy network is obtained;

[0016] Step 6: Based on the trained position control strategy network, a trained torque control strategy network is obtained;

[0017] Step 7: Input the current state of the robot into the trained torque control strategy network. The trained torque control strategy network outputs the torque, and the humanoid robot is controlled in real time according to the torque.

[0018] The beneficial effects of the present invention are:

[0019] The present invention aims at the walking and running problem of humanoid robots, adopts an end-to-end control method based on model-free deep reinforcement learning, directly generates torque control strategy through system state quantity, and does not need to model complex humanoid robot system, so as to realize stable dynamic movement of humanoid robots in human-like posture; through course learning, the trained strategy network can not only efficiently control robot movement, but also has good generalization, so that the same network can be directly transferred to different humanoid robots, and good results can be achieved without additional parameter adjustment. This method maintains robustness and versatility in dynamic environment, does not have training convergence problem, realizes flexible movement and stable control in plane, and improves the low control accuracy of humanoid robots.

[0020] In view of the difficulty in training the torque control strategy network, the present invention proposes a pre-training method for the acceleration torque control strategy based on the position control strategy. The method uses the position control strategy network that is easy to train to collect data under different initial states and disturbance conditions for pre-training the torque control strategy network. In this way, the torque control strategy network can realize the basic function of the robot standing, solve the problem of training convergence, and lay the foundation for realizing flexible movement and stable control in the plane, and further training the robot to realize more complex dynamic movements. This method not only improves the training efficiency, but also enhances the adaptability and stability of the robot in a variety of environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a flow chart of the present invention;

[0022] Figure 2 A flowchart of the position control network training process constructed for the present invention;

[0023] Figure 3 A flowchart of the torque control network training process constructed for the present invention;

[0024] Figure 4 is a schematic diagram of the reference action and its corresponding phase indicator used in the present invention, Indicates the ground reaction force of the robot's left foot or the ground reaction force of the robot's right foot; Indicates the speed of the robot's left foot or the robot's right foot;

[0025] Figure 5 This is an ablation experiment diagram for pre-training;

[0026] Figure 6 is the gait diagram of the robot when the policy network is running, a is the gait of the torque control network when walking, b is the gait of the torque control network when running, and c is the gait of the position control network when walking without adjusting the PD parameters. DETAILED DESCRIPTION

[0027] Specific implementation method 1: Combination Figure 1 This embodiment is described. The specific process of this embodiment is a humanoid robot torque control method based on position loop pre-training:

[0028] Step 1: Determine the state space and action space of the reinforcement learning control strategy according to the structure of the humanoid robot;

[0029] The present invention constructs a simulation environment on the Mujoco simulation platform, takes a humanoid robot as a control object, and performs dynamic tasks such as walking and running;

[0030] Step 2: Determine the position control strategy network Torque Control Strategy Network and value network V Φ The network structure;

[0031] Position Control Strategy Network Torque Control Strategy Network and value network V Φ All are multi-layer perceptrons (MLP);

[0032] Where θ and φ are the network parameters of the position control strategy network and the torque control strategy network, respectively, and Φ is the network parameter of the value network;

[0033] The position control strategy network is used to generate the desired position;

[0034] The value network is used to estimate the expected reward of a state or state-action pair;

[0035] The torque control strategy network is used to generate the desired torque;

[0036] Step 3: Set training related parameters;

[0037] Step 4: Construct the reward function for position control strategy network training and formal training;

[0038] The position control strategy network training and formal training use the same reward function, which consists of three parts: style term, task term, and regularization term.

[0039] The main purpose of the style item is to enable the robot to imitate the provided reference action and perform actions of similar style. In the imitation process, special emphasis is placed on the importance of contact information and accurate tracking of the end effector. This approach not only ensures that the appearance and style of the robot's action are highly consistent with the reference action, but also fully considers the details of the interaction between the action and the environment, such as the contact pattern between the foot and the ground during gait. The reference action and the contact information it contains are detailed in Figure 4 .

[0040] The task item guides the robot to walk at the target speed.

[0041] The introduction of regularization terms is to ensure the smoothness of the action, enhance energy efficiency, and provide a guarantee for the migration of the algorithm from simulation to the actual system.

[0042] Step 5: Based on steps 1, 2, 3, and 4, a trained position control strategy network is obtained;

[0043] Step 6: Based on the trained position control strategy network, a trained torque control strategy network is obtained;

[0044] Step 7: Input the current state of the robot into the trained torque control strategy network. The trained torque control strategy network outputs the torque, and the humanoid robot is controlled in real time according to the torque.

[0045] Specific implementation method 2: This implementation method is different from specific implementation method 1 in that in step 1, the state space and action space of the reinforcement learning control strategy are determined according to the structure of the humanoid robot;

[0046] The specific process is:

[0047] The humanoid robot’s lower limbs have 12 degrees of freedom;

[0048] The hip joint of each leg of the humanoid robot has three degrees of freedom, the knee joint has one degree of freedom, and the ankle joint has two degrees of freedom;

[0049] The hip joint has three degrees of freedom: pitch, roll, and yaw;

[0050] The knee joint has one degree of freedom: pitch freedom;

[0051] The ankle joint has two degrees of freedom: roll and pitch.

[0052] To ensure that the control strategy can effectively capture sufficient environmental information, the state space is defined as:

[0053] Among them, q base Represents the orientation of the robot base, expressed in the form of a quaternion; ω base Represents the angle of the robot base

[0054] Speed; q m Represents the position of the robot's hip, knee, and ankle joints (corresponding to 12 degrees of freedom); represents the robot's hip, knee, and ankle joint speeds; v task represents the task vector, i.e. the expected motion speed of the robot; t represents time; these information constitute a comprehensive observation vector to support the robot's decision-making and motion control in the simulation environment;

[0055] The action space is divided into two forms: one is the position control action of the joint [a m ], and the other is the torque control action of the joint [τ m ].

[0056] The other steps and parameters are the same as those in the first embodiment.

[0057] Specific implementation method three: This implementation method is different from specific implementation methods one or two in that the training-related parameters are set in step three; the specific process is:

[0058] The number of position control strategy network training times is T pos , the number of pre-training is T pre , the number of formal training is T main ;

[0059] The formal training consists of two phases. The number of training times in the first phase is T1, and the number of training times in the second phase is T2.

[0060] Both T1 and T2 are half of the formal training times;

[0061] The PPO algorithm is used to implement reinforcement learning training, and the hyperparameters are:

[0062] Discount factor γ: calculates the current value of future rewards; learning rate η: controls the step size of weight updates; clipping coefficient ∈: used to limit the amplitude of policy updates to avoid excessive update steps; coefficient c1 of the value function: the coefficient of the value function loss term in the total loss; entropy coefficient c2: the coefficient that increases the policy entropy in the total loss to encourage exploration; GAE (Generalized Advantage Estimation) parameter λ: used to balance TD error and Monte Carlo estimation;

[0063] The length of each episode of the task: an episode refers to the process from the beginning to the end of the task, and the maximum number of steps contained in each episode is called its length; Batch size: defines the number of samples used each time the network is updated; Buffer size; Epochs: the number of times the model will use the entire collected training set to repeat learning.

[0064] In this embodiment, the number of training steps of the position control strategy network is T pos =5000, the number of pre-training steps is T pre =5000, the number of formal training steps is T main =20000. The formal training consists of two stages. The number of steps in the first stage is half of the formal training steps T1 = 10000, and the number of steps in the second stage is T2 = 10000. Discount factor γ = 0.99, learning rate η = 0.0001, clipping coefficient ∈ = 0.2, coefficient of value function c1 = 0.5, entropy coefficient c2 = 0.05, GAE parameter λ = 0.95, total number of training iterations, length of each task scene 400, batch size 64, buffer size 12000, epochs 3.

[0065] The other steps and parameters are the same as those in the first or second embodiment.

[0066] Specific implementation method 4: This implementation method is different from any one of specific implementation methods 1 to 3 in that the reward function for the position control strategy network training and formal training is constructed in step 4;

[0067] The position control strategy network training uses the same reward function as the formal training, and the reward function consists of three parts: style term, task term, and regularization term (added together);

[0068] The main purpose of the style item is to enable the robot to imitate the provided reference action and perform actions of similar style. In the imitation process, special emphasis is placed on the importance of contact information and accurate tracking of the end effector. This approach not only ensures that the appearance and style of the robot's action are highly consistent with the reference action, but also fully considers the details of the interaction between the action and the environment, such as the contact pattern between the foot and the ground during gait. The reference action and the contact information it contains are detailed in Figure 4 .

[0069] The task item guides the robot to walk at the target speed.

[0070] The introduction of regularization terms is to ensure the smoothness of the action, enhance energy efficiency, and provide a guarantee for the migration of the algorithm from simulation to the actual system.

[0071] The specific process is:

[0072] Step 41: Obtain style items, including robot base style bonus items Style bonus for robot joint positions Ground Reaction Force Bonus Reward for Speed End Effector Tracking Rewards

[0073] Step 42: Get the task item

[0074] Step 43: Obtain regularization terms, including action regularization terms Moment regularization term and the moment change regularization term

[0075] The introduction of regularization terms is to ensure the smoothness of the action, enhance energy efficiency, and provide a guarantee for the migration of the algorithm from simulation to the actual system.

[0076] The parameters of each reward function are shown in the following table:

[0077]

[0078] The other steps and parameters are the same as those in Specific Embodiments 1 to 3.

[0079] Specific implementation method 5: This implementation method is different from specific implementation methods 1 to 4 in that the style item is obtained in step 41, and the style item includes the robot base style reward item. Style bonus for robot joint positions Ground Reaction Force Bonus Reward for Speed End Effector Tracking Rewards

[0080] The specific process is:

[0081] Step 4: Obtain the Robot Base Style Bonus Style bonus for robot joint positions

[0082] The specific process is:

[0083] The imitation reward guides the robot to keep the base orientation, joint angle, contact state, and end position state consistent with the reference action;

[0084] The robot is encouraged to keep the base orientation consistent with the reference action at each time step, represented by a quaternion; in actual use, this part of the reward will gradually be replaced by the orientation of the desired direction of motion.

[0085] The robot is encouraged to match the joint positions in the reference motion at each time step, with the error measured by the 2-norm;

[0086]

[0087] in Represents the robot base style bonus item, The style bonus term representing the robot joint positions, and q base,t They are respectively represented as the direction of the reference action and the actual joint direction at time t; and q m,t They are respectively represented as the joint position of the reference action and the actual joint position at time t; ω b represents the weight corresponding to the robot base, ω q represents the corresponding weight of the joint position, · represents the multiplication sign, represents the square of the two norm;

[0088] Step 4-2: Get the ground reaction force reward and speed rewards

[0089] The specific process is:

[0090] There are two types of contact between the robot and the ground:

[0091] 1) Double-foot contact phase DS, that is, the state where both feet are in contact with the ground at the same time;

[0092] 2) Single-foot support phase SS, where one foot is in contact with the ground to provide support, and the other foot is suspended and swung;

[0093] The symmetrical bipedal gait is defined by the periodic motion of the legs, and the reference motion library contains contact information for three motions: standing, walking, and running;

[0094] When performing the standing action, the robot is always in the DS stage;

[0095] When performing walking actions, the robot will alternate between the DS phase and the SS phase;

[0096] When running, the robot will alternate between the SS phase and the floating phase (i.e., not in contact with the ground); set the phase indicator, which is the phase indicator of the ground reaction force of the robot's left foot Robot right foot ground reaction force phase indicator Robot left foot speed phase indicator and robot right foot speed phase indicator

[0097] The phase indicator designs for walking and running are as follows: Figure 4 As shown; these phase indicators are responsible for adjusting the ground reaction force of the supporting leg and the speed of the swinging leg respectively; the value of the phase indicator is related to the stage and action.

[0098] For the DS phase in standing and walking movements, and

[0099] For running movements, and

[0100] For the SS phase in walking and running, the phase indicator values ​​remain the same. For the left foot as the supporting foot SS (left), and For the right foot, make the supporting foot SS (left). and

[0101] Ground reaction force phase indicator based on the robot's left foot Robot right foot ground reaction force phase indicator Robot left foot speed phase indicator and robot right foot speed phase indicator Get bonus for ground reaction force and speed rewards The expression is:

[0102]

[0103] Among them, F leftand F right is the normalized ground reaction force, S left and S right is the normalized velocity;

[0104] The ground reaction force phase indicator is obtained from the phase φ value during the gait cycle. and speed phase indicator The value of , and then calculate the value of the reward function;

[0105] is the bonus of ground reaction force, · is the multiplication sign, Reward for speed;

[0106] Step 4-3: Get the end effector tracking reward The specific process is:

[0107] End Effector Tracking Bonus This item ensures accurate tracking of the end effector by penalizing the difference between the actual position of the end effector and the reference position. This reward form uses an exponential function to calculate the negative exponent of the square of the position error, with the aim of encouraging the position of the end effector to be as close to its reference position as possible. The smaller the error, the larger the reward value, which helps to improve the tracking accuracy of the robot end effector and the accuracy of operation.

[0108] End Effector Tracking Rewards Defined as:

[0109]

[0110] in, represents the reference position of the end effector at time t, p e,t represents the actual position, ω e Represents the weight corresponding to the end effector position.

[0111] The other steps and parameters are the same as those in Specific Embodiments 1 to 4.

[0112] Specific implementation method 6: This implementation method is different from the specific implementation methods 1 to 5 in that the task item is obtained in step 42. The specific process is:

[0113] Task Item Defined as:

[0114]

[0115] in is the target velocity, v t is the current base speed, ω v Represents the weight corresponding to the speed;

[0116] The task item guides the robot to walk at the target speed.

[0117] The other steps and parameters are the same as those in Specific Implementations 1 to 5.

[0118] Specific implementation method 7: This implementation method is different from one of the specific implementation methods 1 to 6 in that the regularization term is obtained in step 43, and the regularization term includes the action regularization term Moment regularization term and the moment change regularization term

[0119]

[0120] The introduction of regularization terms is to ensure the smoothness of the action, enhance energy efficiency, and provide a guarantee for the migration of the algorithm from simulation to the actual system.

[0121] The specific process is:

[0122] 1) Action regularization term Defined as:

[0123]

[0124] Among them, a represents the current action, a prev Represents the action at the previous moment, ω a is the weight of the action regularization term;

[0125] Action Regularization Term The consistency and smoothness of the action are ensured by penalizing the differences between consecutive actions. This form of reward encourages small changes in action, reduces mutations when the robot moves, and helps improve the consistency of the robot's actions.

[0126] 2) Moment regularization term Defined as:

[0127]

[0128] Where τ represents the joint torque, ω τ is the weight of the moment regularization term used to adjust the influence of the moment size;

[0129] To improve energy efficiency, this option penalizes large joint torque values. This reward mechanism favors less-effortful movements, reducing unnecessary energy consumption while avoiding excessive stress on the robot's joints.

[0130] 3) Moment change regularization term Defined as:

[0131]

[0132] Among them, τ prev refers to the joint torque at the previous moment, ω Δτ is the weight of the moment change regularization term.

[0133] This term focuses on minimizing the rate of change of joint torques, thus making the robot move more smoothly. By reducing the sharp changes in torque, this regularization term helps prevent damage to the robot or the environment caused by sudden torque changes.

[0134] The other steps and parameters are the same as those in Specific Embodiments 1 to 6.

[0135] Specific implementation eight: This implementation differs from any one of specific implementations one to seven in that, in step five, a trained position control strategy network is obtained based on steps one, two, three, and four;

[0136] The specific process is:

[0137] Step 51: Set the training steps of the position control strategy network to T, T = T pos ;

[0138] The reward function of the position control strategy network is the reward function constructed in step 4;

[0139] Initialize the position control strategy network Value Network V Φ The network parameters (weights and biases of the network structure MLP, not hyperparameters);

[0140] Step 52: Reset the training environment (environment refers to the external system or world that the agent (robot) interacts with), and set the robot and environment to their initial state;

[0141] The initial state refers not only to the state of the robot, but also to the state setting of the entire environment; at the beginning of training, both the agent and the environment need to be set to the initial state, including placing the robot in a specific position and posture, and initializing other state variables in the environment. This process ensures that the robot can learn and adapt to various tasks under consistent conditions.

[0142] At this time, the reference action performed by the robot is standing;

[0143] Step 53: Get the robot's current state s from the environment t ;

[0144] Step 54: s t and the task vector v task After merging the time vector t, we get the observation vector o t Post-input position control strategy network Position control strategy network output action a t ; The action generates torque τ after passing through the PD controller cmd ;

[0145] Based on the moment τ cmd Control the robot to move and calculate the robot reward r t ;

[0146] The expression of PD controller is:

[0147]

[0148] where τ cmd is the torque output by the controller, K p is the proportional gain, which indicates the response strength of the controller to the position error, a t is the action, q is the current joint position, K d is the differential gain, which indicates the response strength of the controller to the speed error, is the current joint velocity;

[0149] o t Input value network, value network output current state value V(o t );

[0150] (o t ,a t ,r t ,V(o t )) is stored in the buffer and enters the next state s t+1 ;

[0151] The parameters of the PD controller used by each joint are shown in the following table

[0152]

[0153] Step 55: Determine whether the current scene task is finished, that is, determine whether the number of steps reaches the length of the current scene or triggers the condition of early termination; the condition of early termination is self-collision during the movement or the height of the root joint is too low (this situation is regarded as falling) (hyperparameters set in step 3);

[0154] If the task of the current scene is not completed, use the state s t+1 Return to step 54;

[0155] If the task of the current scene is completed, the position control strategy network is updated to obtain the pre-trained position control strategy network and value network; execute steps five and six;

[0156] The process of updating the position control strategy network to obtain the pre-trained position control strategy network and value network is as follows:

[0157] First, the data in the buffer is batch processed, the process is:

[0158] Split the data in the buffer into Batch data,

[0159] Each batch of data in the buffer is used as a training set and sequentially input into the position control strategy network for training until all batches of data are input into the position control strategy network to obtain a pre-trained position control strategy network;

[0160] Each batch of data in the buffer is used as a training set and sequentially input into the value network for training until all batches of data are input into the value network to obtain a pre-trained value network;

[0161] Step 56: Determine whether the set number of training steps T has been reached;

[0162] If the set number of training steps is reached, the final trained position control strategy network and the trained value network are obtained, and step 6 is executed;

[0163] If the set number of training steps is not reached, return to step 52.

[0164] The other steps and parameters are the same as those in Specific Embodiments 1 to 7.

[0165] Specific implementation method 9: This implementation method is different from any one of specific implementation methods 1 to 8 in that, in step 6, a trained torque control strategy network is obtained based on a trained position control strategy network;

[0166] The main content of the following steps is to use the trained position control strategy network to train the torque control strategy network; the training process refers to Figure 3 .

[0167] The specific process is:

[0168] Step 6.1: Set the torque control strategy network training step number T to the pre-training step number T pre , T=T pre ;

[0169] Initialize the torque control strategy network The network parameters (weights and biases of the network structure MLP, not hyperparameters);

[0170] Step 62: Reset the training environment and inject disturbance into the initial state;

[0171] Add uniformly distributed random perturbations to the robot's initial position and velocity to ensure the robustness and generalization of the training process; simulate training environments under a variety of initial conditions by generating random perturbations and superimposing them on the initial state;

[0172] Step 63: Get status s from the environment t , will s t and the task vector v task After merging the time vector t, we get the observation vector o t Then input the torque control strategy network and the trained position control strategy network

[0173] Trained position control strategy network Output action a t , action a t After passing through the PD controller, the torque τ is generated d ;

[0174] Torque Control Strategy Network Output torque τ;

[0175] Step 64: Calculate τ and τ through MSE loss function d The loss between τ and τ is minimized by d The loss between the torque control strategy network is updated Parameters;

[0176] By minimizing τ and τ d The loss between them enables the torque control strategy network to better learn and simulate the behavior of the PD controller;

[0177] Step 65: According to the moment τ d Control the robot to move and enter the next state s t+1 ;

[0178] In the new state, the corresponding torque is continued to be generated through the position control strategy network and the torque control strategy network to maintain the coherence and continuity of the training process;

[0179] Step 66: Determine the current torque control strategy network Whether the training reaches the pre-training step number T pre ;

[0180] If the number of pre-training steps T is not reached pre , return to step 62 and continue training;

[0181] If the number of pre-training steps T is reached pre , get the pre-trained torque control strategy network, and execute steps six and seven;

[0182] Step 67: Network the torque control strategy The number of training steps is set to the total number of steps T in the formal training phase main ;

[0183] Step 68: Reset the training environment and determine the expected speed according to the training stage;

[0184] The first stage: the speed corresponding to the reference action is taken as the expected speed, that is, the task vector v task (i.e. the expected movement speed of the robot);

[0185] For example, the expected speed for a walking task is 0.3m / s to 0.4m / s; the expected speed for a running task is 0.8m / s to 1m / s;

[0186] The second stage: extract a speed from the low speed range as the expected speed v l That is, the task vector v task Or extract a speed from the high-speed section as the expected speed v h That is, the task vector v task ;

[0187] The low speed range is [0.2, 1] m / s; the high speed range is [1, 3] m / s;

[0188] The second stage: The initial speed of the robot is 0, and the expected speed v is given first l , the robot maintains the specified time and then sets the desired speed to v h , after maintaining the same time, finally reduce the expected speed to 0 according to the set acceleration;

[0189] In the second stage, the reference action is selected according to the expected speed. When the expected speed is 0, the reference action is standing; when the expected speed is between [0.2, 0.8] m / s, the reference action is walking; when the expected speed is between [1.2, 3] m / s, the reference action is running; there is no reference action in the unspecified speed range. This method is used to learn the smooth transition between different movements;

[0190] Step 69: Get the current status s t , will s t and the task vector v task After merging the time vector t, we get the observation vector o t Then input the pre-trained torque control strategy network, and the pre-trained torque control strategy network outputs the torque τ t ;

[0191] According to the moment τ t Control the robot to move and calculate the reward r t ;

[0192] o t Input the value network trained in step 5, and the value network outputs the current state value V(o t );

[0193] (o t ,τ t ,r t ,V(o t )) is stored in the buffer and enters the next state s t+1 ;

[0194] Step 60: Determine whether the current task is finished, that is, determine whether the number of steps reaches the length of the current task or triggers the early termination condition. The early termination condition includes self-collision during the movement or the root joint height is too low (considered as falling) (hyperparameters set in step 3);

[0195] If the task of the current scene is not completed, use the state s t+1 Return to step sixty-nine;

[0196] If the task of the current scene is completed, the torque control strategy network is updated (the data in the buffer updates the torque control strategy network), and step 61 is executed;

[0197] Step 61: Determine whether the number of training steps is less than the number of steps T1 in the first stage;

[0198] If it is less than T1, execute step 68. The first stage plan obtains the task vector v task And adopt the reward function weight corresponding to the first stage;

[0199] If it is greater than or equal to T1, execute the second stage plan to obtain the task vector v task And adopt the reward function weight corresponding to the second stage;

[0200] If the set number of training steps T is reached main , then the final trained torque control strategy network and parameters are obtained; if the set number of training steps T is not reached main , then return to step six eight.

[0201] The other steps and parameters are the same as those in Specific Embodiments 1 to 8.

[0202] Specific implementation method 10: This implementation method is different from the specific implementation methods 1 to 9 in that if T1 is less than step 61, the first stage solution of step 68 is executed to obtain the task vector v task And adopt the reward function weight corresponding to the first stage; the specific process is:

[0203] The corresponding weight is 0.05, The corresponding weight is 0.35, The corresponding weight is 0.15, The corresponding weight is 0.15, The corresponding weight is 0.1, The corresponding weight is 0.15, The corresponding weight is 0.05, The corresponding weight is 0. The corresponding weight is 0;

[0204] If it is greater than or equal to T1, execute the second stage plan to obtain the task vector v task And adopt the reward function weight corresponding to the second stage; specifically:

[0205] The corresponding weight is 0.05, The corresponding weight is 0.15, The corresponding weight is 0.1, The corresponding weight is 0.1, The corresponding weight is 0.1, The corresponding weight is 0.35, The corresponding weight is 0.05, The corresponding weight is 0.05, The corresponding weight is 0.05.

[0206] The reward function weights for the two stages are set as shown in the following table. By adjusting the weights of the reward function, the learning objectives for different stages are specified.

[0207] The reward function weight changes are shown in the following table:

[0208]

[0209]

[0210] The first stage mainly imitates the reference action and focuses on learning the action style, so the style item has a higher weight. The second stage takes completing the task indicators as the primary goal, so the weight of the reward related to the style item is reduced and the weight of the reward related to the task item is increased.

[0211] The other steps and parameters are the same as those in Specific Embodiments 1 to 9.

[0212] Example:

[0213] In the embodiment of the present invention, we use the MuJoCo simulation environment to train and test the proposed method.

[0214] In order to verify the effect of the pre-training method based on the position control strategy and the acceleration torque control strategy, we designed and conducted an ablation experiment. Figure 5 The experimental results are shown, where the blue line represents the survival time of each round and the green line represents the sum of the average rewards. The figure above shows the case of directly training the torque control strategy network without pre-training. The robot can only survive 100 time steps and the maximum reward is only 60. This shows that without the support of the pre-training stage, the torque control strategy network cannot be successfully trained. After pre-training (as shown in the figure below), the robot's survival time basically reaches the upper limit (400 time steps), and the maximum reward is about 310, which significantly improves the training effect.

[0215] Figure 6 The effect of the torque control strategy network in performing actions such as walking and running, as well as the running performance after deployment on different robots, are demonstrated. The comparison shows that when the appropriate PD parameters are not set, the robot's posture is obviously unstable and cannot walk along the preset straight line trajectory, further highlighting the advantage of using the torque control strategy network. In this way, the torque control strategy network can achieve stable dynamic motion on different types of robots, verifying the effectiveness and applicability of the method of the present invention.

[0216] The present invention may also have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may make various corresponding changes and modifications based on the present invention, but these corresponding changes and modifications should all fall within the scope of protection of the claims attached to the present invention.

Claims

1. A humanoid robot torque control method based on position loop pre-training, characterized in that: The specific process of the method is: Step 1: Determine the state space and action space according to the structure of the humanoid robot; Step 2: Determine the position control strategy network Torque Control Strategy Network and value network V Φ The network structure; Position Control Strategy Network Torque Control Strategy Network and value network V Φ All are multi-layer perceptrons; Where θ and φ are the network parameters of the position control strategy network and the torque control strategy network, respectively, and Φ is the network parameter of the value network; Step 3: Set training related parameters; Step 4: Construct the reward function for position control strategy network training and formal training; The position control strategy network training and formal training use the same reward function, which consists of three parts: style term, task term, and regularization term. Step 5: Based on steps 1, 2, 3, and 4, a trained position control strategy network is obtained; Step 6: Based on the trained position control strategy network, a trained torque control strategy network is obtained; Step 7: Input the current state of the robot into the trained torque control strategy network. The trained torque control strategy network outputs the torque, and the humanoid robot is controlled in real time according to the torque.

2. A humanoid robot torque control method based on position loop pre-training according to claim 1, characterized in that: In the step 1, the state space and the action space are determined according to the structure of the humanoid robot; The specific process is: The humanoid robot’s lower limbs have 12 degrees of freedom; The hip joint of each leg of the humanoid robot has three degrees of freedom, the knee joint has one degree of freedom, and the ankle joint has two degrees of freedom. The hip joint has three degrees of freedom: pitch, roll, and yaw; The knee joint has one degree of freedom: pitch freedom; The ankle joint has two degrees of freedom: roll and pitch. The state space is defined as: Among them, q base Represents the orientation of the robot base; ω base represents the angular velocity of the robot base; q m Represents the position of the robot's hip, knee, and ankle joints; represents the robot's hip, knee, and ankle joint speeds; v task represents the task vector, i.e. the expected movement speed of the robot; t represents time; The action space is divided into two forms: one is the position control action of the joint [a m ], and the other is the torque control action of the joint [τ m ].

3. A humanoid robot torque control method based on position loop pre-training according to claim 2, characterized in that: In step 3, the training related parameters are set; the specific process is: The number of position control strategy network training times is T pos , the number of pre-training is T pre , the number of formal training is T main ; The formal training consists of two phases. The number of training sessions in the first phase is T1, and the number of training sessions in the second phase is T2. Both T1 and T2 are half of the formal training times; The hyperparameters are: Discount factor γ; learning rate η; Clipping coefficient ∈; coefficient of the value function c1; entropy coefficient c2; GAE parameter λ; The length of each task episode; batch size; buffer capacity; number of training epochs.

4. The method for controlling torque of a humanoid robot based on position loop pre-training according to claim 3, characterized in that: In the step 4, a reward function for position control strategy network training and formal training is constructed; The position control strategy network training and formal training use the same reward function, which consists of three parts: style term, task term, and regularization term. The specific process is: Step 41: Obtain style items, including robot base style bonus items Style bonus for robot joint positions Ground Reaction Force Bonus Reward for Speed End Effector Tracking Rewards Step 42: Get the task item Step 43: Obtain regularization terms, including action regularization terms Moment regularization term and the moment change regularization term 5. The method for controlling torque of a humanoid robot based on position loop pre-training according to claim 4, characterized in that: The style item is obtained in step 41, and the style item includes the robot base style reward item Style bonus for robot joint positions Ground Reaction Force Bonus Reward for Speed End Effector Tracking Rewards The specific process is: Step 4: Obtain the Robot Base Style Bonus Style bonus for robot joint positions The specific process is: in Represents the robot base style bonus item, The style bonus term representing the robot joint positions, and q base,t They are respectively represented as the direction of the reference action and the actual joint direction at time t; and q m,t They are respectively represented as the joint position of the reference action at time t and the actual joint position; ω b represents the weight corresponding to the robot base, ω q represents the corresponding weight of the joint position, · represents the multiplication sign, represents the square of the two norm; Step 4-2: Get the ground reaction force reward and speed rewards The specific process is: There are two types of contact between the robot and the ground: 1) Double-foot contact phase DS, that is, the state where both feet are in contact with the ground at the same time; 2) Single-foot support phase SS, where one foot is in contact with the ground to provide support, and the other foot is suspended and swung; When performing the standing action, the robot is always in the DS stage; When performing walking actions, the robot will alternate between the DS phase and the SS phase; When performing the running action, the robot will alternate between the SS phase and the floating phase; Set the phase indicator, which is the ground reaction force phase indicator of the robot's left foot Robot right foot ground reaction force phase indicator Robot left foot speed phase indicator and robot right foot speed phase indicator For the DS phase in standing and walking movements, and For running movements, and For the SS phase of walking and running, the left foot is used as the supporting foot SS (left). and For the right foot, make the supporting foot SS (left). and Ground reaction force phase indicator based on the robot's left foot Robot right foot ground reaction force phase indicator Robot left foot speed phase indicator and robot right foot speed phase indicator Get bonus for ground reaction force and speed rewards The expression is: Among them, F left and F right is the normalized ground reaction force, S left and S right is the normalized velocity; is the bonus of ground reaction force, · is the multiplication sign, Reward for speed; Step 4-3: Get the end effector tracking reward The specific process is: End Effector Tracking Rewards Defined as: in, represents the reference position of the end effector at time t, p e,t represents the actual position, ω e Represents the weight corresponding to the end effector position.

6. A humanoid robot torque control method based on position loop pre-training according to claim 5, characterized in that: Obtain the task item in step 42 The specific process is: Task Item Defined as: in is the target velocity, v t is the current base speed, ω v Represents the weight corresponding to the speed.

7. A humanoid robot torque control method based on position loop pre-training according to claim 6, characterized in that: In step 43, a regularization term is obtained, and the regularization term includes an action regularization term Moment regularization term and the moment change regularization term The specific process is: 1) Action regularization term Defined as: Among them, a represents the current action, a prev Represents the action at the previous moment, ω a is the weight of the action regularization term; 2) Moment regularization term Defined as: Where τ represents the joint torque, ω τ is the weight of the moment regularization term; 3) Moment change regularization term Defined as: Among them, τ prev refers to the joint torque at the previous moment, ω Δτ is the weight of the moment change regularization term.

8. The method for controlling torque of a humanoid robot based on position loop pre-training according to claim 7, characterized in that: In the step 5, based on steps 1, 2, 3 and 4, a trained position control strategy network is obtained; The specific process is: Step 51: Set the training steps of the position control strategy network to T, T = T pos ; The reward function of the position control strategy network is the reward function constructed in step 4; Initialize the position control strategy network Value Network V Φ Network parameters; Step 52: Reset the training environment and set the robot and environment to the initial state; Step 53: Get the robot's current state s from the environment t ; Step 54: s t and the task vector v task After merging the time vector t, we get the observation vector o t Post-input position control strategy network Position control strategy network output action a t ; The action generates torque τ after passing through the PD controller cmd ; Based on the moment τ cmd Control the robot to move and calculate the robot reward r t ; The expression of PD controller is: where τ cmd is the torque output by the controller, K p is the proportional gain, a t is the action, q is the current joint position, K d is the differential gain, is the current joint velocity; o t Input value network, value network output current state value V(o t ); (o t ,a t ,r t ,V(o t )) is stored in the buffer and enters the next state s t+1 ; Step 55: Determine whether the current task is completed; If the task of the current scene is not completed, use the state s t+1 Return to step 54; If the task of the current scene is completed, the position control strategy network is updated to obtain the pre-trained position control strategy network and value network; execute steps five and six; The process of updating the position control strategy network to obtain the pre-trained position control strategy network and value network is as follows: Split the data in the buffer into Batch data, Each batch of data in the buffer is used as a training set and sequentially input into the position control strategy network for training until all batches of data are input into the position control strategy network to obtain a pre-trained position control strategy network; Each batch of data in the buffer is used as a training set and sequentially input into the value network for training until all batches of data are input into the value network to obtain a pre-trained value network; Step 56: Determine whether the set number of training steps T has been reached; If the set number of training steps is reached, the final trained position control strategy network and the trained value network are obtained, and step 6 is executed; If the set number of training steps is not reached, return to step 52.

9. The humanoid robot torque control method based on position loop pre-training according to claim 8, characterized in that: In the step 6, based on the trained position control strategy network, a trained torque control strategy network is obtained; The specific process is: Step 6.1: Set the torque control strategy network training step number T to the pre-training step number T pre , T=T pre ; Initialize the torque control strategy network Network parameters; Step 62: Reset the training environment and inject disturbance into the initial state; Step 63: Get status s from the environment t , will s t and the task vector v task After merging the time vector t, we get the observation vector o t Then input the torque control strategy network and the trained position control strategy network Trained position control strategy network Output action a t , action a t After passing through the PD controller, the torque τ is generated d ; Torque Control Strategy Network Output torque τ; Step 64: Calculate τ and τ through MSE loss function d The loss between τ and τ is minimized by d The loss between the torque control strategy network is updated Parameters; Step 65: According to the moment τ d Control the robot to move and enter the next state s t+1 ; Step 66: Determine the current torque control strategy network Whether the training reaches the pre-training step number T pre ; If the number of pre-training steps T is not reached pre , return to step 62 and continue training; If the number of pre-training steps T is reached pre , get the pre-trained torque control strategy network, and execute steps six and seven; Step 67: Network the torque control strategy The number of training steps is set to the total number of steps T in the formal training phase main ; Step 68: Reset the training environment and determine the expected speed according to the training stage; The first stage: the speed corresponding to the reference action is taken as the expected speed, that is, the task vector v task ; The second stage: extract a speed from the low-speed range as the desired speed, i.e., the task vector v task Or extract a speed from the high-speed section as the expected speed, that is, the task vector v task ; The low speed range is [0.2, 1] m / s; the high speed range is [1, 3] m / s; Step 69: Get the current status s t , will s t and the task vector v task After merging the time vector t, we get the observation vector o t Then input the pre-trained torque control strategy network, and the pre-trained torque control strategy network outputs the torque τ t ; According to the moment τ t Control the robot to move and calculate the reward r t ; o t Input the value network trained in step 5, and the value network outputs the current state value V(o t ); (o t ,τ t ,r t ,V(o t )) is stored in the buffer and enters the next state s t+1 ; Step 60: Determine whether the current task is completed; If the task of the current scene is not completed, use the state s t+1 Return to step sixty-nine; If the task of the current scene is completed, the torque control strategy network is updated and step 61 is executed; Step 61: Determine whether the number of training steps is less than the number of steps T1 in the first stage; If it is less than T1, execute step 68. The first stage plan obtains the task vector v task And adopt the reward function weight corresponding to the first stage; If it is greater than or equal to T1, execute the second stage plan to obtain the task vector v task And adopt the reward function weight corresponding to the second stage; If the set number of training steps T is reached main , then the final trained torque control strategy network and parameters are obtained; if the set number of training steps T is not reached main , then return to step six eight.

10. The humanoid robot torque control method based on position loop pre-training according to claim 9, characterized in that: If the step 61 is less than T1, the first stage of step 68 is executed to obtain the task vector v task And adopt the reward function weight corresponding to the first stage; the specific process is: The corresponding weight is 0.05, The corresponding weight is 0.35, The corresponding weight is 0.15, The corresponding weight is 0.15, The corresponding weight is 0.1, The corresponding weight is 0.15, The corresponding weight is 0.05, The corresponding weight is 0. The corresponding weight is 0; If it is greater than or equal to T1, execute the second stage plan to obtain the task vector v task And adopt the reward function weight corresponding to the second stage; specifically: The corresponding weight is 0.05, The corresponding weight is 0.15, The corresponding weight is 0.1, The corresponding weight is 0.1, The corresponding weight is 0.1, The corresponding weight is 0.35, The corresponding weight is 0.05, The corresponding weight is 0.05, The corresponding weight is 0.05.

Citation Information

Patent Citations

  • Strategy network training method and humanoid biped robot gait control method

    CN117555339A

  • Robot control method of actor reviewer algorithm based on comprehensive loss

    CN118081773A

  • Doppelganger tele-robotic system

    EP4147830A1

Cited By

  • Control method and device for straight knee walking of humanoid robot and storage medium

    CN120116236A

  • A control method, device, and storage medium for a humanoid robot to walk with straight knees

    CN120116236B