kuv
Mechanical
- Nov 29, 2003
- 8
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