All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM: To write a program to simulate the forward kinematics of a 2R Robotic Arm in Python. OBJECTIVE : To solve and simulate the forward kinematics of a 2R Robotic Arm. To create the animation of working of a 2R Robotic Arm. INTRODUCTION: A robotic arm is a robot manipulator, usually programmable,…
Shubhranshu Mishra
updated on 03 Jul 2020
AIM: To write a program to simulate the forward kinematics of a 2R Robotic Arm in Python.
OBJECTIVE :
INTRODUCTION: A robotic arm is a robot manipulator, usually programmable, with similar functions to a human arm. The links of such a manipulator are connected by joints allowing either rotational motion (such as in an articulated robot) or translational (linear) displacement. The links of the manipulator can be considered to form a kinematic chain. The use of industrial robots is increasing in areas such as food, consumer goods, wood, plastics, and electronics, but is still mostly concentrated in the automotive industry.
(i)
In the image shown above, the robotic arm consists of 4 components,
SOLUTION STEPS :
x1=l1⋅cos(θ1)x1=l1⋅cos(θ1) and y1=l1⋅sin(θ1)y1=l1⋅sin(θ1)
Similarly, the coordinates of endpoint of link 2 (L2) can also be found from trigonometry as,
x2=x1+l2⋅cos(θ2)x2=x1+l2⋅cos(θ2) and y2=y1+l2⋅sin(θ2)y2=y1+l2⋅sin(θ2)
BODY OF THE CONTENT :
Python Code -
# A program to create simulation of 2R robotic arm manipulator
import math
import matplotlib.pyplot as plt
# Inputs
l1 = 1
l2 = 0.5
x0 = 0
y0 = 0
n_theta = 10
theta_start = 0
theta_end = math.pi/2
counter = 1
theta_1 = []
theta_2 = []
for i in range(0,n_theta):
tmp = theta_start + i*(theta_end - theta_start)/(n_theta - 1)
theta_1.append(tmp)
theta_2.append(tmp)
for T1 in theta_1:
for T2 in theta_2:
# Link 1 & Link 2 connector
x1 = l1*math.cos(T1)
y1 = l1*math.sin(T1)
# Coordinates of manipulator
x2 = x1 + l2*math.cos(T2)
y2 = y1 + l2*math.sin(T2)
filename = str(counter) + '.png'
counter = counter + 1
plt.figure()
plt.plot([x0,x1],[y0,y1])
plt.plot([x1,x2],[y1,y2])
plt.xlim([0,3])
plt.ylim([0,3])
plt.savefig(filename)
RESULTS :
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...
Frequency Analysis of a rotating shaft (Finite Element Analysis using SolidWorks)
Aim- The aim of this project is to perform a frequency analysis on a rotating shaft, from there we need to determine the critical frequencies and the mode shapes. 5 Mode Shapes were simulated and analyzed. Introduction:- Frequency is the number of occurrences of a repeating event per unit of time. The formula…
06 Jul 2020 03:57 PM IST
Project - Rankine cycle Simulator (MATLAB)
AIM: To create a basic 'RANKINE CYCLE SIMULATOR'. THEORY: The Rankine cycle is the fundamental operating cycle of all power plants where an operating fluid is continuously evaporated and condensed. The selection of operating fluid depends mainly on the available temperature range. The above figure shows us the basic rankine…
03 Jul 2020 10:43 AM IST
Curve fitting (MATLAB)
AIM: To write a program to fit a linear and cubic polynomial for the specific heat data set then calculate the goodness of fit using different parameters and different ways to improve the fit in MATLAB THEORY: Curve fitting is the process of constructing a curve or mathematical function that best fits the data points,…
03 Jul 2020 10:24 AM IST
Solving second order ODEs (MATLAB)
Aim: To solves the ODE which represents the equation of motion of a simple pendulum with damping. Objective: To write a program that solves the following ODE which represents the equation of motion of a simple pendulum with damping and create an animated video of output obtains by solving this ODE. Theory:…
03 Jul 2020 10:20 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.