0% found this document useful (0 votes)
48 views16 pages

Report Robotics - MINI PROJECT - MCTE 4352 (2023)

The document describes path planning for a SCARA robot to write the letters FAR. Coordinates for the letters are determined and inverse kinematics are used to calculate the corresponding joint angles. A table shows the coordinates and joint angles needed to trace out each letter. The path creates a closed loop and accounts for the pen tip being below the end effector.

Uploaded by

Fareez
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)
48 views16 pages

Report Robotics - MINI PROJECT - MCTE 4352 (2023)

The document describes path planning for a SCARA robot to write the letters FAR. Coordinates for the letters are determined and inverse kinematics are used to calculate the corresponding joint angles. A table shows the coordinates and joint angles needed to trace out each letter. The path creates a closed loop and accounts for the pen tip being below the end effector.

Uploaded by

Fareez
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/ 16

MINI PROJECT

ROBOTICS
MCTE 4352

NAME: MUHAMMAD FAREEZ IQMAL BIN MOHD SHARIPUDDIN


MATRIC NO.: 1914577
SECTION: 1
LECTURER: ASSOC. PROF. DR. TANVEER SALEH
TABLE OF CONTENTS

1. FORWARD KINEMATICS ANALYSIS ............................................................................. 3

2. PATH PLANNING ................................................................................................................ 6

3. JOINT VARIABLES MOTION .......................................................................................... 13

4. APPENDIX .......................................................................................................................... 14

2
1. FORWARD KINEMATICS ANALYSIS

SCARA manipulator robot analysis:

Figure 1 SCARA Manipulator diagram

From the frame analysis above, a Denavit–Hartenberg (DH) parameters can be obtained as

the following:

Table 1 DH Table

a α d θ

Link 0 - 1 a1 0 d1 θ1 *

Link 1 – 2 a2 0 0 θ2 *

Link 2 - 3 0 0 d3* 0

Link 3 -4 0 0 0 θ3 *

Where according to the robot’s dimension:

• a1 = 225

• a2 = 225
3
• d1 = 337

• d3 = 526

θ1*, θ2*, d3*, θ3* are joint variables.

Robotics Toolbox (v10) by Peter Corke is used for all the numerical analyses. The SCARA

robot can be set up by defining all the links according to the DH parameters. Then, the links

can be joined together as SerialLink.

MATLAB output

My SCARA:: 4 axis, RRPR, stdDH, slowRNE

+---+-----------+-----------+-----------+-----------+-----------+

| j | theta | d | a | alpha | offset |

+---+-----------+-----------+-----------+-----------+-----------+

| 1| q1| 337| 225| 0| 0|

| 2| q2| 0| 225| 3.14159| 0|

| 3| 0| q3| 0| 0| 0|

| 4| q4| 0| 0| 0| 0|

+---+-----------+-----------+-----------+-----------+-----------+

q1, q2, q3, q4 are links variable. They correspond to θ1*, θ2*, d3*, θ3* respectively.

Letting the initial joint variable as: q1 = 0, q2 = 0, q3 = 1, q4 = 0,

The forward kinematics can be obtained by using SerialLink.fkine function.

MATLAB output

4
T =

1 0 0 450

0 -1 0 0

0 0 -1 335.4

0 0 0 1

T is a 4x4 matrix

Visualising the robot will yield as below:

Figure 2 Forward kinematics

5
2. PATH PLANNING

First, the coordinate for the letters (FAR) is determined. The resultant output of the outer

coordinate of the letters is in XY space. Hence, some adjustments are made in Microsoft

Excel to connect the incomplete path (to make it a closed loop) and addition of Z space.

Figure 3 Glyphs coordinate top view

Figure 4 Glyphs coordinate side view

6
The coordinates are then used to calculate inverse kinematics of the end-effector using

SerialLink.ikine function. Initial estimate of the joint coordinates is specified to be

non-zeros.

The z position to write the text is set to be 106 to take into account the tip of the pen which is

4cm below the end-effector.

Table 2 below shown the glyphs coordinates with the value of the joint variable that has been

calculated.

Table 2 Glyphs coordinate and joint variables (q1 and q2 are in radians)

GLYPHS COORDINATES JOINT VARIABLES


x y z q1 q2 q3 q4
26.72 -19.09 200.00 0.88 -3.00 137.00 0.00
26.72 -19.09 106.00 0.88 -3.00 231.00 0.00
26.72 -37.83 106.00 0.51 -2.94 231.00 0.00
35.40 -37.83 106.00 0.64 -2.91 231.00 0.00
37.39 -37.83 106.00 0.66 -2.90 231.00 0.00
38.85 -37.39 106.00 0.68 -2.90 231.00 0.00
39.78 -36.51 106.00 0.71 -2.90 231.00 0.00
40.71 -35.63 106.00 0.73 -2.90 231.00 0.00
41.32 -33.89 106.00 0.76 -2.90 231.00 0.00
41.63 -31.29 106.00 0.81 -2.91 231.00 0.00
42.93 -31.29 106.00 0.82 -2.90 231.00 0.00
42.93 -47.43 106.00 0.59 -2.86 231.00 0.00
41.63 -47.43 106.00 0.58 -2.86 231.00 0.00
41.60 -45.57 106.00 0.60 -2.87 231.00 0.00
41.36 -44.21 106.00 0.62 -2.87 231.00 0.00
40.90 -43.35 106.00 0.62 -2.88 231.00 0.00
40.45 -42.48 106.00 0.63 -2.88 231.00 0.00
39.81 -41.83 106.00 0.63 -2.88 231.00 0.00
39.01 -41.40 106.00 0.63 -2.89 231.00 0.00
38.20 -40.96 106.00 0.63 -2.89 231.00 0.00
37.00 -40.75 106.00 0.61 -2.90 231.00 0.00
35.40 -40.75 106.00 0.60 -2.90 231.00 0.00
26.72 -40.75 106.00 0.47 -2.92 231.00 0.00
26.72 -55.72 106.00 0.31 -2.87 231.00 0.00
26.72 -58.14 106.00 0.29 -2.86 231.00 0.00
26.87 -59.73 106.00 0.28 -2.85 231.00 0.00
27.18 -60.50 106.00 0.27 -2.85 231.00 0.00
27.41 -61.09 106.00 0.27 -2.84 231.00 0.00

