0% found this document useful (0 votes)
33 views3 pages

MATLAB Command Window: The Phi Apim1 Aim1 Ti Di L1 L2 L3 t1 t2 t3

The document defines transformation matrices (T) to represent the kinematics of a 3-link robot arm using Denavit-Hartenberg parameters. It then evaluates these matrices for 3 test cases with different joint angle configurations (θ1, θ2, θ3) and link lengths (L1, L2, L3).

Uploaded by

jiyoungryu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views3 pages

MATLAB Command Window: The Phi Apim1 Aim1 Ti Di L1 L2 L3 t1 t2 t3

The document defines transformation matrices (T) to represent the kinematics of a 3-link robot arm using Denavit-Hartenberg parameters. It then evaluates these matrices for 3 test cases with different joint angle configurations (θ1, θ2, θ3) and link lengths (L1, L2, L3).

Uploaded by

jiyoungryu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

MATLAB Command Window

>> % Declare the symbolic variables


syms the phi apim1 aim1 ti di L1 L2 L3 t1 t2 t3
% Enter the formula for T T:(i-1)-->(i)
T= [cos(ti) -sin(ti) 0 aim1;...
sin(ti)*cos(apim1) cos(ti)*cos(apim1) -sin(apim1) -sin(apim1)*di;...
sin(ti)*sin(apim1) cos(ti)*sin(apim1) cos(apim1) cos(apim1)*di;...
0 0 0 1];
% DH Parameters for i=1
T10=eval(subs(T,{apim1,aim1,di,ti},{0,0,0,t1}));
% DH Parameters for i=2
T21=eval(subs(T,{apim1,aim1,di,ti},{0,L1,0,t2}));
% DH Parameters for i=3
T32=eval(subs(T,{apim1,aim1,di,ti},{0,L2,0,t3}));
%TH3
TH3=eval(subs(T,{apim1,aim1,di,ti},{0,L3,0,0}));
T30=simplify(T10*T21*T32);
TH0=simplify(T10*T21*T32*TH3);
T30abb1=sym(regexprep(char(T30),'cos','c'));
T30abb=sym(regexprep(char(T30abb1),'sin','s'))
TH0abb1=sym(regexprep(char(TH0),'cos','c'));
TH0abb=sym(regexprep(char(TH0abb1),'sin','s'))
%Case i)
L=[4 3 2];
the1=pi/180.*[0 0 0];
T30case1=eval(subs(T30,{t1,t2,t3,L1,L2,L3},{the1(1),the1(2),the1(3),L(1),L(2),L(3)}))
TH0case1=eval(subs(TH0,{t1,t2,t3,L1,L2,L3},{the1(1),the1(2),the1(3),L(1),L(2),L(3)}))
%Case ii)
the2=pi/180.*[10 20 30];
T30case2=eval(subs(T30,{t1,t2,t3,L1,L2,L3},{the2(1),the2(2),the2(3),L(1),L(2),L(3)}))
TH0case2=eval(subs(TH0,{t1,t2,t3,L1,L2,L3},{the2(1),the2(2),the2(3),L(1),L(2),L(3)}))
%Case iii)
the3=pi/180.*[90 90 90];
T30case3=eval(subs(T30,{t1,t2,t3,L1,L2,L3},{the3(1),the3(2),the3(3),L(1),L(2),L(3)}))
TH0case3=eval(subs(TH0,{t1,t2,t3,L1,L2,L3},{the3(1),the3(2),the3(3),L(1),L(2),L(3)}))
T30abb =
[ c(t1 + t2 + t3), -s(t1 + t2 + t3), 0, L2*c(t1 + t2) + L1*c(t1)]
[ s(t1 + t2 + t3), c(t1 + t2 + t3), 0, L2*s(t1 + t2) + L1*s(t1)]
[
0,
0, 1,
0]
[
0,
0, 0,
1]

TH0abb =

Page 1

MATLAB Command Window

Page 2

[ c(t1 + t2 + t3), -s(t1 + t2 + t3), 0, L2*c(t1 + t2) + L1*c(t1) + L3*c(t1 + t2 + t3)]


[ s(t1 + t2 + t3), c(t1 + t2 + t3), 0, L2*s(t1 + t2) + L1*s(t1) + L3*s(t1 + t2 + t3)]
[
0,
0, 1,
0]
[
0,
0, 0,
1]

T30case1 =
1
0
0
0

0
1
0
0

0
0
1
0

7
0
0
1

0
1
0
0

0
0
1
0

9
0
0
1

TH0case1 =
1
0
0
0

T30case2 =
0.5000
0.8660
0
0

-0.8660
0.5000
0
0

0
0
1.0000
0

6.5373
2.1946
0
1.0000

-0.8660
0.5000
0
0

0
0
1.0000
0

7.5373
3.9266
0
1.0000

TH0case2 =
0.5000
0.8660
0
0

T30case3 =
0
-1
0
0

1
0
0
0

0
0
1
0

-3
4
0
1

-3

TH0case3 =
0

MATLAB Command Window


-1
0
0
>>

0
0
0

0
1
0

2
0
1

Page 3

You might also like