• 大小: 185KB
    文件类型: .zip
    金币: 2
    下载: 2 次
    发布日期: 2021-08-26
  • 语言: Matlab
  • 标签: UR解析法  

资源简介

包含了UR机器人的运动学建模与运动学正逆解的求解过程(解析法),通过实际的机器人参数验证该求解方法的正确性,分析了机器人的奇异位置,并编制好matlab程序便与仿真。

资源截图

代码片段和文件信息

%% 函数说明
%******************************
%函数名称:fkine_UR5
%函数功能:UR5机器人正解
%函数输入:各个关节角度,单位是角度,为1×6向量
%函数输出:末端姿态,为4×4矩阵
%修改时间:201800403
%******************************

%% 根据建立的DH参数得到机器人正解
function T=fkine_UR5(theta)
DH_UR5=load(‘F:\matlab file\20171206\UR5_CB3\DH_UR5.txt‘);
 
IfAlphabet=0;           %IfAlpahabet为真(非0)表示结果用字母显示出来,此时无论输入任何角度将被屏蔽;为假(0)表示用实数显示出来
 
if IfAlphabet
        syms theta1 theta2 theta3 theta4 theta5 theta6;
        syms a2 a3;
        syms d1 d4 d5 d6;
        afa0=DH_UR5(11)*pi/180;
        afa1=DH_UR5(21)*pi/180;
        afa2=DH_UR5(31)*pi/180;
        afa3=DH_UR5(41)*pi/180;
        afa4=DH_UR5(51)*pi/180;
        afa5=DH_UR5(61)*pi/180;
        a0=DH_UR5(12);
        a1=DH_UR5(22);
        a4=DH_UR5(52);
        a5=DH_UR5(62);
        d2=DH_UR5(23);
        d3=DH_UR5(33);
else
        theta1=theta(1)*pi/180;
        theta2=theta(2)*pi/180;
        theta3=theta(3)*pi/180;
        theta4=theta(4)*pi/180;
        theta5=theta(5)*pi/180;
        theta6=theta(6)*pi/180;
        afa0=DH_UR5(11)*pi/180;
        afa1=DH_UR5(21)*pi/180;
        afa2=DH_UR5(31)*pi/180;
        afa3=DH_UR5(41)*pi/180;
        afa4=DH_UR5(51)*pi/180;
        afa5=DH_UR5(61)*pi/180;
        a0=DH_UR5(12);
        a1=DH_UR5(22);
        a2=DH_UR5(32);
        a3=DH_UR5(42);
        a4=DH_UR5(52);
        a5=DH_UR5(62);
        d1=DH_UR5(13);
        d2=DH_UR5(23);
        d3=DH_UR5(33);
        d4=DH_UR5(43);
        d5=DH_UR5(53);
        d6=DH_UR5(63);
end
T01=[cos(theta1)-sin(theta1)0a0;sin(theta1)*cos(afa0)cos(theta1)*cos(afa0)-sin(afa0)-sin(afa0)*d1;sin(theta1)*sin(afa0)cos(theta1)*sin(afa0)cos(afa0)cos(afa0)*d1;0001];
T12=[cos(theta2)-sin(theta2)0a1;sin(theta2)*cos(afa1)cos(theta2)*cos(afa1)-sin(afa1)-sin(afa1)*d2;sin(theta2)*sin(afa1)cos(theta2)*sin(afa1)cos(afa1)cos(afa1)*d2;0001];
T23=[cos(theta3)-sin(theta3)0a2;sin(theta3)*cos(afa2)cos(theta3)*cos(afa2)-sin(afa2)-sin(afa2)*d3;sin(theta3)*sin(afa2)cos(theta3)*sin(afa2)cos(afa2)cos(afa2)*d3;0001];
T34=[cos(theta4)-sin(theta4)0a3;sin(theta4)*cos(afa3)cos(theta4)*cos(afa3)-sin(afa3)-sin(afa3)*d4;sin(theta4)*sin(afa3)cos(theta4)*sin(afa3)cos(afa3)cos(afa3)*d4;0001];
T45=[cos(theta5)-sin(theta5)0a4;sin(theta5)*cos(afa4)cos(theta5)*cos(afa4)-sin(afa4)-sin(afa4)*d5;sin(theta5)*sin(afa4)cos(theta5)*sin(afa4)cos(afa4)cos(afa4)*d5;0001];
T56=[cos(theta6)-sin(theta6)0a5;sin(theta6)*cos(afa5)cos(theta6)*cos(afa5)-sin(afa5)-sin(afa5)*d6;sin(theta6)*sin(afa5)cos(theta6)*sin(afa5)cos(afa5)cos(afa5)*d6;0001];
T06=T01*T12*T23*T34*T45*T56;
T16=T12*T23*T34*T45*T56;
T=T06;

if ~IfAlphabet
    p=itransf(T)
end

 
if IfAlphabet
    for i=1:4
        for j=1:4
            fprintf(‘T(%d%d)=%s\n‘ijT(ij));
        end
    end
end
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件          80  2018-04-04 10:02  UR\DH_UR5.txt
     文件         379  2018-04-08 11:10  UR\ThetaAndPosition.txt
     文件      345046  2018-04-09 10:43  UR\UR5运动学解.doc
     文件        3007  2018-04-08 10:53  UR\fkine_UR5.m
     文件        7627  2018-04-08 10:55  UR\ikine_UR5.m
     目录           0  2018-04-09 10:44  UR\

评论

共有 条评论

相关资源