7
27.90 -61.59 106.00 0.27 -2.84 231.00 0.00
28.65 -62.02 106.00 0.28 -2.84 231.00 0.00
29.68 -62.58 106.00 0.29 -2.83 231.00 0.00
30.76 -62.86 106.00 0.30 -2.83 231.00 0.00
31.89 -62.86 106.00 0.31 -2.83 231.00 0.00
33.61 -62.86 106.00 0.33 -2.82 231.00 0.00
33.61 -64.16 106.00 0.32 -2.82 231.00 0.00
13.15 -64.16 106.00 0.06 -2.85 231.00 0.00
13.15 -62.86 106.00 0.06 -2.86 231.00 0.00
14.84 -62.86 106.00 0.09 -2.85 231.00 0.00
16.80 -62.86 106.00 0.12 -2.85 231.00 0.00
18.23 -62.29 106.00 0.14 -2.85 231.00 0.00
19.13 -61.14 106.00 0.16 -2.86 231.00 0.00
19.69 -60.39 106.00 0.17 -2.86 231.00 0.00
19.97 -58.58 106.00 0.19 -2.87 231.00 0.00
19.97 -55.72 106.00 0.21 -2.88 231.00 0.00
19.97 -24.93 106.00 0.60 -3.00 231.00 0.00
19.97 -22.51 106.00 0.66 -3.01 231.00 0.00
19.82 -20.92 106.00 0.69 -3.01 231.00 0.00
19.51 -20.14 106.00 0.71 -3.02 231.00 0.00
19.28 -19.56 106.00 0.72 -3.02 231.00 0.00
18.80 -19.05 106.00 0.72 -3.02 231.00 0.00
18.07 -18.63 106.00 0.71 -3.03 231.00 0.00
17.06 -18.07 106.00 0.70 -3.03 231.00 0.00
15.98 -17.79 106.00 0.68 -3.04 231.00 0.00
14.84 -17.79 106.00 0.64 -3.04 231.00 0.00
13.15 -17.79 106.00 0.59 -3.04 231.00 0.00
13.15 -16.49 106.00 0.63 -3.05 231.00 0.00
48.62 -16.49 106.00 1.13 -2.91 231.00 0.00
49.08 -26.96 106.00 0.94 -2.89 231.00 0.00
47.85 -26.96 106.00 0.94 -2.90 231.00 0.00
47.24 -24.74 106.00 0.97 -2.90 231.00 0.00
46.53 -23.10 106.00 0.99 -2.91 231.00 0.00
45.72 -22.06 106.00 1.01 -2.92 231.00 0.00
44.91 -21.02 106.00 1.02 -2.92 231.00 0.00
43.92 -20.26 106.00 1.03 -2.93 231.00 0.00
42.73 -19.79 106.00 1.03 -2.93 231.00 0.00
41.55 -19.32 106.00 1.03 -2.94 231.00 0.00
39.71 -19.09 106.00 1.02 -2.95 231.00 0.00
37.23 -19.09 106.00 1.00 -2.96 231.00 0.00
26.72 -19.09 106.00 0.88 -3.00 231.00 0.00
26.72 -19.09 200.00 0.88 -3.00 137.00 0.00
80.68 -48.20 200.00 0.82 -2.72 137.00 0.00
80.68 -48.20 106.00 0.82 -2.72 231.00 0.00
62.23 -48.20 106.00 0.74 -2.79 231.00 0.00
58.99 -55.72 106.00 0.63 -2.78 231.00 0.00

8
58.20 -57.57 106.00 0.61 -2.78 231.00 0.00
57.80 -58.96 106.00 0.59 -2.77 231.00 0.00
57.80 -59.87 106.00 0.58 -2.77 231.00 0.00
57.80 -60.60 106.00 0.57 -2.77 231.00 0.00
58.14 -61.24 106.00 0.57 -2.76 231.00 0.00
58.83 -61.79 106.00 0.57 -2.76 231.00 0.00
59.53 -62.34 106.00 0.57 -2.76 231.00 0.00
61.02 -62.70 106.00 0.58 -2.75 231.00 0.00
63.32 -62.86 106.00 0.59 -2.74 231.00 0.00
63.32 -64.16 106.00 0.58 -2.74 231.00 0.00
48.30 -64.16 106.00 0.47 -2.78 231.00 0.00
48.30 -62.86 106.00 0.48 -2.79 231.00 0.00
50.30 -62.51 106.00 0.50 -2.78 231.00 0.00
51.59 -62.05 106.00 0.51 -2.78 231.00 0.00
52.17 -61.49 106.00 0.52 -2.78 231.00 0.00
53.37 -60.36 106.00 0.54 -2.78 231.00 0.00
54.69 -58.08 106.00 0.58 -2.79 231.00 0.00
56.14 -54.63 106.00 0.62 -2.79 231.00 0.00
72.91 -15.40 106.00 1.20 -2.81 231.00 0.00
74.14 -15.40 106.00 1.20 -2.80 231.00 0.00
90.74 -55.05 106.00 0.79 -2.67 231.00 0.00
92.07 -58.24 106.00 0.76 -2.65 231.00 0.00
93.29 -60.31 106.00 0.75 -2.64 231.00 0.00
94.38 -61.26 106.00 0.74 -2.64 231.00 0.00
95.47 -62.21 106.00 0.74 -2.63 231.00 0.00
96.98 -62.74 106.00 0.74 -2.62 231.00 0.00
98.93 -62.86 106.00 0.74 -2.61 231.00 0.00
98.93 -64.16 106.00 0.73 -2.61 231.00 0.00
80.12 -64.16 106.00 0.67 -2.68 231.00 0.00
80.12 -62.86 106.00 0.68 -2.69 231.00 0.00
82.02 -62.77 106.00 0.69 -2.68 231.00 0.00
83.30 -62.45 106.00 0.69 -2.67 231.00 0.00
83.97 -61.91 106.00 0.70 -2.67 231.00 0.00
84.64 -61.37 106.00 0.71 -2.67 231.00 0.00
84.97 -60.71 106.00 0.72 -2.67 231.00 0.00
84.97 -59.94 106.00 0.72 -2.68 231.00 0.00
84.97 -58.91 106.00 0.73 -2.68 231.00 0.00
84.50 -57.28 106.00 0.75 -2.68 231.00 0.00
83.57 -55.05 106.00 0.76 -2.69 231.00 0.00
79.70 -45.60 106.00 0.85 -2.73 231.00 0.00
71.61 -26.33 106.00 1.05 -2.80 231.00 0.00
63.32 -45.60 106.00 0.77 -2.79 231.00 0.00
79.68 -45.60 106.00 0.85 -2.73 231.00 0.00
79.68 -45.60 200.00 0.85 -2.73 137.00 0.00
149.94 -64.16 200.00 0.80 -2.40 137.00 0.00
149.94 -64.16 106.00 0.80 -2.40 231.00 0.00

