CN118818968A - A quadruped robot motion control method based on deep reinforcement learning - Google Patents
A quadruped robot motion control method based on deep reinforcement learning Download PDFInfo
- Publication number
- CN118818968A CN118818968A CN202410663847.1A CN202410663847A CN118818968A CN 118818968 A CN118818968 A CN 118818968A CN 202410663847 A CN202410663847 A CN 202410663847A CN 118818968 A CN118818968 A CN 118818968A
- Authority
- CN
- China
- Prior art keywords
- quadruped robot
- joint
- robot
- strategy
- motion
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 22
- 230000002787 reinforcement Effects 0.000 title claims abstract description 21
- 230000006870 function Effects 0.000 claims abstract description 36
- 238000004088 simulation Methods 0.000 claims abstract description 17
- 230000008569 process Effects 0.000 claims abstract description 15
- 238000005457 optimization Methods 0.000 claims abstract description 9
- 238000012549 training Methods 0.000 claims abstract description 6
- 230000009471 action Effects 0.000 claims description 28
- 238000013507 mapping Methods 0.000 claims description 5
- 230000008901 benefit Effects 0.000 claims description 4
- 238000013461 design Methods 0.000 claims description 4
- 238000012546 transfer Methods 0.000 claims description 4
- ATJFFYVFTNAWJD-UHFFFAOYSA-N Tin Chemical compound [Sn] ATJFFYVFTNAWJD-UHFFFAOYSA-N 0.000 claims description 3
- 238000009434 installation Methods 0.000 claims description 3
- 238000005259 measurement Methods 0.000 claims description 3
- 230000007704 transition Effects 0.000 claims description 3
- 230000008859 change Effects 0.000 claims description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 230000009916 joint effect Effects 0.000 description 1
- 238000012417 linear regression Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B13/00—Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion
- G05B13/02—Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric
- G05B13/04—Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric involving the use of models or simulators
- G05B13/042—Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric involving the use of models or simulators in which a parameter or coefficient is automatically adjusted to optimise the performance
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Manipulator (AREA)
Abstract
Description
技术领域Technical Field
本发明属于机器人控制技术领域,涉及一种基于深度强化学习的四足机器人运动控制方法。The present invention belongs to the technical field of robot control and relates to a quadruped robot motion control method based on deep reinforcement learning.
背景技术Background Art
随着当前机器人控制技术的不断发展,四足机器人的应用也逐渐广泛。相比轮式、履带式机器人,四足机器人具有较高的自由度,离散的落足点等特点,在复杂地形作业方面展现了巨大优势,可以广泛应用于搜救、侦察、工业巡检、未知环境探索等领域。With the continuous development of current robot control technology, the application of quadruped robots has become increasingly widespread. Compared with wheeled and tracked robots, quadruped robots have higher degrees of freedom and discrete footholds, showing great advantages in complex terrain operations. They can be widely used in search and rescue, reconnaissance, industrial inspection, and exploration of unknown environments.
然而,四足机器人的高自由度同时也给运动控制带来了极大的挑战。近些年来,有许多基于模型的方法被应用于四足机器人的运动控制问题,但这类控制方法往往需要对各种场景精心设计,但也难以避免出现边界情况(corner cases)。相比之下,强化学习方法能够通过试错自主地学习一个运动控制器,该运动控制能够在多种场景下取得较好的控制效果。这种方法往往需要先在仿真器中进行训练,之后部署在现实的四足机器人上。但由于大多数仿真器无法完全模拟现实环境的复杂性,这些控制器在从仿真到现实的迁移(sim-to-real transfer)过程中往往会有比较大的性能损失。However, the high degree of freedom of quadruped robots also brings great challenges to motion control. In recent years, many model-based methods have been applied to the motion control problem of quadruped robots, but such control methods often require careful design of various scenarios, and it is difficult to avoid corner cases. In contrast, reinforcement learning methods can autonomously learn a motion controller through trial and error, which can achieve good control effects in a variety of scenarios. This method often needs to be trained in a simulator first and then deployed on a real quadruped robot. However, since most simulators cannot fully simulate the complexity of the real environment, these controllers often suffer from relatively large performance losses during the sim-to-real transfer process.
发明内容Summary of the invention
本发明提供了一种基于深度强化学习的四足机器人运动控制算法,可以在仿真中自动学习运动策略,降低仿真到现实的差异,实现四足机器人的鲁棒运动。The present invention provides a quadruped robot motion control algorithm based on deep reinforcement learning, which can automatically learn motion strategies in simulation, reduce the difference between simulation and reality, and realize robust motion of the quadruped robot.
本发明采用的技术方案是:The technical solution adopted by the present invention is:
一种基于深度强化学习的四足机器人运动控制算法,具体步骤如下:A quadruped robot motion control algorithm based on deep reinforcement learning. The specific steps are as follows:
S1,建立四足机器人的模型,包括用于仿真四足机器人的动力学模型和用于辨识和仿真四足机器人的电机驱动器的驱动器模型,所述驱动器模型采用经验驱动器模型(Empirical Actuator Model,EAM);S1, establishing a model of a quadruped robot, including a dynamic model for simulating the quadruped robot and a driver model for identifying and simulating a motor driver of the quadruped robot, wherein the driver model adopts an empirical actuator model (EAM);
S2、把四足机器人的运动过程描述为马尔可夫过程,设计奖励函数,使用深度强化学习算法在S1中建立的仿真环境中,使用多损失函数的近端策略优化(Multi-LossProximal Policy Optimization,MLPPO)算法优化四足机器人的运动策略,训练得到运动控制器;S2. Describe the motion process of the quadruped robot as a Markov process, design a reward function, use a deep reinforcement learning algorithm in the simulation environment established in S1, use the Multi-Loss Proximal Policy Optimization (MLPPO) algorithm to optimize the motion strategy of the quadruped robot, and train the motion controller.
S3、将训练得到的运动控制器部署到四足机器人上。S3. Deploy the trained motion controller to the quadruped robot.
进一步,步骤S1具体包括以下步骤:Further, step S1 specifically includes the following steps:
S11、建立四足机器人的动力学模型,包括四足机器人的基座质量及惯性张量、各关节连杆质量及惯性张量、各关节安装位置和限位、各关节碰撞模型;S11. Establish a dynamic model of the quadruped robot, including the base mass and inertia tensor of the quadruped robot, the mass and inertia tensor of each joint link, the installation position and limit of each joint, and the collision model of each joint;
S12、建立四足机器人的驱动器模型,经验驱动器模型数学表达式如下:S12. Establish a driver model for the quadruped robot. The mathematical expression of the empirical driver model is as follows:
其中,qt和为t时刻关节的位置和速度,tin为关节的输入延迟,为t-tin时刻给定的期望关节位置,和为比例微分增益,为关节的期望输出力矩;tout为驱动器力矩的输出延迟,τm为电机的外部特性曲线;电机的外部特性曲线即电机输出最大的力矩随电机转速的变化曲线。Among them, q t and is the position and velocity of the joint at time t, tin is the input delay of the joint, is the expected joint position given at time tt in , and is the proportional derivative gain, is the expected output torque of the joint; t out is the output delay of the driver torque, τ m is the external characteristic curve of the motor; the external characteristic curve of the motor is the curve of the change of the maximum torque output by the motor with the motor speed.
进一步,步骤S11中产生的模型由一个统一机器人描述格式(Unified RoboticsDescription Format,URDF)文件描述,使用有接触的多关节动力学(Multi-Jointdynamics with Contact,MuJoCo)对机器人模型进行模拟。Furthermore, the model generated in step S11 is described by a Unified Robotics Description Format (URDF) file, and the robot model is simulated using Multi-Joint dynamics with Contact (MuJoCo).
进一步,步骤S2具体包括以下步骤:Further, step S2 specifically includes the following steps:
S21、把四足机器人的运动过程描述为马尔可夫过程(Markov Decision Process,MDP),包括状态空间动作空间状态转移函数以及奖励函数在t时刻,参数化策略πθ根据历史状态产生动作环境基于状态转移函数更新状态并计算奖励MDP的目标为最大化折扣奖励和其中为数学期望,γ为奖励的折扣系数;S21. Describe the motion process of the quadruped robot as a Markov decision process (MDP), including the state space Action Space State transfer function And the reward function At time t, the parameterized strategy π θ generates actions based on the historical state The environment updates its state based on the state transition function And calculate the reward The goal of MDP is to maximize the discounted reward and in is the mathematical expectation, γ is the discount coefficient of the reward;
S22、在仿真环境中收集训练数据,在每个环境步中,收集当前环境状态、由策略给出当前帧的动作、将动作通过经验驱动器模型转化为关节力矩、运行仿真得到下一帧状态、根据两帧状态和动作计算奖励值,并将每个状态保存在缓存中;S22, collecting training data in the simulation environment, in each environment step, collecting the current environment state, giving the action of the current frame by the strategy, converting the action into joint torque through the empirical driver model, running the simulation to obtain the next frame state, calculating the reward value based on the two-frame state and action, and saving each state in the cache;
S23、在收集了一定数量的状态后,使用多损失函数的近端策略优化(Multi-LossProximal Policy Optimization,MLPPO)更新策略;一个参数化策略可以表示为动作对于状态的条件概率pθ(at|st),其中θ为策略的参数;MLPPO的优化目标为S23. After collecting a certain number of states, the policy is updated using Multi-Loss Proximal Policy Optimization (MLPPO). A parameterized policy can be expressed as the conditional probability of an action for a state, p θ (a t |s t ), where θ is the policy parameter. The optimization objective of MLPPO is
minLppo+wsymmetryLsymmetry+wsmoothLsmooth minL ppo +w symmetry L symmetry +w smooth L smooth
其中,Lppo为标准PPO的损失函数;Among them, L ppo is the loss function of standard PPO;
其中,At为t时刻下的优势,θ′为收集数据时的策略的参数,ε为裁剪比率;Lsymmetry和Lsmooth为针对四足机器人设计的特殊目标函数,分别为对称损失和平滑损失,wsymmetry和wsmooth分别为这两个目标函数的权重。这两个目标函数可以表示为Among them, A t is the advantage at time t, θ′ is the parameter of the strategy when collecting data, and ε is the clipping ratio; L symmetry and L smooth are special objective functions designed for quadruped robots, which are symmetric loss and smooth loss respectively, and w symmetry and w smooth are the weights of these two objective functions respectively. These two objective functions can be expressed as
其中,和分别代表状态和动作的对称映射。in, and Represents the symmetric mapping of states and actions respectively.
进一步,步骤S21中的状态空间包括机器人线速度指令cx,cy、角速度指令cr、3维基座线速度v、3维基座角速度ω、12维关节角q、12维关节角速度以及基座横滚角ψx和俯仰角ψy。Furthermore, the state space in step S21 Including robot linear velocity command cx , cy , angular velocity command cr , 3D base linear velocity v, 3D base angular velocity ω, 12D joint angle q, 12D joint angular velocity As well as the base roll angle ψ x and pitch angle ψ y .
进一步,步骤S21中的动作空间为12个关节角的期望角度。Furthermore, the action space in step S21 are the desired angles of the 12 joint angles.
进一步,步骤S21中的奖励函数是一系列奖励的加权和其中包括奖励对给定速度指令的跟踪,对功率和关节动作的惩罚、以及对基座姿态和稳定运动的奖励。Furthermore, the reward function in step S21 is is the weighted sum of a series of rewards These include rewards for tracking a given velocity command, penalties for power and joint motion, and rewards for base attitude and stable motion.
进一步,步骤S3中具体包括以下的步骤:Further, step S3 specifically includes the following steps:
S31、从四足机器人的机载传感器获得策略网络需要的各种状态量,其中机器人角速度和姿态从机器人的惯性测量单元获得;各关节角和关节角速度从关节编码器获得,机器人线速度从状态估计器获得;S31, obtaining various state quantities required by the strategy network from the onboard sensors of the quadruped robot, wherein the robot angular velocity and posture are obtained from the inertial measurement unit of the robot; each joint angle and joint angular velocity are obtained from the joint encoder, and the robot linear velocity is obtained from the state estimator;
S32、以固定的频率在四足机器人的运动控制器上实时推理策略网络产生动作,即期望关节位置,再发送到关节电机实现全身控制。S32. The strategy network is inferred in real time on the motion controller of the quadruped robot at a fixed frequency to generate actions, i.e., the desired joint positions, which are then sent to the joint motors to achieve whole-body control.
本发明的有益效果:Beneficial effects of the present invention:
1、可以在仿真中自动学习运动策略,降低仿真到现实的差异,实现四足机器人的鲁棒运动。1. It can automatically learn motion strategies in simulation, reduce the difference between simulation and reality, and realize robust motion of quadruped robots.
2、采用经验驱动器模型EAM,用于辨识实际机器人的驱动器和运动策略的训练,降低仿真与现实的差距。2. Use the empirical actuator model (EAM) to identify the actual robot's actuator and motion strategy training to reduce the gap between simulation and reality.
3、通过强化学习方法实现四足机器人对给定速度指令的精准跟踪,通过多损失函数的强化学习框架,在最大化奖励函数的同时优化策略的对称性和平滑度,从而策略可以驱动四足机器人以4.2m/s的速度高速奔跑,并在较宽的指令范围内实现了低于0.07m/s的速度跟踪误差。而且策略具有极佳的对称性、平滑度和美观性,并在能量效率方面超过基于模型的控制器。3. The quadruped robot can accurately track the given speed command through the reinforcement learning method. Through the reinforcement learning framework of multiple loss functions, the symmetry and smoothness of the strategy are optimized while maximizing the reward function. Therefore, the strategy can drive the quadruped robot to run at a high speed of 4.2m/s and achieve a speed tracking error of less than 0.07m/s within a wide range of commands. Moreover, the strategy has excellent symmetry, smoothness and aesthetics, and exceeds the model-based controller in terms of energy efficiency.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本发明的结构示意图。FIG. 1 is a schematic structural diagram of the present invention.
具体实施方式DETAILED DESCRIPTION
下面结合具体实施例来对本发明进行进一步说明,但并不将本发明局限于这些具体实施方式。本领域技术人员应该认识到,本发明涵盖了权利要求书范围内所可能包括的所有备选方案、改进方案和等效方案。The present invention is further described below in conjunction with specific embodiments, but the present invention is not limited to these specific embodiments. Those skilled in the art should recognize that the present invention covers all possible alternatives, improvements and equivalents within the scope of the claims.
在本发明的描述中,需要理解的是,术语“中心”、“纵向”、“横向”、“长度”、“宽度”、“厚度”、“上”、“下”、“前”、“后”、“左”、“右”、“竖直”、“水平”、“顶”、“底”“内”、“顺时针”、“逆时针”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本发明的描述中,除非另有说明,“多个”的含义是两个或两个以上,除非另有明确的限定。In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "clockwise", "counterclockwise" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, the meaning of "multiple" is two or more, unless otherwise clearly defined.
在本发明中,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”、“固定”等术语应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
在本发明中,除非另有明确的规定和限定,第一特征在第二特征之“上”或之“下”可以包括第一和第二特征直接接触,也可以包括第一和第二特征不是直接接触而是通过它们之间的另外的特征接触。而且,第一特征在第二特征“之上”、“上方”和“上面”包括第一特征在第二特征正上方和斜上方,或仅仅表示第一特征水平高度高于第二特征。第一特征在第二特征“之下”、“下方”和“下面”包括第一特征在第二特征正下方和斜下方,或仅仅表示第一特征水平高度小于第二特征。In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.
参见图1,本发明提供了一种基于深度强化学习的四足机器人运动控制算法,具体步骤如下:Referring to FIG1 , the present invention provides a quadruped robot motion control algorithm based on deep reinforcement learning, and the specific steps are as follows:
S1,建立四足机器人的模型,包括用于仿真四足机器人的动力学模型和用于辨识和仿真四足机器人的电机驱动器的驱动器模型,所述驱动器模型采用经验驱动器模型(Empirical Actuator Model,EAM);S1, establishing a model of a quadruped robot, including a dynamic model for simulating the quadruped robot and a driver model for identifying and simulating a motor driver of the quadruped robot, wherein the driver model adopts an empirical actuator model (EAM);
具体包括以下步骤:The specific steps include:
S11、建立四足机器人的动力学模型,包括四足机器人的基座质量及惯性张量、各关节连杆质量及惯性张量、各关节安装位置和限位、各关节碰撞模型;产生的模型由一个统一机器人描述格式URDF文件描述,使用有接触的多关节动力学MujoCo对机器人模型进行模拟。S11. Establish a dynamic model of the quadruped robot, including the base mass and inertia tensor of the quadruped robot, the mass and inertia tensor of each joint link, the installation position and limit of each joint, and the collision model of each joint; the generated model is described by a unified robot description format URDF file, and the robot model is simulated using contact multi-joint dynamics MujoCo.
S12、建立四足机器人的驱动器模型,经验驱动器模型数学表达式如下:S12. Establish a driver model for the quadruped robot. The mathematical expression of the empirical driver model is as follows:
其中,qt和为t时刻关节的位置和速度,tin为关节的输入延迟,为t-tin时刻给定的期望关节位置,和为比例微分增益,为关节的期望输出力矩。tout为驱动器力矩的输出延迟,τm为电机的外部特性曲线。电机的外部特性曲线即电机输出最大的力矩随电机转速的变化曲线。Among them, q t and is the position and velocity of the joint at time t, tin is the input delay of the joint, is the expected joint position given at time tt in , and is the proportional derivative gain, is the expected output torque of the joint. t out is the output delay of the driver torque, and τ m is the external characteristic curve of the motor. The external characteristic curve of the motor is the curve of the maximum torque output by the motor versus the motor speed.
以1000HZ频率收集四足机器人关节电机运行数据获得数据集,遍历tin∈[0,tmax],tout∈[0,tmax],通过最小化均方误差线性回归得到和将具有最小的均方误差的一组参数作为该关节电机的辨识值。The quadruped robot joint motor operation data is collected at a frequency of 1000HZ to obtain a data set. The data set is traversed through t in ∈ [0, t max ], t out ∈ [0, t max ], and the linear regression is performed by minimizing the mean square error to obtain and The set of parameters with the smallest mean square error is taken as the identification value of the joint motor.
S2、把四足机器人的运动过程描述为马尔可夫过程,设计奖励函数,使用深度强化学习算法在S1中建立的仿真环境中,使用多损失函数的近端策略优化算法优化四足机器人的运动策略,训练得到运动控制器;S2, describe the motion process of the quadruped robot as a Markov process, design a reward function, use a deep reinforcement learning algorithm in the simulation environment established in S1, use a proximal strategy optimization algorithm with multiple loss functions to optimize the motion strategy of the quadruped robot, and train the motion controller;
具体包括以下步骤:The specific steps include:
S21、把四足机器人的运动过程描述为马尔可夫过程(Markov Decision Process,MDP),包括状态空间动作空间状态转移函数以及奖励函数在t时刻,参数化策略πθ根据历史状态产生动作环境基于状态转移函数更新状态并计算奖励MDP的目标为最大化折扣奖励和其中为数学期望,γ为奖励的折扣系数。其中的状态空间包括机器人线速度指令cx,cy、角速度指令cr、3维基座线速度v、3维基座角速度ω、12维关节角q、12维关节角速度以及基座横滚角ψx和俯仰角ψy。动作空间为12个关节角的期望角度。S21. Describe the motion process of the quadruped robot as a Markov decision process (MDP), including the state space Action Space State transfer function And the reward function At time t, the parameterized strategy π θ generates actions based on the historical state The environment updates its state based on the state transition function And calculate the reward The goal of MDP is to maximize the discounted reward and in is the mathematical expectation, and γ is the discount factor of the reward. The state space Including robot linear velocity command cx , cy , angular velocity command cr , 3D base linear velocity v, 3D base angular velocity ω, 12D joint angle q, 12D joint angular velocity And the base roll angle ψ x and pitch angle ψ y . Action Space are the desired angles of the 12 joint angles.
本实施例的奖励函数是一系列奖励的加权和其中包括奖励对给定速度指令的跟踪,对功率和关节动作的惩罚、以及对基座姿态和稳定运动的奖励。奖励函数如下表1所示,其中ti为第i条腿的摆动时间。The reward function of this embodiment is the weighted sum of a series of rewards These include rewards for tracking a given velocity command, penalties for power and joint action, and rewards for base posture and stable motion. The reward function is shown in Table 1 below, where ti is the swing time of the i-th leg.
表1奖励函数Table 1 Reward function
S22、在仿真环境中收集训练数据,在每个环境步中,收集当前环境状态、由策略给出当前帧的动作、将动作通过经验驱动器模型转化为关节力矩、运行仿真得到下一帧状态、根据两帧状态和动作计算奖励值,并将每个状态保存在缓存中;S22, collecting training data in the simulation environment, in each environment step, collecting the current environment state, giving the action of the current frame by the strategy, converting the action into joint torque through the empirical driver model, running the simulation to obtain the next frame state, calculating the reward value based on the two-frame state and action, and saving each state in the cache;
S23、在收集了一定数量的状态后,使用多损失函数的近端策略优化(Multi-LossProximal Policy Optimization,MLPPO)更新策略。一个参数化策略可以表示为动作对于状态的条件概率pθ(at|st),其中θ为策略的参数。MLPPO的优化目标为S23. After collecting a certain number of states, use Multi-Loss Proximal Policy Optimization (MLPPO) to update the policy. A parameterized policy can be expressed as the conditional probability of an action for a state p θ (a t |s t ), where θ is the parameter of the policy. The optimization goal of MLPPO is
minLppo+wsymmetryLsymmetry+wsmoothLsmooth minL ppo +w symmetry L symmetry +w smooth L smooth
其中,Lppo为标准PPO的损失函数;Among them, L ppo is the loss function of standard PPO;
其中,At为t时刻下的优势,θ′为收集数据时的策略的参数,ε为裁剪比率;Lsymmetry和Lsmooth为针对四足机器人设计的特殊目标函数,分别为对称损失和平滑损失,wsymmetry和wsmooth分别为这两个目标函数的权重。这两个目标函数可以表示为Among them, A t is the advantage at time t, θ′ is the parameter of the strategy when collecting data, and ε is the clipping ratio; L symmetry and L smooth are special objective functions designed for quadruped robots, which are symmetric loss and smooth loss respectively, and w symmetry and w smooth are the weights of these two objective functions respectively. These two objective functions can be expressed as
其中,和分别代表状态和动作的对称映射。对称映射关系如表2所示。in, and They represent the symmetric mapping of states and actions respectively. The symmetric mapping relationship is shown in Table 2.
表2状态和动作的对称映射Table 2 Symmetric mapping of states and actions
S3、将训练得到的运动控制器部署到四足机器人上。S3. Deploy the trained motion controller to the quadruped robot.
具体包括以下的步骤:The specific steps include the following:
S31、从四足机器人的机载传感器获得策略网络需要的各种状态量,其中机器人角速度和姿态从机器人的惯性测量单元获得;各关节角和关节角速度从关节编码器获得,机器人线速度从状态估计器获得;S31, obtaining various state quantities required by the strategy network from the onboard sensors of the quadruped robot, wherein the robot angular velocity and posture are obtained from the inertial measurement unit of the robot; each joint angle and joint angular velocity are obtained from the joint encoder, and the robot linear velocity is obtained from the state estimator;
S32、以固定的100HZ频率在四足机器人的运动控制器上实时推理策略网络产生动作,即期望关节位置,再发送到关节电机实现全身控制。S32, the strategy network is inferred in real time on the motion controller of the quadruped robot at a fixed frequency of 100HZ to generate actions, that is, the expected joint positions, which are then sent to the joint motors to achieve whole-body control.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410663847.1A CN118818968A (en) | 2024-05-27 | 2024-05-27 | A quadruped robot motion control method based on deep reinforcement learning |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410663847.1A CN118818968A (en) | 2024-05-27 | 2024-05-27 | A quadruped robot motion control method based on deep reinforcement learning |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118818968A true CN118818968A (en) | 2024-10-22 |
Family
ID=93067482
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410663847.1A Pending CN118818968A (en) | 2024-05-27 | 2024-05-27 | A quadruped robot motion control method based on deep reinforcement learning |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118818968A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119200619A (en) * | 2024-11-27 | 2024-12-27 | 山东大学 | Quadruped robot control method and system based on reinforcement learning and composite model |
CN119511739A (en) * | 2025-01-21 | 2025-02-25 | 煤炭科学研究总院有限公司 | Training method and device for quadruped robot controller based on reinforcement learning |
-
2024
- 2024-05-27 CN CN202410663847.1A patent/CN118818968A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119200619A (en) * | 2024-11-27 | 2024-12-27 | 山东大学 | Quadruped robot control method and system based on reinforcement learning and composite model |
CN119511739A (en) * | 2025-01-21 | 2025-02-25 | 煤炭科学研究总院有限公司 | Training method and device for quadruped robot controller based on reinforcement learning |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110666793B (en) | Method for realizing robot square part assembly based on deep reinforcement learning | |
WO2020207219A1 (en) | Non-model robot control method for multi-shaft-hole assembly optimized by environmental prediction | |
CN118818968A (en) | A quadruped robot motion control method based on deep reinforcement learning | |
CN102825603B (en) | Network teleoperation robot system and time delay overcoming method | |
CN116460860B (en) | A model-based offline reinforcement learning control method for robots | |
CN110928189A (en) | Robust control method based on reinforcement learning and Lyapunov function | |
CN111618847A (en) | Mechanical arm autonomous grabbing method based on deep reinforcement learning and dynamic motion elements | |
CN112643670B (en) | Flexible joint control method based on sliding-mode observer | |
CN109782600A (en) | A method for establishing autonomous mobile robot navigation system through virtual environment | |
CN112894821B (en) | Method, device and equipment for dragging and teaching control of collaborative robot based on current method | |
CN110083160A (en) | A kind of method for planning track of robot based on deep learning | |
CN112631128A (en) | Robot assembly skill learning method and system based on multi-mode heterogeneous information fusion | |
CN117826713B (en) | Improved reinforcement learning AGV path planning method | |
CN113070878A (en) | Robot control method based on impulse neural network, robot and storage medium | |
CN114396949A (en) | Mobile robot no-priori map navigation decision-making method based on DDPG | |
CN116587275A (en) | Method and system for intelligent impedance control of manipulator based on deep reinforcement learning | |
CN115421387A (en) | A variable impedance control system and control method based on inverse reinforcement learning | |
CN110039537B (en) | Online self-learning multi-joint motion planning method based on neural network | |
WO2023165174A1 (en) | Method for constructing controller for robot, motion control method and apparatus for robot, and robot | |
CN116736749A (en) | Methods for building controllers for robots and robots | |
CN115303455B (en) | Motion control method, device and equipment for underwater bionic robot and storage medium | |
CN118219275A (en) | A robot compliant interactive control method and related device | |
CN116079745B (en) | Man-machine skill migration method based on geometric perception and rhythmic dynamic motion primitive | |
CN118131628A (en) | Mobile robot tracking control method based on multi-target point information fusion | |
CN117873156A (en) | A method for online trajectory optimization of aircraft based on deep learning |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication |