Está en la página 1de 4

>> syms q1 q2 q3 l1 l2 real

dh=[0 0 q1 0 0;
0 l1 q2 0 0;
0 l2 q3 0 0];
T01=[cos(q1) -sin(q1) 0 0
sin(q1) cos(q1) 0 0
0
0
1 0
0
0
0 1];
T12=[cos(q2) -sin(q2) 0 l1*cos(q2)
sin(q1) cos(q1) 0 l1*sin(q2)
0
0
1
0
0
0
0
1];
T23=[cos(q3) -sin(q3) 0 l2*cos(q3)
sin(q3) cos(q3) 0 l2*sin(q3)
0
0
1
0
0
0
0
1];
T03=T01*T12*T23;
T03=simplify(T03);
q1=pi/4;
q2=pi/3;
q3=-pi/3;
l1=0.4;
l2=0.4;
T01=eval(T01);
T12=eval(T12);
T23=eval(T23);
T03=eval(T03);
T22=T12*T23;
TA=eye(4);
>> frame(TA,'r',0.05)
ans =
0.0040
>> frame(T01,'b',0.05)
ans =
182.0040
>> frame(T12,'c',0.05)
ans =
187.0040
>> frame(T22,'m',0.05)
ans =

192.0040
>> hold
Current plot held
>> plot([0 T12(1,4)],[0 T12(2,4)],'K','linewidth',5)
>> plot([T12(1,4) T22(1,4)],[T12(2,4) T22(2,4)],'K','linewidth',5)
>> grid
>>
>> syms q1 d2 q3 l2 real
>> T1=linktrans([0 0 pi/3 0 0],q1)
T1 =
[ cos(q1), -sin(q1), 0, 0]
[ sin(q1), cos(q1), 0, 0]
[
0,
0, 1, 0]
[
0,
0, 0, 1]
>> T2=linktrans([pi/2 0 0 0.5 1],d2)
T2 =
[
[
[
[

1,
0,
0,
0,

0,
0,
1,
0,

0,
-1,
0,
0,

0]
-d2]
0]
1]

>> T3=linktrans([0 0 pi/4 10 0],q3)


T3 =
[ cos(q3), -sin(q3), 0, 0]
[ sin(q3), cos(q3), 0, 0]
[
0,
0, 1, 10]
[
0,
0, 0, 1]
>>
>>
>>
>>
>>
>>
>>
>>

TA=eye(4);
q1=pi/3;
d2=0.6;
q3=pi/4;
T1=eval(T1);
T2=eval(T2);
T3=eval(T3);
frame(TA,'c',0.5)

ans =
0.0043

>> frame(T1,'g',0.5)
ans =
196.0043
>> frame(T2,'r',0.5)
ans =
201.0043
>> grid
>> syms q1 d2 q3 l2 real
dh=[0 0 q1 0 0;
pi/2 0 0 d2 1;
0 0 q3 l2 0];
>> T1=linktrans([0 0 pi/3 0 0],q1)
T1 =
[ cos(q1), -sin(q1), 0, 0]
[ sin(q1), cos(q1), 0, 0]
[
0,
0, 1, 0]
[
0,
0, 0, 1]
>> T2=linktrans([pi/2 0 0 426 1],d2)
T2 =
[
[
[
[

1,
0,
0,
0,

0,
0,
1,
0,

0,
-1,
0,
0,

0]
-d2]
0]
1]

>> T3=linktrans([0 0 pi/4 10 0],q3)


T3 =
[ cos(q3), -sin(q3), 0, 0]
[ sin(q3), cos(q3), 0, 0]
[
0,
0, 1, 10]
[
0,
0, 0, 1]
>>
>> syms q1 d2 real
dh=[0 0 q1 0 0;
pi/2 0 0 d2 1];
>> q=[q1 d2];

>> T=fkine(dh,q);
>> T=simplify(T)
T=
[ cos(q1), 0, sin(q1), d2*sin(q1)]
[ sin(q1), 0, -cos(q1), -d2*cos(q1)]
[
0, 1,
0,
0]
[
0, 0,
0,
1]
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

figure
[x,y]=meshgrid(-1:0.1:1,-1:0.1:1);
q1=atan2(x,-y);
surfl(x,y,q1)
xlabel('Eje X(m)'),ylabel('Eje Y(m)'),zlabel('\theta_1 (rad)')
d2=sqrt(x.^2+y.^2);
figure
surfl(x,y,d2);
xlabel('Eje X(m)')
ylabel('Eje Y(m)')
zlabel('d_2 (m)')

También podría gustarte