机械臂——DH参数

机械臂——DH参数

DH参数

DH参数存在三种不同的描述:

根据机器人学中的最小线性表示约定,欧几里得空间中的坐标变换,最少需要由4个参数描述

标准DH参数 (四参数)

标准DH参数由Denavit和Hartenberg提出,在一些旧教材上介绍得多,适用于开链机器人建模,在描述树状(一个连杆末端连接两个关节)和闭链结构时会产生歧义。不建议使用。

改进DH参数 Modified DH(四参数)

Khalil和Kleinfinger提出的一种修改DH法,适用于开链,树状和闭链机器人建模。建议使用。

改进DH参数 Modified DH(五参数)

在精度标定里,在四个参数的基础上,新引入一个参数解决相邻连杆平行时存在的奇异性问题,和上面两个DH参数的应用场景不同。

改进DH参数

连杆的坐标系固定在连杆的近端(前一个关节)

变换顺序

α

a

θ

d

\alpha \to a \to \theta \to d

α→a→θ→d

变换

n

1

T

n

=

Rot

x

n

1

(

α

n

1

)

Trans

x

n

1

(

a

n

1

)

Rot

z

n

(

θ

n

)

Trans

z

n

(

d

n

)

^{n-1}T_n = \text{Rot}_{x_{n-1}}(\alpha_{n-1}) \cdot \text{Trans}_{x_{n-1}}(a_{n-1}) \cdot \text{Rot}_{z_n}(\theta_n) \cdot \text{Trans}_{z_n}(d_n)

n−1Tn​=Rotxn−1​​(αn−1​)⋅Transxn−1​​(an−1​)⋅Rotzn​​(θn​)⋅Transzn​​(dn​)

参数说明

DH参数说明连杆长度

a

i

1

a_{i-1}

ai−1​

z

^

i

1

\hat{z}_{i-1}

z^i−1​轴与

z

^

i

\hat{z}_{i}

z^i​轴的公法线长度,标量,为杆

i

1

i-1

i−1的连杆长(并不是物理意义上的两杆长度)连杆扭转角

α

i

1

\alpha_{i-1}

αi−1​关节轴线

z

^

i

1

\hat{z}_{i-1}

z^i−1​到

z

^

\hat{z}

z^的转角连杆偏距

d

i

d_i

di​从

x

^

i

1

\hat{x}_{i-1}

x^i−1​与轴线

z

^

\hat{z}

z^的交点到连杆坐标系

i

{i}

i原点的有向距离(正向沿

z

^

i

\hat{z}_i

z^i​方向)关节转角

θ

i

\theta_i

θi​从

x

^

i

1

\hat{x}_{i-1}

x^i−1​到

x

^

i

\hat{x}_i

x^i​的转角,在

z

^

\hat{z}

z^处度量

程序仿真

Matlab

函数说明

L = Link(dh, options) is a link object using the specified kinematic convention and with parameters:

DH

DH = [THETA D A ALPHA SIGMA OFFSET]

SIGMA :关节形式,0为旋转,1为平移,默认为0OFFSET :是设置的机械臂的初始姿态与DH描述的数学模型机械臂之间的偏移量,旋转为角度,平移为距离。 Options

standard: for standard D&H parameters (default).modified: for modified D&H parameters.revolute: for a revolute joint, can be abbreviated to ‘r’ (default)prismatic: for a prismatic joint, can be abbreviated to ‘p’

程序

clear L;

%% 准备

%启动工具箱

startup_rvc;

%角度转换

du=pi/180; %度

radian=180/pi; %弧度

%关节长度

L1=0.40;L2=0.39;L3=0.37;

L4=0.08;%末端执行器

%% DH法建立模型,关节角,连杆偏移,连杆长度,连杆扭转角,关节类型(0转动,1移动)

L(1) = Link('alpha',0, 'a',0, 'offset',0, 'd',L1,'modified');

L(2) = Link('alpha',pi/2, 'a',0, 'offset',pi/2, 'd',0 ,'modified');

L(3) = Link('alpha',0 , 'a',L2,'offset',0, 'd',0, 'modified');

