How to calculate the workspace for a 7 DOF robot

4 次查看(过去 30 天)
I am generating a workspace for a 7 degrees of freedom robotic arm using the values in the table below, however according to the code I have written below the x and y ranges obtained do not seem accurate since the diagram indicates that the effector is able to move 1000mm in either direction in the x and y axes - this is incorrect since the end effector can only move approximately 200mm in either direction in the x and y axes.
a1 = 0;
a2_0 = 0;
a2_1 = 40.09;
a2_2 = 144.54;
a2_3 = 182.62;
a2_4 = 516;
a2_5 = 96;
a3_0 = 40.09;
a3_1 = 40.09;
a4 = 0;
a5 = 0;
a6 = 0.91;
a7 = 0.91;
alph1 = pi/2;
alph2_0 = -pi/2;
alph2_1 = 0;
alph2_2 = 0;
alph2_3 = 0;
alph2_4 = 0;
alph2_5 = 0;
alph3_0 = -pi/2;
alph3_1 = -pi/2;
alph4 = 0;
alph5 = pi/2;
alph6 = -pi/2;
alph7 = -pi/2;
alpha1_min = -1.4835298642 + pi/2;
alpha1_max = 1.4835298642 + pi/2;
alpha2_0_min = -0.75049157836 - pi/2;
alpha2_0_max = 0.80285145592 - pi/2;
alpha2_1_min = pi/2;
alpha2_1_max = pi/2;
alpha2_2_min = 0.75049157836 + pi/2;
alpha2_2_max = -0.80285145592 + pi/2;
alpha2_3_min = 0.75049157836 + pi/2;
alpha2_3_max = -0.80285145592 + pi/2;
alpha2_4_min = -0.75049157836;
alpha2_4_max = 0.80285145592;
alpha2_5_min = -0.75049157836 + pi;
alpha2_5_max = 0.80285145592 + pi;
alpha3_0_min = 0;
alpha3_0_max = 0;
alpha3_1_min = 0;
alpha3_1_max = 0;
alpha4_min = -1.5009831567;
alpha4_max = 1.5009831567;
alpha5_min = -1.3962634016 + pi/2;
alpha5_max = 1.3962634016 + pi/2;
alpha6_min = -1.5009831567 + pi/2;
alpha6_max = 1.5009831567 + pi/2;
alpha7_min = -1.5009831567 + pi/2;
alpha7_max = 1.5009831567 + pi/2;
d1 = 0;
d2_0 = 0;
d2_1 = 0;
d2_2 = 0;
d2_3 = 0;
d2_4 = 0;
d2_5 = 0;
d3_0 = 0.0012217304764 - 431.8 + 144.54;
d3_1 = 0.0012217304764;
d4 = 416.2;
d5 = 0;
d6 = 0;
d7 = 0;
N = 20000;
t1 = alpha1_max + (alpha1_max - alpha1_min)*rand(N,1);
t2_0 = alpha2_0_max + (alpha2_0_max - alpha2_0_min)*rand(N,1);
t2_1 = alpha2_1_max + (alpha2_1_max - alpha2_1_min)*rand(N,1);
t2_2 = alpha2_2_max + (alpha2_2_max - alpha2_2_min)*rand(N,1);
t2_3 = alpha2_3_max + (alpha2_3_max - alpha2_3_min)*rand(N,1);
t2_4 = alpha2_4_max + (alpha2_4_max - alpha2_4_min)*rand(N,1);
t2_5 = alpha2_5_max + (alpha2_5_max - alpha2_5_min)*rand(N,1);
t3_0 = alpha3_0_max + (alpha3_0_max - alpha3_0_min)*rand(N,1);
t3_1 = alpha3_1_max + (alpha3_1_max - alpha3_1_min)*rand(N,1);
t4 = alpha4_max + (alpha4_max - alpha4_min)*rand(N,1);
t5 = alpha5_max + (alpha5_max - alpha5_min)*rand(N,1);
t6 = alpha6_max + (alpha6_max - alpha6_min)*rand(N,1);
t7 = alpha7_max + (alpha7_max - alpha7_min)*rand(N,1);
for i = 1:N
A1 = TransMat(a1,alph1,d1,t1(i));
A2_0 = TransMat(a2_0,alph2_0,d2_0,t2_0(i));
A2_1 = TransMat(a2_1,alph2_1,d2_1,t2_1(i));
A2_2 = TransMat(a2_2,alph2_2,d2_2,t2_2(i));
A2_3 = TransMat(a2_3,alph2_3,d2_3,t2_3(i));
A2_4 = TransMat(a2_4,alph2_4,d2_4,t2_4(i));
A2_5 = TransMat(a2_5,alph2_5,d2_5,t2_5(i));
A3_0 = TransMat(a3_0,alph3_0,d3_0,t3_0(i));
A3_1 = TransMat(a3_1,alph3_1,d3_1,t3_1(i));
A4 = TransMat(a4,alph4,d4,t4(i));
A5 = TransMat(a5,alph5,d5,t5(i));
A6 = TransMat(a6,alph6,d6,t6(i));
A7 = TransMat(a7,alph7,d7,t7(i));
T = A1 * A2_0 * A2_2 * A2_3 * A2_4 * A2_5 * A3_0 * A3_1 * A4 * A5 * A6 * A7;
X=T(1,4);
Y=T(2,4);
Z=T(3,4);
plot3(X,Y,Z,'.')
hold on;
end
view(3);
title('Isometric view');
xlabel('x (mm)');
ylabel('y (mm)');
zlabel('z (mm) ');
% view(2); % top view
% title(' Top view');
% xlabel('x (mm)');
% ylabel('y (mm)');
% view([0 0 1]); % y-z plane
% title('Side view, Y-Z');
% ylabel('y (mm)');
% zlabel('z (mm)');
function [ T ] = TransMat( a,b,c,d )
T = [ cos(d), -sin(d)*cos(b), sin(d)*sin(b), a*cos(d);
sin(d), cos(d)*cos(b), -cos(d)*sin(b), a*sin(d);
0, sin(b), cos(b), c;
0, 0, 0, 1];
end
Screenshot 2019-07-22 at 19.55.43.png
I have implemented the Monte Carlo method of generating the workspace, however I'm not sure if this is the correct method that I should be using. Are there alternative methods to calculate the kinematics of a robot?
Any help you could provide me would be greatly appreciated!

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Robotics 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by