All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Introduction : In this project we are going to simulate the forward kinematics of a 2R Robotic Arm. 2R Robotic arm contains 2 links and 2 rotational joints. A representative diagram for a 2R Robotic Arm is given below, Here we are interested in getting the final position of manipulator(end effector)…
Mehul Shah
updated on 03 Aug 2018
Introduction :
In this project we are going to simulate the forward kinematics of a 2R Robotic Arm.
2R Robotic arm contains 2 links and 2 rotational joints.
A representative diagram for a 2R Robotic Arm is given below,
Here we are interested in getting the final position of manipulator(end effector) where joint angles i.eθ1and θ2are given. Such a problem is called as "forward kinematics."
In forward kinematics , joint angles are the inputs and the co-ordinates of an end effector is the output.
Steps to simulate the forward kinematics of a 2R Robotic Arm are as follows ,
Step 1 : Calculate the position of link 1
Starting point(x0 , y0) : (0,0)
End point (x1 , y1) : (l1*cosθ1 , l1*sinθ1)
End point of link 1 is the starting point of link 2 .
Step 2 : Calculate the position of link 2
Starting point(x1 , y1) : (l1*cosθ1 , l1*sinθ1)
End point (x2 , y2) : (x1 + l2*cosθ2 , y1 + l2*sinθ2)
l1 = length of 1st link .
l2 = lenght of 2nd link.
Now for different values of θ1 and θ2 , we will simulate and on tracing the path of an end effector , we will get the workspace of an end effector.
End effector can be a machining tool or welding tool or anything.
We will be saving each and every frame for each and every value of θ1 and θ2 and then we will be stitching all these frames to create an animation so that we can see how a 2R Robotic Arm is moving.
Here is the program to simulate the forward kinematics of a 2R Robotic Arm ,
clear all
close all
clc
% Inputs
l1 = 1.0;
l2 = 0.5;
theta1 = linspace(0,90,10);
theta2 = linspace(0,90,10);
ct = 1;
for i = 1:length(theta1)
THETA1 = theta1(i);
for j = 1:length(theta2)
THETA2 = theta2(j);
x0 = 0;
y0 = 0;
x1 = l1*cosd(THETA1);
y1 = l1*sind(THETA1);
x2 = x1 + l2*cosd(THETA2);
y2 = y1 + l2*sind(THETA2);
% plotting
plot([x0 x1],[y0 y1],'linewidth',3,'color','r',[x1 x2],[y1 y2],'linewidth',3,'color','b',x2,y2 ,'*','color','g')
axis([-0.1 1.5 0 1.5])
pause(0.03)
file_text = sprintf("forward_kinematics%05d.png",ct)
saveas (gca,file_text)
ct = ct+
end
end
Below is a link for an animation ,
Thank you.
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Week 2- 2R Robotic Arm Challenge
https://projects.skill-lync.com/projects/A-PROGRAM-TO-SIMULATE-THE-FORWARD-KINEMATICS-OF-A-2R-ROBOTIC-ARM2-05817
01 Jul 2019 07:11 AM IST
A Program to solve Ordinary Differential Equation (ODE) that represents the equation of motion of a simple pendulum with damping.
INTRODUCTION : Ordinary Differential Equations (ODEs) are extremely important in engineering as they describe a lot of important phenomenon and solving those ODEs can actually help us understand systems. Couple of examples that involves second order ODE includes, 1) SIMPLE PENDULUM 2) SPRING-MASS-DAMPER SYSTEM Second order…
12 Apr 2019 11:56 PM IST
MULTI DIMENSIONAL SIMULATION OF A PORT FUEL INJECTED ENGINE(PART 2)
INTAKE SYSTEM BOTTOM : In this part of intake system, fuel is being injected via nozzles into an intake port and fuel and air mixes in this region and because of mixing , temperature of this part of intake port is slightly higher than top part of intake port. Also some part fuel gets vapourize in this part . Like…
28 Dec 2018 08:37 AM IST
A PROGRAM TO SIMULATE THE FORWARD KINEMATICS OF A 2R ROBOTIC ARM
Introduction : In this project we are going to simulate the forward kinematics of a 2R Robotic Arm. 2R Robotic arm contains 2 links and 2 rotational joints. A representative diagram for a 2R Robotic Arm is given below, Here we are interested in getting the final position of manipulator(end effector)…
03 Aug 2018 10:05 AM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.