9
137.21 -64.16 106.00 0.79 -2.45 231.00 0.00
121.08 -41.87 106.00 0.95 -2.56 231.00 0.00
119.88 -41.92 106.00 0.95 -2.57 231.00 0.00
118.91 -41.94 106.00 0.95 -2.57 231.00 0.00
118.16 -41.94 106.00 0.95 -2.58 231.00 0.00
117.86 -41.94 106.00 0.95 -2.58 231.00 0.00
117.53 -41.94 106.00 0.95 -2.58 231.00 0.00
117.18 -41.92 106.00 0.95 -2.58 231.00 0.00
116.82 -41.91 106.00 0.95 -2.58 231.00 0.00
116.46 -41.89 106.00 0.95 -2.58 231.00 0.00
116.09 -41.87 106.00 0.95 -2.59 231.00 0.00
116.09 -55.72 106.00 0.83 -2.56 231.00 0.00
116.09 -58.72 106.00 0.81 -2.56 231.00 0.00
116.41 -60.59 106.00 0.79 -2.55 231.00 0.00
117.07 -61.31 106.00 0.79 -2.55 231.00 0.00
117.96 -62.34 106.00 0.78 -2.54 231.00 0.00
119.30 -62.86 106.00 0.78 -2.53 231.00 0.00
121.08 -62.86 106.00 0.78 -2.53 231.00 0.00
122.94 -62.86 106.00 0.79 -2.52 231.00 0.00
122.94 -64.16 106.00 0.78 -2.52 231.00 0.00
102.52 -64.16 106.00 0.74 -2.60 231.00 0.00
102.52 -62.86 106.00 0.75 -2.60 231.00 0.00
104.31 -62.86 106.00 0.75 -2.59 231.00 0.00
106.32 -62.86 106.00 0.76 -2.59 231.00 0.00
107.77 -62.20 106.00 0.77 -2.58 231.00 0.00
108.63 -60.89 106.00 0.78 -2.58 231.00 0.00
109.13 -60.16 106.00 0.79 -2.58 231.00 0.00
109.37 -58.44 106.00 0.80 -2.58 231.00 0.00
109.37 -55.72 106.00 0.82 -2.59 231.00 0.00
109.37 -24.93 106.00 1.09 -2.64 231.00 0.00
109.37 -21.93 106.00 1.12 -2.64 231.00 0.00
109.04 -20.06 106.00 1.14 -2.64 231.00 0.00
108.39 -19.34 106.00 1.15 -2.65 231.00 0.00
107.47 -18.30 106.00 1.16 -2.65 231.00 0.00
106.11 -17.79 106.00 1.16 -2.66 231.00 0.00
104.31 -17.79 106.00 1.16 -2.67 231.00 0.00
102.52 -17.79 106.00 1.17 -2.67 231.00 0.00
102.52 -16.49 106.00 1.18 -2.68 231.00 0.00
119.88 -16.49 106.00 1.16 -2.60 231.00 0.00
124.95 -16.49 106.00 1.16 -2.57 231.00 0.00
128.68 -16.86 106.00 1.15 -2.56 231.00 0.00
131.08 -17.60 106.00 1.14 -2.54 231.00 0.00
133.48 -18.33 106.00 1.13 -2.53 231.00 0.00
135.52 -19.69 106.00 1.12 -2.52 231.00 0.00
137.20 -21.67 106.00 1.10 -2.51 231.00 0.00
138.87 -23.65 106.00 1.08 -2.50 231.00 0.00

