Need help! Plotting a 3d model of a robot arm workspace!
Need help! Plotting a 3d model of a robot arm workspace!
(OP)
I trying to model the 3d workspace of the robot arm. Below is the matlab syntax. Px,Py,Pz is the goal position. q1,q2,q3 is joint angle limits. a1,a2,a3,d1 and d4 is link parameter.
a1=150;
a2=600;
a3=100;
d1=400;
d4=600;
q1=linspace(-170,170);
q2=linspace(-90,155);
q3=linspace(-170,190);
Px=(a1.*(cosd(q1)))+(a2.*((cosd(q1).*cosd(q2))-(sind(q1).*sind(q2))))+(a3.*((cosd(q1).*cosd(q2))-(sind(q1).*sind(q2))).*(cosd(q3)))+(d4.*(cosd(q1)).*((sind(q2).*cosd(q3))+(cosd(q2).*sind(q3))));
Py=(a1.*(sind(q1)))+(a2.*(sind(q1)).*(cosd(q2)))+(a3.*(sind(q1)).*((cosd(q2).*cosd(q3))-(sind(q2).*sind(q3))))+(d4.*(sind(q3)).*((sind(q1).*cosd(q2))+(cosd(q1).*sind(q2))));
Pz=(a2.*(sind(q2)))+(a3.*((sind(q2).*cosd(q3))+(cosd(q2).*sind(q3))))-(d4.*((cosd(q2).*cosd(q3))-(sind(q2).*sind(q3))))+d1;
Can anyone pls show me how to plot the Px,Py,Pz graph?
Thanks
a1=150;
a2=600;
a3=100;
d1=400;
d4=600;
q1=linspace(-170,170);
q2=linspace(-90,155);
q3=linspace(-170,190);
Px=(a1.*(cosd(q1)))+(a2.*((cosd(q1).*cosd(q2))-(sind(q1).*sind(q2))))+(a3.*((cosd(q1).*cosd(q2))-(sind(q1).*sind(q2))).*(cosd(q3)))+(d4.*(cosd(q1)).*((sind(q2).*cosd(q3))+(cosd(q2).*sind(q3))));
Py=(a1.*(sind(q1)))+(a2.*(sind(q1)).*(cosd(q2)))+(a3.*(sind(q1)).*((cosd(q2).*cosd(q3))-(sind(q2).*sind(q3))))+(d4.*(sind(q3)).*((sind(q1).*cosd(q2))+(cosd(q1).*sind(q2))));
Pz=(a2.*(sind(q2)))+(a3.*((sind(q2).*cosd(q3))+(cosd(q2).*sind(q3))))-(d4.*((cosd(q2).*cosd(q3))-(sind(q2).*sind(q3))))+d1;
Can anyone pls show me how to plot the Px,Py,Pz graph?
Thanks





RE: Need help! Plotting a 3d model of a robot arm workspace!
You need to add bones and flesh to the 3d points that you have created. That is amazingly tiresome to do properly, you will need to add orientation points to each rigid body.
Then you could create a subroutine that can work out the screen coordinates of a given 3d location.
You will need to use similar triangles if you do it the way I did it.
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Need help! Plotting a 3d model of a robot arm workspace!
RE: Need help! Plotting a 3d model of a robot arm workspace!
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.