0% found this document useful (0 votes)
32 views33 pages

Robotics Lab Journal: ECS Program

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

Robotics Lab Journal: ECS Program

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

Mahavir Education Trust's

SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE


Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

Name: Pratik Sakharam Waghmare


Roll No: 60
Academic
2023 – 2024
Year:

BE Sem VIII
Electronics and Computer Science
Robotics Laboratory Journal
(ECL801)

1
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

Institute Vision and Mission


Vision
To become globally recognized institution offering quality education and enhancing professional
standards.
Mission
To impart high quality technical education to the students by providing an excellent academic
environment, well equipped laboratories and training through the motivated teachers.
ECS Department Vision and Mission
Vision
Impart quality education in Electronics and computer science engineering to create world class
technocrats and entrepreneurs to meet industry standards.
Mission
M1: To deliver quality academic program in electronics and computer science engineering.
M2: To develop skilled professionals capable of providing Electronics and computer-based
solutions giving emphasis to R&D for meeting industrial challenges.
M3: To improve employability and entrepreneurship of electronics and computer science
engineers with ethical and professional approach

2
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

PROGRAM OUTCOMES: (POs)


1) Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals,
and an engineering specialization for the solution of complex engineering problems.
2) Problem analysis: Identify, formulate, research literature, and analyze complex engineering
problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and
engineering sciences.
3) Design/Development of Solutions: Design solutions for complex engineering problems and design
system components or processes that meet the specified needs with appropriate consideration for public
health and safety, and cultural, societal, and environmental considerations.
4) Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data and synthesis of the
information to provide valid conclusions.
5) Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with an
understanding of the limitations.
6) The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal, and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
7) Environment and sustainability: Understand the impact of the professional engineering solutions in
societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable
development.
8) Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of
the engineering practice.
9) Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
10) Communication: Communicate effectively on complex engineering activities with the engineering
community and with the society at large, such as, being able to comprehend and write effective reports
and design documentation, make effective presentations, and give and receive clear instructions.
11) Project management and finance: Demonstrate knowledge and understanding of the engineering
and management principles and apply these to one’s own work, as a member and leader in a team, to
manage projects and in multidisciplinary environments.
12) Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.

PROGRAM EDUCATIONAL OBJECTIVES (PEOs)


PEO1: To develop a strong foundation of engineering fundamentals to build successful
careers maintaining high ethical standards.
PEO2: To equip graduates to pursue higher studies and research activities while
3
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

accomplishing lifetime learning.


PEO3: To inculcate team spirit and leadership qualities in graduates with the ability to
become Entrepreneurs in multi-disciplinary fields recognised globally.

PROGRAM SPECIFIC OUTCOMES (PSO's)


• PSO1-Students will be able to analyse real world problems,design and develop financially
viable andethical solutions based on electronics and computer science.
• PSO2- Students will be able to work professionallyfor the benefit of society andpursue research
and higher studies

Prof. Nandkishor Narkhede


NBA Program Co-ordinator

4
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

Course Outcomes (CO)


CO No. CO Statement (At the end of the course, students will be able to BL
…)
1 Identify the major technologies, languages, applications, social, 1
economic and ethical consequences of a robotic manipulator.
(Remembering)

2 Explain methods for describing robots locations, orientations and 2


movements .(Understanding)
3 Apply kinematics ,and vision system algorithms for a robot.(Applying) 3
4 Analyze the kinematics, trajectories for the robot and shape analysis of 4
objects encountered by the robot.(Analyze)
5 Select various algorithms for robot vision ,task planning and trajectory 5
planning.(Evaluate)
6 Integrate kinematics, task planning ,trajectory planning and robot vision, 6
using suitable robot languages based on applications to control
robots(Creating)

Laboratory Outcomes (LO)

LO No. LO Statement (At the end of the course, students will be able to …) BL
1 To illustrate coordinate transformations. (Application) 3

2 To solve direct kinematics of different robots. (Application) 3

3 To solve inverse kinematics of different robots.(Application) 3

To select image processing algorithms for robot vision.


4 4
(Analyzing)

5 To explain trajectory planning using various algorithms 5

6 To generalize from given facts and relate knowledge from several areas 6

5
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

List of Experiments

Sr. LO PSO PI
Title
No.
1 STUDY OF ROBOTIC MANIPULATORS 1 1 1.2.2,1.7.1,4.4.3

2 A PROGRAM TO IMPLEMENT COORDINATE 1 1 1.2.2,1.7.1,4.4.3


TRANSFORMATIONS

3 A PROGRAM TO IMPLEMENT HOMOGENEOUS 1 1 1.2.2,1.7.1,4.4.3


TRANSFORMATIONS

4 A PROGRAM TO IMPLEMENT DIRECT 2 1 1.2.2,1.7.1,4.4.3


KINEMATICS

5 A PROGRAM TO IMPLEMENT INVERSE 3 1 1.2.2,1.7.1,4.4.3


KINEMATICS

6 A PROGRAM TO IMPLEMENT TEMPLATE 4 2 1.2.2,1.7.1,2.8.2,3.


MATCHING 8.2,4.4.3,5.4.1

7 A PROGRAM TO IMPLEMENT TRAJECTORY 5 2 1.2.2,1.7.1,2.8.2,3.


PLANNING 8.2,4.4.3

8 MINIPROJECT 6 2 1.2.2,1.7.1,2.8.2,3.
8.2,4.4.3,5.4.1,
6.1.17.1.1,,8.1.1,8.2.
2,9.1.1,9.2.2,9.2.3,9.
3.1,10.3.1,11.3.1,11.
3.2,12.1.1

6
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

Subject: Course: ECS


INDEX
Initials of
Sr. Date of Pag
Title of Date of Teacher
No Performanc e Grade
Experiment/Assignment/Tutorial Submission with
. e No.
Remarks
01 Study of Robotic Manipulators
A program to implement
02 coordinate transformation
A program to implement
homogeneous coordinate
03 transformation
A program to implement direct
04 kinematics
A program to implement inverse
05 kinematics
A program to implement template
06 matching
A program to implement
07 trajectory planning
Mini project- Robot
08 Classification

Grade
Overal
Practicals/TutoriaIs l
Grade
Assignment/Report Writing & Presentation/Group Discussion
Internal Assessments marks IA1....... & IA2 ....... out of ............
Average =…..

This is to certify that Shri/Kum ...........................................................................................Roll No……………….


Batch..............................Registration No........................................Semester……………… has completed the
specified term-work in the subject of …………………………………………………….in a satisfactory manner
in the college during the academic year of 20….. to 20……

Examiner’s Signature with Date:

1………………………………
7
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

2………………………………

Staff Member In-charge Head of Dept. Principal

8
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

EXPERIMENT NO: 1
STUDY OF ROBOTIC MANIPULATORS

9
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

EXPERIMENT NO:1
STUDY OF ROBOTIC MANIPULATORS
Aim: Study of given robot models and determine the Work Space
Envelope of SCARA robot

Theory:

Work Space Envelope: The locus of all the points traced by the tip of the end
effectors in the three-dimensional space is defined as WSE. The area in which
robot can do useful work is work envelope area. The geometry of the work
envelope is determined by the sequence of joints used for the first three axes.

Robots are classified based on the work envelope geometry as

Cartesian Robot: The three major axes of a Cartesian robot are all prismatic. The
prismatic joints correspond to moving the wrist up and down, in and out and back
and forth.

Cylindrical Robot:If the first joint of the Cartesian robot is replaced with revolute
joint it becomes a cylindrical robot.the configuration of cylindrical robot is RPP.
(R-revolute,P-prismatic).The first revolute joint swings the arm back and forth
about a vertical base axis.The second prismatic joint then move the wrist up and
down along vertical axis and the third prismatic joint moves the wrist in and out
along the radial axis.Since there will be some radial position work envelope
generated by this configuration is the volume between two vertical concentric
cylinders.
Spherical Robot: If the second joint of a cylindrical robot is replaced by a revolute
joint we get a spherical robot.The first revolute joint swings the arm back and forth
about the vertical axis while the second revolute joint pitches the arm up and down
about a horizontal shoulder axis.The prismatic joint moves the wrist radially in and
out.The work envelope generated is the volume between two spheres

SCARA Robot SCARA is Selective Compliance Assembly Robot Arm. robot has
two revolute joints and one prismatic joint to position the wrist. for a SCARA robot
the axes of all the three joints are vertical The first revolute joint swings the arm
10
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

back and forth about a base axis that can also be thought of asa vertical shoulder
axes .the second revolute joint swings the forearm back and forth about vertical
elbow axis. Thus two revolute joints control motion in a horizontal position The
vertical component of the motion is provided by third joint which slides wrist up
and down.
The work envelope of SCARA robot can be complex depending upon the limits on
the ranges of travel for the first two axes.
Articulated Robot:An articulated robot is the dual of Cartesian robot in the sense
all three of the major axes are revolute rather than prismatic.

The first revolute joint swings the robot back and forth about a vertical base axis.
The second joint pitches arm up and down about a horizontal shoulder axis and
the third joint pitches the forearm up and down about horizontal elbow axis.

Conclusion:Studied and determined the work space envelope of various robots.

11
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

EXPERIMENT NO:2
A PROGRAM TO IMPLEMENT COORDINATE TRANSFORMATION

12
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

Experiment No:2
A program to implement Coordinate Transformation

Aim: Implement Coordinate Transformation problem and verify YPR is equivalent


to RPY
Theory:
Rotation: It is defined as the movement of rigid body about particular axis and is
mathematically represented by rotation matrix.
Rotation matrix: A 3X3 matrix is used to describe the rotation of a body w.r.t a
standard frame of reference.
Fundamental Rotation matrices:If M is rotated about F then the resulting
rotational matrices are called as fundamental rotational matrices.
First Fundamental Rotation Matrix R1(θ)

Let F= {f1,f2,f3}and M={m1,m2,m3} be two RHOCF which are coincident. The


first FRM is obtained by the rotation of M frame about f1 axis of F by an amount
ϴ as shown.

1 0 0
R1(θ) = ⌈ 0 cos ⁡( θ) −sin ⁡(θ) ⌉
0 sin ⁡(θ) cos ⁡(θ)

Second Fundamental Rotation Matrix R2(θ)

Let F= {f1,f2,f3}and M={m1,m2,m3} be two RHOCF which are coincident. The


second FRM is obtained by the rotation of M frame about f2 axis of F by an
amount ϴ as shown.

cos ⁡(θ) 0 sin ⁡( θ)


R2(θ) = ⌈ 0 1 0
¿ ¿ ¿

Third Fundamental Rotation Matrix R3(θ)

Let F= {f1,f2,f3}and M={m1,m2,m3} be two RHOCF which are coincident. The


third FRM is obtained by the rotation of M frame about f3 axis of F by an amount
ϴ as shown.
13
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

R3(θ) = ⌈ cos ⁡(θ) ¿

CODE:

X1=input ("enter input angle");


X2=input ("enter input angle");
X3=input ("enter input angle");
R1= [1 0 0; 0 cos(X1) -sin(X1); 0 sin(X1) cos(X1)]
R2=[cos(X2) 0 sin(X2); 0 1 0; -sin(X2) 0 cos(X2)]
R3=[cos(X3) -sin(X3) 0; sin(X3) cos(X3) 0; 0 0 1]
PM= [0 0 0.6]
frame=input ("enter the frame")
value=input ("enter the value")
if(frame==1)
if (value == 123)
R= R3*R2*R1
else (value == 321)
R= R1*R2*R3
end
else

if (value == 123)
R= R1*R2*R3
else (value == 231)
R= R2*R1*R3
end
end
PF=R*transpose (PM)

OUTPUT:
14
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

Conclusion: Using fundamental rotation matrices Coordinate Transformation


is performed and implemented and verified YPR is equivalent to RPY in
MATLAB.

15
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

EXPERIMENT NO :3
A PROGRAM TO IMPLEMENT HOMOGENEOUS COORDINATE
TRANSFORMATIONS

16
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

Experiment No 3
A program to implement Homogeneous Coordinate Transformations

Aim:
To implement Composite homogeneous coordinate transformations

Theory :
Algorithm
1. Initialize transformation matrix as Identity matrix
2. Represent rotations and translations using separate HCTM matrix
3. Represent Composite rotations in separate HCTM matrix
4. If the mobile coordinate frame M is to be rotated about or translated along a
unit vector of the fixed coordinate frame F pre multiply the HCTM by the
appropriate fundamental HCTM matrices
5. If the mobile coordinate frame M is to be rotated about or translated along a
unit vector of the mobile coordinate frame M post multiply the HCTM by the
appropriate fundamental HCTM matrices
6. If there are more fundamental rotations or translations go to step 4,else
stop.The resulting CHCTM matrix T transforms mobile M frame coordinates
into F frame coordinates

CODE:
m1 = [1 0 0 1];
T = [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1];
operation = input ("First Operation Rotation or Translation’s");
if operation == 'R'
x = input ("Angle of Rotation");
a = input ("Axis of Rotation");
if a == 1
HR = [1 0 0 0; 0 cos(x) -sin(x) 0; 0 sin(x) cos(x) 0; 0 0 0 1];
elseif a == 2
HR = [cos(x) 0 sin(x) 0; 0 1 0 0; -sin(x) 0 cos(x) 0; 0 0 0 1];
else a = 3;
HR = [cos(x) -sin(x) 0 0; sin(x) cos(x) 0 0; 0 0 1 0; 0 0 0 1];
end

H1 = HR * T;

else operation = 'T';


d = input ("Distance Translated");
a = input ("Axis of Rotation");
if a == 1
HT = [1 0 0 d; 0 1 0 0; 0 0 0 0; 0 0 0 1];
elseif a == 2
HT = [1 0 0 0; 0 1 0 d; 0 0 0 0; 0 0 0 1];
else a == 3
HT = [1 0 0 0; 0 1 0 0; 0 0 0 d; 0 0 0 1];
end

17
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

H1 = HT * T;
end

operation = input ("Second Operation Rotation or Translation’s");


if operation == 'R'
x = input ("Angle of Rotation");
a = input ("Axis of Rotation");
if a == 1
HR = [1 0 0 0; 0 cos(x) -sin(x) 0; 0 sin(x) cos(x) 0; 0 0 0 1];
elseif a == 2
HR = [cos(x) 0 sin(x) 0; 0 1 0 0; -sin(x) 0 cos(x) 0; 0 0 0 1];
else a == 6
HR = [cos(x) -sin(x) 0 0; sin(x) cos(x) 0 0; 0 0 1 0; 0 0 0 1];
end

H2 = HR;

else operation = 'T';


d = input ("Distance Translated");
a = input ("Axis of Rotation");
if a == 1
HT = [1 0 0 d; 0 1 0 0; 0 0 0 0; 0 0 0 1];
elseif a == 2
HT = [1 0 0 0; 0 1 0 d; 0 0 0 0; 0 0 0 1];
else a == 3
HT = [1 0 0 0; 0 1 0 0; 0 0 0 d; 0 0 0 1];
end

H2 = HT;
end

H=H2*H1;
OUTPUT:

18
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

Conclusion: Composite Homogeneous Transformations are performed

19
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

EXPERIMENT NO:4

A PROGRAM TO IMPLEMENT DIRECT KINEMATICS

20
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

Experiment No:4
A program to implement Direct Kinematics

Aim: To solve the direct kinematics of a 3-axis planar robotic arm and 4 axis
SCARA robot and study DH algorithm.

Theory: In Direct Kinematics joint variables of a given robot are given and
determine the position and orientation of the tool with respect to a coordinate frame
attached to the robot base using DH algorithm.
DH algorithms a two pass algorithm in which the first pass assign a set of RHOCF
to the distal end of each link. On the second pass the values for the kinematic
parameters are determined.
Once the link coordinates are assigned, we can then transform coordinate frame k
to coordinate frame k-1 using a homogeneous coordinate transformation matrix.
By multiplying several of these coordinate transformation matrices we get a
coordinate transformation matrix which transforms or maps tool coordinates into
base coordinates. This composite homogeneous coordinate transformation matrix
is called the arm matrix.

DH algorithm: Denavit and Hartenberg proposed a systematic notation for


assigning right handed orthogonal coordinate frames ,one to each link in an open
kinematic chain of links. To assign coordinate frames to the links of the robotic
manipulator, let Lk be the frame associated with link k. The coordinate frames are
assigned to the links using the following procedure

1. Number the joints from 1 to n starting with the base and ending with the
tool yaw, pitch and roll in that order.
2. Assign a right handed orthonormal coordinate frame Lo to the robot
base, making sure that zo aligns with the axis of joint 1.set k = 1.
3. Align zk with the axis of joint
int k +1
4. Locate the origin of Lk at the intersection of the zk and zk -1 axes .If
they do not intersect ,use the intersection of zk with a common normal
between zk and zk- 1
5. Select xk to be orthogonal to both zk and zk -1 .If zk and zk -1 are parallel
point xk away from zk-1
6. Select yk to form a right handed ortonormal coordinate frame Lk

7. Set k = k+1 .If k < n ,go to step 2;


else ,continue

21
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

8. Set the origin of Ln at the tool tip.Align zn with the approach vector, yn
with the sliding vector , and Xn with the normal vector of the tool
Set k = 1
9. Locate point bk at the intersection of the xk and Zk-1 axes .If they do not
intersect ,use the intersection of xk with a common normal between xk and
zk-1
10. Compute qk as the angle of rotation from xk-1 to xk measured about Zk-1
11. Compute dk as the distance from the origin of frame Lk-1 to point bk
measured along Zk-1
12. Compute Bk as the distance from poinf bk to the origin of frame Lk
measured along xk
13. Compute ax as the angle of rotation from zk- 1 to zk measured about xk
14. Set k = k+1 If k n, go to step 8 , else
stop,
This is called as DH algorithm.

CODE:
l1 = 10; % length of first arm
l2 = 7; % length of second arm
theta1 = 0:0.1:pi/2; % all possible theta1 values
theta2 = 0:0.1:pi; % all possible theta2 values
[THETA1,THETA2] = meshgrid(theta1,theta2); % generate grid of angle values
X = l1 * cos(THETA1) + l2 * cos(THETA1 + THETA2); % compute x coordinates
Y = l1 * sin(THETA1) + l2 * sin(THETA1 + THETA2); % compute y coordinates
data1 = [X(:) Y(:) THETA1(:)]; % create x-y-theta1 dataset
data2 = [X(:) Y(:) THETA2(:)]; % create x-y-theta2 dataset
plot(X(:),Y(:),'r.');
axis equal;
xlabel('X','fontsize',10)
ylabel('Y','fontsize',10)
title('X-Y coordinates for all theta1 and theta2 combinations','fontsize',10)

OUTPUT:

Result: Direct Kinematics of 3 axis planar articulated robot implemented and


studied DH algorithm.
22
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

EXPERIMENT NO:5
A PROGRAM TO IMPLEMENT INVERSE KINEMATICS

23
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

Experiment No:5
A program to implement Inverse Kinematics
Aim: Write a program to implement the inverse kinematics Solution
of the given SCARA Robot and determine the Joint variable for the
given TCV.
Theory: Inverse Kinematics Problem ,Given a desired position P and orientation R for
the tooI find the values for the joint variables q which saisfy the arm equation
given by

R P
Tbase tool ( q) = ⌈ 0 1 ⌉

The inverse kinematics problem is more difficult than the direct kinematics problem,
because no single explicit systematic procedure analogous to the DH algorithm is
available .As a result each robot or generally simlilar class of robots has to be treated
separately. It makes Robot more versatile..
Solution to an IK problem are not unique. There are multiple solutions
In tool configuration space the two solutions are identical, because they produce the
same p and R but in joint space they are clearly distinct.Typically the elbow up solution
is preffered because it reduces the chance of collision.

Algorithm
1. Start
2. Input tool configuration vector
3. Extract joint variables
4. stop.

CODE:
w = input("enter the value for w: ");
d = input("enter the value for d: ");
a = input("enter the value for a: ");
q2 = acos(((w(1)^2) + (w(2)^2) - (a(1)^2) - (a(2)^2))/(2*a(1)*a(2)));
Y = (((a(2)*sin(q2)*w(1)) + (a(1) + a(2)*cos(q2))*w(2)));
X= ((a (1) +(2) *cos(q2)) *w (1)) -(a (2) *sin(q2) *(w (2)));
q1a = atan2(Y,X);
q1b = atan2(((a(2)*sin(-q2)*w(1)) + ((a(1) + a(2)*cos(-q2))*w(2))), (((a(1) +
a(2)*cos(-q2))*w(1))-(a(2)*sin(-q2)*w(2))));
q3 = d(1)-d(4)-w(3)';
q4 = pi*log(w(6));
disp("q2= ")
disp(q2)
disp("q1a= ")
24
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

disp(q1a)
disp("q1b= ")
disp(q1b)
disp("q3= ")
disp(q3)
disp("q4= ")
disp(q4)
OUTPUT:

Result: Inverse Kinematics of 4 axis SCARA robot implemented using any


programming language/MATLAB tools.

25
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

EXPERIMENT NO:6
A PROGRAM TO IMPLEMENT TEMPLATE MATCHING

26
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

27
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

Experiment No:6
A program to implement template matching

Aim: To write a program to implement Template Matching.


Theory : Template matching two techniques are there
1. Performance Index Method.
2. Normalized Cross Correlation method.

It is a technique which is used to recognize whether a given part


belongs to a particular class of or not. All the parts which belongs to a `particular
class of parts is kept in front of the camera one by one at a time, their images are
obtained digitized & stored in a library of parts in memory as templates Ti (k,j)
of size (mo x no). Now the class of parts (scene) is captured by the camera image
is digitized & is given by I(k j) of size (m X n) and stored in the memory.

Now in the memory there are a number of templates Ti (k j) and one image I (k,j).
To search whether a given part (template) belongs to the class of parts (image) or
not take the template & scan the gray scale image or digital image I (k , j) from
left to right & top to bottom using raster scanning method.
At each time of translation obtain & index performance called as performance
index Pi(x,y).
Whenever the template matches with the part in the image, the index=0. the match
has been folm"d search is successful the location of the part is also found. The
performance index is given by
Pi(x,y)= MoΣ no
Σ I(k=x,j+y)-Ti(k,j)
k=1 j=1
Algorithm
1. set I=1,x=0,y=0,e>0
2. compute Pi(x,y)
3. set y=y+1;if y<=(n-n0) go to step 2
4. set y=0,x=x+1,if x<=(m-m0) go to step2
5. set found =false.

CODE:
i = [2 1 0 0 3; 0 0 5 0 0; 0 4 0 6 0; 1 0 5 0 0];
t=[0 4 0; 3 0 5; 0 4 0];
P= [0 0 0;0 0 0];
m=5;
n=4;
m0=3;
n0=3;
for k =1:n0
for j=1:m0
for x = 1:n-n0+1
for y =1:m-m0+1
P(x,y) = P(x,y)+abs(i(k+x-1,j+y-1)-t(k,j));
end
end
28
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

end
end
disp("P")
disp(P)
Y = min(P,[],1);
Z = min(Y);
disp("Minimum Performance Index is :")
[r,c]=size(P);
for i=1:r
for j=1:c
if(P(i,j)==Z)
disp("Location:")
disp(i-1),disp(","),disp(j-1);
end
end
end

OUTPUT:

Result: Template matching implemented

29
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

EXPERIMENT NO:7
A PROGRAM TO IMPLEMENT TRAJECTORY PLANNING

30
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

Experiment No:7
A PROGRAM TO IMPLEMENT TRAJECTORY PLANNING

Aim - To compute and plot trapezoidal velocity trajectory for 2D planar motion.

Theory - A tool path is defined as the collection of the sequence of configurations a


robot makes to go from one place to another without regard to the timing of these
configurations. Hence path is a purely spatial representation. If temporal information
is added by specifying the times at which the tool must be at various points along the
path, then path becomes a trajectory. Trajectory planning can be planned in joint space
and cartesian space.

Motion diagram represents graphically described time depending functions of


changing position, velocity, acceleration and jerk of manipulator link gripper or tool.
Theoretically, these functions may have different forms. The best way to describe
motion diagrams using mathematical function is using splines, i.e. curves composed
from several polynomials. Manipulator motion may be described in different
coordinates, e.g.in joint coordinates, base coordinates or world coordinates. Base and
world coordinates are normally cartesian coordinates. In some cases the base
coordinates may also be polar(cylindrical or spherical) or angular coordinates. Motion
will be planned in the world cartesian coordinates (where also the robot’s work is
described), but the manipulator will realize the motion in joint coordinates. It is
known that velocity is the derivative of position function, acceleration is the derivative
of velocity function and jerk is the derivative of the acceleration function. Because of
this, to describe motion along the trajectory, the following equations (3.1…3.4)
consisting of polynomials are used. Polynomials are the best functions because their
derivatives can be easily found.
2 3
s ( t )=c 0 +c 1 t +c 2 t +c 3 t
ds 2
v ( t )= =c 1+2 c 2 t+3 c 3 t
dt
dv
a ( t )= =2 c 2+ 6 c 3 t
dt
da
j ( t )= =6 c 3
dt

where, coefficients c 0 , c 1 , … c 3 define the character of motion.

The graphical form of motion (position, velocity, acceleration and jerk) description is
named the motion diagram. Motion needed to be planned for the robot after the
31
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

program instruction is read from program memory and before the drives of the
manipulator start motion. Multiple limits are considered on trajectory planning (travel
time, maximal values of velocity and acceleration and jerk. The maximum velocity
limit can depend on technology or emergency conditions. Higher velocity is more
dangerous for people working in the same room with a robot. Higher acceleration and
deceleration values need drive motors with higher output power and manipulator
construction standing higher forces and torques. Jerk value can be limited by smooth
acceleration and deceleration. Motion diagrams can be described by one third
polynomial of position, second order of polynomials of velocity and linear
acceleration (deceleration) function. In simple cases the motion diagram of the
trajectory is described by a simple function. The velocity diagram has the form of
triangle or trapezoid.

CODE:
wpts = [0 45 15 90 45; 90 45 -45 15 90];
[q, qd, qdd, tvec, pp ] = trapveltraj(wpts, 501);
subplot(2,1,1)
plot(tvec, q)
xlabel('t')
ylabel('Positions')
legend('X','Y')
subplot(2, 1, 2)
plot(tvec, qd)
xlabel('t')
ylabel('Velocities')
legend('X','Y')

32
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE
Chembur, Mumbai - 400 088
UG Programme in Electronics and Computer Science

OUTPUT:

Conclusion: Planning of trajectory for trapezoidal velocity diagrams is implemented


using MATLAB. When the velocity curve has the form of trapezium, after initial
acceleration, the manipulator moves with a constant speed. Because the jerk is not
limited 86 (has theoretical indefinite value) the position function can be described by
the spline consisting of the second order polynomials.

33

You might also like