You are on page 1of 1

My robot has 4 dof connect with elbow and wrist.

Link lengths are,

l1=163.74;
l2=321.01;
l3=35.87;
a3=1.5;

Range of motion for joint variables,

q1=linspace(-pi/18,5*pi/18,50); % q1 range from -10deg to +50 deg and divide into 50 units
q2=linspace(-pi/3,pi/6,50); % q2 from -60deg to +30deg and divide into 50 units
q3=linspace(-pi/6,pi/6,50); % q3 from -30deg to +30deg and divide into 50 units

End-effector position (X,Y,Z) is calculated from Forward transformation.

X=l2.sin(q1)-a3.[sin(q1).sin(q3)-cos(q1).cos(q2).cos(q3)]+l3.cos(q1).sin(q2);

Y=l2.cos(q1)-a3.[cos(q1).sin(q3)+cos(q2).cos(q3).sin(q1)]-l3.sin(q1).sin(q2);

Z= l1+l3.cos(q2)+a3.cos(q3).sin(q2);

Q? How I get the position of end-effector in entire workspace from Matlab?

In my calculation,
I defined following,

x=l2.*sin(q1)-a3.*(sin(q1).*sin(q3)-cos(q1).*cos(q2).*cos(q3))+l3.*cos(q1).*sin(q2); (array for X)

y=l2.*cos(q1)-a3.*(cos(q1).*sin(q3)+cos(q2).*cos(q3).*sin(q1))-l3.*sin(q1).*sin(q2); (array for Y)

[X,Y]=meshgrid(x,y); % define meshgrid

Z=1711-7.616.*X-1.47.*Y-0.007871.*X^2-0.001136.*X.*Y; (this expression is obtained by fitting surface


on selected joint trajectory in 3D. I used plot of X,Y and Z to get joint trajectory) (the way I get Z is
correct ?, without Z cannot plot 3D surface)

mesh(Z) to plot the workspace.

Please go through this calculation process and let me know how I get the workspace plot from matlab. Your kind
help is highly appreciate and more valuable to me at this moments.
Best Regards
Malin Gunasekara

You might also like