FORWARD KINEMATICS OF A 2R-ROBOTIC ARM (USING PYTHON)
AIM:
To create and simulate the forward kinematics of a 2R-Robotic arm.
OBJECTIVES:
- To understand the working and the principles of a 2R-Robotic arm.
- To simulate the movement of the manipulator attached and understand the geometry behind it.
INTRODUCTION:
Robots and automated machines have changed the way we saw the world. The robotic arm, is more like a mechanical arm, usually, programmable, to act like a human arm. It can be made of different components or it may be itself a part of a complex robot. The geometry behind this robotic arm is attached beside the text. Here, we can see the manipulator is the main component that we need to do our work as it may be a soldering rod, a paint-brush and etc. So, it is necessary that we build it geometrically perfect and program it to our needs.
SIMULATION OF THE MODEL:
The model of a simple robotic arm was programmed and simulated in Python for better understanding of its movement. The movement of the second arm w.r.t to the movement of the first arm is an essential part of its designing as any fault can result in huge damage.
The program can be referred in the following:
# PROGRAM FOR SIMULATION OF FORWARD KINEMATICS OF 2R-ROBOTIC ARM
# IMPORTING MODULES
import numpy as np
import matplotlib.pyplot as plt
import math
# angle between the joints
theta1 = np.linspace(0, math.pi / 2, 10)
theta2 = np.linspace(0, math.pi / 4, 10)
# length of the arms
l1 = 200
l2 = 100
# initial coordinates
x0 = 0
y0 = 0
count = 1
# CALCULATION AND PLOTTING
for angle1 in theta1:
for angle2 in theta2:
# coordinates of first joint
x1 = l1 * math.cos(angle1)
y1 = l1 * math.sin(angle1)
# coordinates of manipulator
x2 = x1 + l2 * math.cos(angle2)
y2 = y1 + l2 * math.sin(angle2)
movie = str(count)
count = count + 1
# plotting
plt.figure()
plt.plot([x0, x1], [y0, y1])
plt.plot([x1, x2], [y1, y2])
plt.xlim([-100, 300])
plt.ylim([0, 300])
plt.savefig(movie)
OBSERVATIONS:
Some of the pictures of each and every state of the arm at different angles:
The following video can be seen to see the simulation of the forward kinematics of 2R-Robotic arm. The video was first captured as a bunc of images at different angles. Then through one of the different online video makers available on internet, the images were stringed to make a video.
CONCLUSION:
Robots and A.I are going to be vital in the near future of mankind due to its precision and work-ability. But, it still lacks the decision-ability which can be done using Machine-Learning and stuff. Nevertheless, simulation and working of these incredible machines using Python and other such softwares can prove to be handful in creation of these machines. Newcomers can learn about data animations using Python which will help them in learning new dimensions of Python.