10
139.71 -26.02 106.00 1.07 -2.50 231.00 0.00
139.71 -28.76 106.00 1.05 -2.50 231.00 0.00
139.71 -31.69 106.00 1.02 -2.49 231.00 0.00
138.76 -34.23 106.00 1.01 -2.50 231.00 0.00
136.85 -36.39 106.00 0.99 -2.50 231.00 0.00
134.94 -38.54 106.00 0.98 -2.51 231.00 0.00
131.98 -40.07 106.00 0.96 -2.52 231.00 0.00
127.97 -40.96 106.00 0.96 -2.54 231.00 0.00
137.81 -54.63 106.00 0.86 -2.47 231.00 0.00
140.06 -57.77 106.00 0.84 -2.45 231.00 0.00
142.00 -59.86 106.00 0.82 -2.44 231.00 0.00
143.61 -60.89 106.00 0.82 -2.43 231.00 0.00
145.23 -61.92 106.00 0.81 -2.42 231.00 0.00
147.34 -62.58 106.00 0.81 -2.41 231.00 0.00
149.94 -62.86 106.00 0.80 -2.40 231.00 0.00
149.94 -64.16 106.00 0.80 -2.40 231.00 0.00
149.94 -64.16 200.00 0.80 -2.40 137.00 0.00
116.09 -39.66 200.00 0.97 -2.59 137.00 0.00
116.09 -39.66 106.00 0.97 -2.59 231.00 0.00
116.53 -39.66 106.00 0.97 -2.59 231.00 0.00
116.92 -39.66 106.00 0.97 -2.59 231.00 0.00
117.25 -39.67 106.00 0.97 -2.58 231.00 0.00
117.57 -39.69 106.00 0.97 -2.58 231.00 0.00
117.84 -39.69 106.00 0.97 -2.58 231.00 0.00
118.05 -39.69 106.00 0.97 -2.58 231.00 0.00
122.60 -39.69 106.00 0.97 -2.56 231.00 0.00
126.03 -38.71 106.00 0.98 -2.55 231.00 0.00
128.34 -36.74 106.00 0.99 -2.54 231.00 0.00
130.65 -34.77 106.00 1.01 -2.53 231.00 0.00
131.80 -32.26 106.00 1.02 -2.53 231.00 0.00
131.80 -29.21 106.00 1.05 -2.53 231.00 0.00
131.80 -26.24 106.00 1.07 -2.54 231.00 0.00
130.87 -23.82 106.00 1.09 -2.54 231.00 0.00
129.01 -21.96 106.00 1.11 -2.55 231.00 0.00
127.14 -20.09 106.00 1.12 -2.56 231.00 0.00
124.68 -19.16 106.00 1.13 -2.57 231.00 0.00
121.61 -19.16 106.00 1.14 -2.59 231.00 0.00
120.25 -19.16 106.00 1.14 -2.59 231.00 0.00
118.41 -19.38 106.00 1.14 -2.60 231.00 0.00
116.09 -19.83 106.00 1.14 -2.61 231.00 0.00
116.09 -39.66 106.00 0.97 -2.59 231.00 0.00
116.09 -39.66 200.00 0.97 -2.59 137.00 0.00

The resulting drawing is shown:

