-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRRP
More file actions
36 lines (20 loc) · 725 Bytes
/
Copy pathRRP
File metadata and controls
36 lines (20 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
delete(instrfindall);
comport = serial('COM3','BaudRate',115200);
fopen(comport);
for i=1:100
y(i)=fscanf(comport,'%d');
z(i)=fscanf(comport,'%d');
k(i)=fscanf(comport,'%d');
a1=(y(i)/3.72);
a2=(z(i)/3.72);
a3=(k(i)/3.72);
T1=[cos(a1) -sin(a1) 0 0;sin(a1) cos(a1) 0 0;0 0 1 h1;0 0 0 1];%% BURADAKİ H1 DEGERİNİ DEGİŞTİRİN H1 DEGERİ İLK UZUNLUK
T2=[cos(a2) -sin(a2) 0 0;0 0 -1 -d2;sin(a2) cos(a2) 0 0;0 0 0 1];%%BURDAKİ D2 DEGERİNİ DEGİŞTİRİN BAŞINDAKİ İKİNCİ KOLUN UZUNLUGU
T3=[1 0 0 0;0 0 1 (I2+I3);0 -1 0 0;0 0 0 1];%%I2 VE I3 DEGERİNİ DEGİŞTİRİN 3. KOLUN TOPLAM UZUNLUGU
Z=T1*T2*T3;
Px = 'Px %f. Py %f Pz %f';
A1 = Z(13);
A2 = Z(14);
A3= Z(15);
Konum = sprintf(Px,A1,A2,A3)
end