Mechanisms and Robotics
Mechanisms and Robotics
%MATLAB code for forward kinematics of the arm for the given
home position and to find the tool point of TX90
clc
clear all
L1=478;
L2=289;
L3=425;
L4=-239;
L5=425;
d1=50;
d2=100;
%Origin
O=[0; 0; 0; 1]
T01=rotz(theta1)*transz(L1)*rotx(90)
T12=transz(L2)
T21=transx(d1)*rotz(theta2)
T23=rotz(90)*transx(L3)*rotz(theta3)
T34=transz(L4)*rotz(theta4)*rotz(-90)*rotx(-90)
T45=transz(L5)*rotz(theta5)*rotx(90)
T56=rotx(-90)*rotz(theta6)*transz(d2)
Pn=T01*T12*T21*T23*T34*T45*T56*O
x1=T01*O
x2=T01*T12*O
x3=T01*T12*T21*O
x4=T01*T12*T21*T23*O
x5=T01*T12*T21*T23*T34*O
x6=T01*T12*T21*T23*T34*T45*O
x7=T01*T12*T21*T23*T34*T45*T56*O
%3D Plot
plot3(X,Y,Z,'-ys','LineWidth',5,...
'MarkerEdgeColor','g',...
'MarkerFaceColor','b',...
'MarkerSize',10)
xlabel('X-Rolling')
ylabel('Y-Pitching')
zlabel('Z-Yaw')
hold on