FORWARD KINEMATICS OF A 2R ROBOTIC ARM
THIS IS THE PROGRAM WHICH WILL VISUALIZE THE 2R ROBORIC ARM USING MATLAB PROGRAM
AIM OF THIS PROJECT: To show the matlab program which will visualize the 2R robotic arm .
THEORY :
Kinematics is the analysis of motion without considering the forces. Here, we need only geometric properties such as length and degree of freedom of the manipulator bodies.
Forward kinematics refers to use of kinematics equation of a robot to compute the position of end effector from specified values for the joint parameters.
If we know the geometry of the robot and all its joint points, we can do the math and figure out the position and orientation of any point on the robot. i.e, if we can able to figure out how the robot is going to move then we can figure out its workspace (workspace refers to possible location that the robot can reach).
These robots have various complex industrial application
- Welding in automobile industry.
- Material handling.
- Assembly operations.
- Machine loading and unloading.
- Spray painting of automobile bodies.
SCHEMATIC DIAGRAM OF A 2R ROBOTIC ARM:
- SPECIFICATION OF THE VARIABLES
X0 = 0, Y0 = 0 (AT THE BASE)
X1 = L1*COS(THETA1), Y1 = L1*SIN(THETA1)
X2 = X1+L2*COS(THETA2), Y2 = Y1+L2*SIN(THETA2)
- PROGRAM
%FORWARD KINEMATICS
l1=1;
l2=0.5;
theta1=linspace(0,90,100)
theta2=linspace(0,90,100)
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],[x1 x2],[y1 y2],'linewidth',3)
axis([-0.1 1.5 0 1.5])
pause(0.0001)
ct=ct+1;
M(ct)=getframe(gcf);
ct=ct+1;
endfor
endfor
movie(M)
videofile=videowriter('forwardkinematics.avi','uncompressed AVI');
open(videofile)
writeVideo(videofile.m)
close(videofile)