• 机器人学DH参数及利用matlab符号运算推导


    引言

    重新复习了一下机器人学DH参数,并且利用matlab符号运算进行了推导,验证了公式。

    1.DH参数原理

    在这里插入图片描述
    图中的坐标系定义

    • 坐标系 i {i} i z z z z i z_i zi和关节轴线 i i i共线,指向任意规定。
    • 坐标系 i {i} i x x x x i x_i xi a i a_i ai重合,由关节 i i i指向关节 i + 1 i+1 i+1,当 a i = 0 a_i=0 ai=0,取 x i = ± z i + 1 × z i x_i=±z_{i+1}\times z_i xi=±zi+1×zi
    • 坐标系 i {i} i y y y y i y_i yi按右手法则规定。
    • 坐标系 i {i} i的原点 o i o_i oi取在 x i x_i xi z i z_i zi的交点上;当 z i z_i zi z i + z_{i+} zi+相交时,原点取再两轴交点上,当 z i z_i zi z i + z_{i+} zi+平行时,原点取在使 d i + 1 = 0 d_{i+1}=0 di+1=0的地方。

    利用连杆坐标系定义相应的连杆参数

    • a i a_i ai=从 z i z_i zi z i + 1 z_{i+1} zi+1沿 x i x_i xi测量的距离(公垂线长度)
    • α i \alpha_i αi=从 z i z_i zi z i + 1 z_{i+1} zi+1沿 x i x_i xi旋转的角度
    • d i d_i di=从 x i − 1 x_{i-1} xi1 x i x_{i} xi沿 z i z_i zi测量的距离
    • θ i \theta_i θi=从 x i − 1 x_{i-1} xi1 x i x_{i} xi沿 z i z_i zi旋转的角度

    坐标系 { i } \{i\} {i}相对坐标系 { i − 1 } \{i-1\} {i1}的变换矩阵 i − 1 T i {}^{i-1}T_{i} i1Ti可以看作四个子变换矩阵的乘积:

    1. x i − 1 x_{i-1} xi1轴转 α i − 1 \alpha_{i-1} αi1
      R o t x ( α i − 1 ) = [ 1 0 0 0 0 c o s α i − 1 − s i n α i − 1 0 0 s i n α i − 1 c o s α i − 1 0 0 0 0 1 ] R o t_{x}\left(\alpha_{i-1}\right)=[10000cosαi1sinαi100sinαi1cosαi100001]
      10000cosαi1sinαi100sinαi1cosαi100001
      Rotx(αi1)=10000cosαi1sinαi100sinαi1cosαi100001
    2. 沿 x i − 1 x_{i-1} xi1轴移动 a i − 1 a_{i-1} ai1
      T r a n s x ( a i − 1 ) = [ 1 0 0 a i − 1 0 1 0 0 0 0 1 0 0 0 0 1 ] T r a n s_{x}\left(a_{i-1}\right)=[100ai1010000100001]
      100001000010ai1001
      Transx(ai1)=100001000010ai1001
    3. 沿 z i z_{i} zi轴移动 θ i \theta_{i} θi
      R o t z ( θ i ) = [ c o s θ i − s i n θ i 0 0 s i n θ i c o s θ i 0 0 0 0 1 0 0 0 0 1 ] R o t_{z}\left(\theta_{i}\right)=[cosθisinθi00sinθicosθi0000100001]
      cosθisinθi00sinθicosθi0000100001
      Rotz(θi)=cosθisinθi00sinθicosθi0000100001
    4. 沿 z i z_{i} zi轴移动 d i d_{i} di
      T r a n s z ( d i ) = [ 1 0 0 0 0 1 0 0 0 0 1 d i 0 0 0 1 ] T r a n s_{z}\left(d_{i}\right)=[10000100001di0001]
      10000100001000di1
      Transz(di)=10000100001000di1

    这些变换都是相对运动坐标系描述的,满足从左到右的原则,可以得到最终变换公式如下:

    i i − 1 T = R o t x ( α i ) T r a n s x ( a i ) R o t z ( θ i ) T r a n s z ( d i ) _{i}^{i-1}T=R o t_{x}\left(\alpha_{i}\right)T r a n s_{x}\left(a_{i}\right)R o t_{z}\left(\theta_{i}\right)T r a n s_{z}\left(d_{i}\right) ii1T=Rotx(αi)Transx(ai)Rotz(θi)Transz(di)
    通常规定 a i ≥ 0 a_i\ge0 ai0,因为它代表连杆长度,而 α i , d i , θ i \alpha_i, d_i, \theta_i αi,di,θi可正可负。

    i i − 1 T = [ c o s θ i − s i n θ i 0 a i − 1 s i n θ i c o s α i − 1 c o s θ i c o s α i − 1 − s i n α i − 1 − d i s i n α i − 1 s i n θ i s i n α i − 1 c o s θ i s i n α i − 1 c o s α i − 1 d i c o s α i − 1 0 0 0 1 ] _{i}^{i-1}T=[cosθisinθi0ai1sinθicosαi1cosθicosαi1sinαi1disinαi1sinθisinαi1cosθisinαi1cosαi1dicosαi10001]

    cosθisinθicosαi1sinθisinαi10sinθicosθicosαi1cosθisinαi100sinαi1cosαi10ai1disinαi1dicosαi11
    ii1T=cosθisinθicosαi1sinθisinαi10sinθicosθicosαi1cosθisinαi100sinαi1cosαi10ai1disinαi1dicosαi11

    2.Matlab符号运算验证

    利用Matlab的符号运算进行公式推导进行一下公式的验证

    syms theta d alpha a
    M=DH_Trans(theta,d,alpha,a)
    function M=DH_Trans(theta,d,alpha,a)
        R_z_theta=[cos(theta),-sin(theta),0,0;...
            sin(theta),cos(theta),0,0;...
            0,0,1,0;...
            0,0,0,1];
        T_z_d=[1,0,0,0;...
            0,1,0,0;...
            0,0,1,d;...
            0,0,0,1];
        R_x_alpha=[1,0,0,0;...
            0,cos(alpha),-sin(alpha),0;...
            0,sin(alpha),cos(alpha),0;...
            0,0,0,1];
       T_x_a=[1,0,0,a;...
            0,1,0,0;...
            0,0,1,0;...
            0,0,0,1];
       M=R_x_alpha*T_x_a*R_z_theta*T_z_d;
    end
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21

    结果是一致的
    在这里插入图片描述

  • 相关阅读:
    神经网络参数如何确定的,神经网络参数个数计算
    语音识别工具kaldi简介
    Android Studio 配置Git SVN忽略文件
    FlinkSQL ChangeLog
    CAP理解
    了解条码软件中的图形工具
    工厂因封控停工,客户问到一般怎么说?
    如何实现多任务管理
    H3C IPsec多分支经由总部互通
    配置管理新纪元:Eureka引领分布式服务配置潮流
  • 原文地址:https://blog.csdn.net/subtitle_/article/details/125467306