Escolar Documentos
Profissional Documentos
Cultura Documentos
270
Robotics Systems
Application
Assignment 5 (Computer
Lab Report)
Department of Applied Engineering and
Technology College of Science and
Technology Morehead State University
Shane Holbrook
a1= 6;
d1 = 5;
teta1 = 0/180*pi; %rotation of the first motor
alpha2 = 180/180*pi;
a2 = 4;
teta2 = 0/180*pi; % rotation of the second motor
d3 = 2; %translation of the linear motor
d4 = 1;
teta4 = 0/180*pi;
% DH transformation matrices
A0_1 = [cos(teta1) -sin(teta1) 0 a1*cos(teta1); sin(teta1) cos(teta1) 0
a1*sin(teta1);0 0 1 d1;0 0 0 1]
A1_2 = [cos(teta2) sin(teta2) 0 a2*cos(teta2); sin(teta2) -cos(teta2) 0 a2*sin(teta2);
0 0 -1 0; 0 0 0 1]
A2_3 = [1 0 0 0; 0 1 0 0; 0 0 1 d3; 0 0 0 1]
A3_4 = [cos(teta4) -sin(teta4) 0 0; sin(teta4) cos(teta4) 0 0; 0 0 1 d4; 0 0 0 1]
% position of the reference frame 0
frame0 = [0; 0; 0];
% position of the end of the big cylinder
big = [0; 0; d1];
% position of the reference frame 1
frame1 = [A0_1(1,4); A0_1(2,4); A0_1(3,4)];
% position of the reference frame 2
A0_2 = A0_1*A1_2;
frame2 = [A0_2(1,4); A0_2(2,4); A0_2(3,4)];
% position of the reference frame 3
A0_3 = A0_1*A1_2*A2_3;
frame3 = [A0_3(1,4);A0_3(2,4); A0_3(3,4)];
% position of the reference frame 4
A0_4 = A0_1*A1_2*A2_3*A3_4;
frame4 = [A0_4(1,4); A0_4(2,4); A0_4(3,4)];
% plotting
line([frame0(1), big(1)], [frame0(2), big(2)], [frame0(3), big(3)], 'lineWidth' ,5,
'color', [1 0 0]);
line ([frame1(1), big(1)], [frame1(2), big(2)], [frame1(3), big(3)], 'lineWidth' ,5,
'color', [0 1 0]);
line ([frame1(1), frame2(1)], [frame1(2), frame2(2)], [frame1(3), frame2(3)],
'lineWidth' ,5, 'color', [0 0 1]);
line ([frame2(1), frame3(1)], [frame2(2), frame3(2)], [frame2(3), frame3(3)],
'lineWidth' ,5, 'color', [1 0 1]);
line ([frame4(1), frame3(1)], [frame4(2), frame3(2)], [frame4(3), frame3(3)],
'lineWidth' ,5, 'color', [0 0 0]);
grid on
axis equal
axis ([0, 20, -15, 15, 0, 7]);
xlabel ('x (mm)');
ylabel ('y (mm)');
zlabel ('z (mm)');
title ('SCARA robot');
% VIEW(-15,15)