L(4) = Link('alpha',pi/2 ,'a',0, 'offset',0, 'd',0, 'modified');

L(5) = Link('alpha',0 , 'a',0, 'offset',0, 'd',L3,'modified');

L(6) = Link('alpha',pi/2 ,'a',0, 'offset',0, 'd',0, 'modified');

plotopt = {'noraise', 'nowrist', 'nojaxes', 'delay',0};

tool_char=[1 0 0 0;

0 1 0 0;

0 0 1 0;

0 0 0 1];

six_link=SerialLink(L,'name','six link','tool',tool_char);

%% 显示机械臂

figure(1)

hold on

six_link.plot([0 0 0 0 0 0], plotopt{:});

hold off

Python

函数说明

class roboticstoolbox.robot.DHLink.RevoluteMDH(d=0.0, a=0.0, alpha=0.0, offset=0.0, qlim=None, flip=False, **kwargs)

# Class for revolute links using modified DH convention

参数含义

d (float) – kinematic - link offsetalpha (float) – kinematic - link twista (float) – kinematic - link lengthoffset (float) – kinematic - joint variable offsetqlim (float ndarray*(1,2)*) – joint variable limits [min, max]flip (bool) – joint moves in opposite directionm (float) – dynamic - link massr (float ndarray*(3)*) – dynamic - position of COM with respect to link frameI (ndarray) – dynamic - inertia of link with respect to COMJm (float) – dynamic - motor inertiaB (float*, or* ndarray*(2,**)*) – dynamic - motor viscous friction: B=B⁺=B⁻, [B⁺, B⁻]Tc (ndarray*(2,**)*) – dynamic - motor Coulomb friction [Tc⁺, Tc⁻]G (float) – dynamic - gear ratio

A subclass of the DHLink class for a revolute joint that holds all information related to a robot link such as kinematics parameters, rigid-body inertial parameters, motor and transmission parameters.

The link transform is

T

t

x

(

a

i

1

)

T

r

x

(

α

i

1

)

T

r

z

(

q

i

)

T

t

z

(

d

i

)

\mathbf{T}{tx}(a{i-1}) \cdot \mathbf{T}{rx}(\alpha{i-1}) \cdot \mathbf{T}{rz}(q_i) \cdot \mathbf{T}_{tz}(d_i)

Ttx(ai−1)⋅Trx(αi−1)⋅Trz(qi​)⋅Ttz​(di​) where

q

i

q_i

qi​ is the joint variable.

程序

import roboticstoolbox as rtb

from math import pi

import numpy as np

L1=0.40

L2=0.39

L3=0.37

L4=0.08 # 末端执行器

leg = rtb.DHRobot(

[

rtb.RevoluteMDH(alpha=0, a=0, offset=0, d=L1),

rtb.RevoluteMDH(alpha=pi/2, a=0, offset=pi/2,d=0 ),

rtb.RevoluteMDH(alpha=0, a=L2, offset=0, d=0 ),

rtb.RevoluteMDH(alpha=pi/2, a=0, offset=0, d=0 ),

rtb.RevoluteMDH(alpha=0, a=0, offset=0, d=L3),

rtb.RevoluteMDH(alpha=pi/2, a=0, offset=0, d=0 )

],name="six link")

init_T = np.array([0,0,0,0,0,0])

leg.plot(init_T, movie='six link.png')

input()

参考

MATLAB-Robot(2):标准DH和改进DH的区别

为什么改进的DH模型优于标准DH模型,却大多都是使用标准D-H模型

浅谈标准DH(SDH)和改进DH(MDH)

《现代机器人学:机构、规划与控制》

相关推荐

《崩坏3》80级SSS雪地蚩尤炮极限伤害分析 365bet取款要多久到账

《崩坏3》80级SSS雪地蚩尤炮极限伤害分析

📅 08-08 👁️ 1580
尿常规SG是什么意思 365手机版游戏中心官网

尿常规SG是什么意思

📅 09-25 👁️ 5934
淘宝多久不能追加评论?淘宝如何追加评价? 365scores下载

淘宝多久不能追加评论?淘宝如何追加评价?

📅 07-09 👁️ 4261