11
Figure 5 FInal frame of the simulation

The simulation video can be found at: https://youtu.be/GTuyhC20-e0

12
3. JOINT VARIABLES MOTION

Figure 6 Joint q1 (rad.)

Figure 7 Joint q2 (rad.)

Figure 8 Joint q3 (mm)

13
4. APPENDIX

a) MATLAB script to extract coordinates from text glyphs.


Obtained and modified from https://stackoverflow.com/a/41416256/13617136
glyphs_coordinate.m
clear variables

% Import .NET Framework System.Drawing


NET.addAssembly('System.Drawing');

FontData= System.Drawing.Drawing2D.GraphicsPath();

text='FAR';
font=System.Drawing.FontFamily('Times New Roman');
disp(System.Drawing.FontStyle.Regular);
style=cast(System.Drawing.FontStyle.Regular,'int32');
emSize=72;
origin=System.Drawing.Point(0,0);
format=System.Drawing.StringFormat();

FontData.AddString(text,font,style,emSize,origin,format);

%Extract X,Y data from FontData

for i=1:FontData.PathPoints.Length
x(i)=FontData.PathPoints(i).X;
y(i)=-FontData.PathPoints(i).Y;
end

% plot(x,y)

result_matrix = [x ; y ];

% transpose and save matrix to excel


writematrix(result_matrix.', 'glyps_points.xls')

b) Main MATLAB script to do the analysis


robot1914577.m
%% Links variable
%% Set the lengths of each links
a1 = 225; a2 = 225; d1 = 337; d3 = 526;

%% L = Link([Theta d a alpha R/P])


L(1) = Link([0 d1 a1 0 0], 'standard');
L(2) = Link([0 0 a2 pi 0], 'standard');
L(3) = Link([0 d3 0 0 1], 'standard'); % Prismatic joint
L(4) = Link([0 0 0 0 0], 'standard');

MyBot = SerialLink(L, 'name', 'My SCARA')

14
%% Define the initial joint angles
theta = [0, 0, 1, 0]; % [theta1, theta2, theta3, theta4]

%% Calculate the forward kinematics


T = MyBot.fkine(theta)

%% Show what it is look for now


figure
qf = MyBot.ikine(T, 'q0', [.1 -.2 .100 0],'mask', [1 1 1 1 0 0])
MyBot.plot(qf,'workspace',[-25, 460, -180, 240, 0 ,500]);

%% read coordinates (x, y, z) from file


path = readmatrix('FAR_points.csv');

% 'Translate' coordinates to working area


X = path(:,1) + 300;
% [minA, maxA] = bounds(X)
Y = path(:,2) + 200;
% [minA, maxA] = bounds(Y)
Z = path(:,3);

figure
plot3(path(:,1), path(:,2), path(:,3), ".-", "LineWidth", 1,
'MarkerSize',15); grid;
%[X Y Z]

% T1 = transl([X Y Z]); % The translated path not working ie


throwing
% warnings etc
T1 = transl(path);

%% Compute joint angles


% q0 = zeros(MyBot.n, 1); % ???
q0 = [.1 -.2 .100 0]; % some non zero(s) numbers
qs = MyBot.ikine(T1,'q0', q0 ,'mask', [1 1 1 1 0 0]);

%% Joint variable motion


figure
subplot(3,1,1); plot(qs(:,1),"r", "LineWidth", 1.4);
xlabel('Time (s)'); ylabel('Joint 1 (rad)');
subplot(3,1,2); plot(qs(:,2),"r", "LineWidth", 1.4);
xlabel('Time (s)'); ylabel('Joint 2 (rad)');
subplot(3,1,3); plot(qs(:,3),"r", "LineWidth", 1.4);
xlabel('Time (s)'); ylabel('Joint 3 (mm)');

%% Move robot to desired end-effector poses


figure
MyBot.plot(qs,'workspace',[-25, 460, -180, 240, 0 ,500],
'noloop', 'trail', 'r');
MyBot.move(qs);

15
16

You might also like