SIMULATION OF A 2R ROBOTIC ARM .
SIMULATION OF A 2R ROBOTIC ARM .
AIM:
To simulate the working of a 2R robotic arm using MATLAB.
PRICIPLE:
The 2R Robotic arm works on the principle of FORWARD KINEMATICS. Forward kinematics are vastly used in developement of Robotics,Animation and Video games.
THESIS:
This project gives a basic idea on the functionality of a 2R Robotic Arm Manipulator from the programming side. The 2R robotic arms are to achieve Point-to-Point control which is a very important to achieve precision and accuracy in mass production industry where speed of production is required and human errror has to be minimised. The Automotive industry can be a great example where these Robots can be used since there is a demand for the product and the need to deliver the products as soon as possible. Welding,Spray Painting and Assembly of automobile bodies are some operations where the 2R robotic arms come into picture. these robots are also used for Material Handling purposes.
The basic Idea behind the programming of the 2R Robotic arm is described below,
from the above image,
let us consider,
,the bottom end of the link 1 as point 'A' holding the co-ordinates (x0,y0).
,the top end of the link 1(bottom end of link 2) as point 'B',holding the co-ordinates (x1,y1).
,the top end of the link 2 as point 'C',holding the co-ordinates (x2,y2).
,the link 1 as 'L1'
,the link 2 as 'L2'
The code for the co-rodinate point equations are listed below,
x1=L1*cosd(theta1);
y1=L1*sind(theta1);
x2=L2*cosd(theta2);
y2=L2*sind(theta2);
the above lines are the logical codes for the program.
PROGRAM:
% Simulation of a 2R Robotic Arm
%input
l1=1;
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);
%co-ordinates
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.3)
M(ct)=getframe(gcf)
ct=ct+1;
end
end
movie(M)
videofile = VideoWriter('forward_kinematics.avi','Uncompressed AVI');
open(videofile)
writeVideo(videofile,M)
close(videofile)
RESULT:
The complete result can bew viewed by clicking the link below: