All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM: To understand the Forward Kinematics of a 2R Robotic Arm using Python Programming. THEORY: A Robotic arm is a type of mechanical arm which is programmable with similar functions of a human arm. The Robotic Arm used consists of links and joints. Each part of a machine which moves relative to another part is called…
Sibi Raj P
updated on 29 Jul 2020
AIM: To understand the Forward Kinematics of a 2R Robotic Arm using Python Programming.
THEORY:
A Robotic arm is a type of mechanical arm which is programmable with similar functions of a human arm. The Robotic Arm used consists of links and joints. Each part of a machine which moves relative to another part is called as a kinematic link. The link used here in this robotic arm is a rigid link since there is no deformation occurring while transmission of motion. This robotic arm is said to have 2 arms, hence it has 2 Links in it. Thus, when 2 links or elements of a machine are in contact with each other, they are said to form 1 pair. Both the arms in the robot are said to have a Line Contact. It is because, the links are turning with respect to each other. The Robotic arm follows a Line Contact and it has a Higher Pair. Other examples of higher pairs are belt and rope drives, ball and roller bearings, cam and follower.
Diagramatic Representation of 2R Robotic Arm
In the given diagram, the base of the robotic is fixed and cannot be moved. Hence, It makes a hinge joint with Link1.The co-ordinates of Link1 with respect to the base is (x0,y0). Link 1 makes an angle of θ1 with the base. The co-ordinates of end point of link1 is(x1,y1)and it is resolved into 2 components namely:
1. Horizontal component: x1=x0+l1⋅cos(θ1)
2. Vertical component: y1=y0+l1⋅sin(θ1)
The end of Link1 makes an angle of θ2 with the base. The end of Link1 is the starting point of Link2.The co-ordinates of the point are (x1,y1).The end point of Link2 is (x2,y2).Similarly as Link1, Link2 is also resolved into 2 components namely:
1.Horizontal component: x2=x1+l2⋅cos(θ2)
2.Vertical component: y2=y1+l2⋅sin(θ2)
Problem Statement:
1.Write a program to understand the Forward Kinematics of a 2R Robotic Arm using Python Programming.
2.Plotting graphs for various range of values for Theta1 and Theta2 and converting it into an animation.
Methodology and Algorithm:
Python Code:
"""Understanding the forward kinematics of a 2R Robotic arm using the python program"""
#Importing the required libraries
import math
import matplotlib.pyplot as plt
#Inputs
l1=1 #Length of link 1
l2=0.5 #Length of link 2
#Angle of the links respect to the base
theta1=[]
theta2=[]
#Co-ordinates of the base of the robot
x0=0
y0=0
#Number of values of Theta
n=10
#Accepting the values of theta_start and theta_end in radian
theta_start=0
theta_end=math.pi/2
#Using counter variable for saving the filename with .png extension
counter=1
#Using the for loop for adding values of theta in theta1
for i in range(0,n):
temp=theta_start+i*(theta_end-theta_start)/(n-1)
#Appending the value of temp in the empty array
theta1.append(temp)
theta2.append(temp)
#Using the Nested for loop for accepting various values of theta1 and theta2
for t1 in theta1:
for t2 in theta2:
#Co-ordinates of link1,link2 connector
x1=l1*math.cos(t1)
y1=l1*math.sin(t1)
#Co-ordinates of link2 and the end-manipulator
x2=x1+l2*math.cos(t2)
y2=y1+l2*math.sin(t2)
#Saving the file as a filename with each iteration
filename=str(counter) + '.png'
#Appending the counter variable for each iteration
counter=counter+1
#Plotting the graph
plt.figure() #function is used to re-write the file
plt.plot([x0,x1],[y0,y1])#Plotting the co-ordinates of link1
plt.plot([x1,x2],[y1,y2])#Plotting the co-odrinates of link2
plt.xlim([0,3])#This function is used to assign the limit of the x axis
plt.ylim([0,3])#This function is used to assign the limit of the y axis
plt.savefig(filename)#The file is saved as filename with .png extension
plt.show()#Fuction used to show the respective graphs plotted
Output Graphs:
Animation of the Plot:
We have obtained 100 plots for the understanding the forward kinematics of a 2R Robotic arm which is converted into a gif file for showcasing all the plots obtained.
Link to the animation of the plot:
Result:
From this report we created a program using python programming to understand the Forward Kinematics of a 2R Robotic Arm and we have plotted graphs for range of values for θ1and θ2.
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...
Planetary Gear Mechanism Using Solidworks
AIM: To perfrom motion analysis on Planetary gear mechanism with a carrier and to get required plot for the simulation performed. OBJECTIVES: Using the following inputs provided : Ring gear : Module = 2.5 Number of teeth = 46 Sun gear: Number of teeth = 14 Input speed of the gear = 200 rpm. Number of planet gears…
01 May 2021 09:04 AM IST
INTERNAL GENEVA MECHANISM USING MULTIBODY DYNAMICS IN SOLIDWORKS
AIM: TO PERFORM MULTIBODY DYNAMICS ON GENEVA MECHANISM USING SOLIDWORKS. OBJECTIVES: 1) To create 3d models of driver and driven components. 2) Perform motion analysis by rotating the driver wheel at 10 Rpm. 3) We must obtain the following plots: Contact force(between driving and driven wheel) as a function of time.…
31 Jan 2021 01:51 PM IST
FREQUENCY ANALYSIS ON A ROTATING SHAFT
AIM: To perform frequency analysis on a rotating shaft using solid works. We need to find the critical frequencies acting on the rotating shaft. OBJECTIVE: 1) Natural frequency analysis is conducted on a rotating shaft to understand the dynamic behaviour of the system. 2) It helps us to reduce vibrations on the…
04 Dec 2020 09:16 AM IST
ANALYSIS ON A PLATE WITH A HOLE
AIM: To perform Static Analysis on two modes of plates with holes. We have to create the model in Solidworks and perform the analysis. OBJECTIVE: To compare the performance of 2 separate plates with different hole geometries by performing a static structural analysis on plate with a hole using Solidworks Simulation and…
11 Nov 2020 08:53 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.