Simulation of forward kinematics of a 2R robotic arm
AIM : Simulation of forward kinematics of a 2R robtic arm.
INTRODUCTION : "A robot is a programmable, multifunctional manipulator designed to move material, parts, tools, or special devices through variable programmed motions for thr performance of a variety of tasks".
The components of robotic arms are arm or manipulator contoller, links,and end effectors etc.
Types of robotic arm configuration are as follows:
1. Polar or spherical configuration(TRL)
2.cartesion(LLL)
3.Cylindrical(TLL)
4.Jointed-arm configuration(TRR)
5. SCARA(RRL)
Robot kinematics studies the relationship between the dimensions and connectivity of kinematics chains and the position, velocity and acceleration of each linls in the robotic system, in order to plan and control movement.
DESCRIPTION OF THE PROGRAM:
l1=1m[length of the link 1]
l2=.5m[length of the linl 2]
theta1=0 to 90 (with intervals 10)
theta2=0 to 90 (with intervals 10)
[x0 yo],[x1 y1]and [x2 y2]are the co-ordinates along the x-axis and y-axis for the link1 and link2 respectively.
x0=0
y0=0
x1=l1*costheta1
`y1=l1*sintheta1`
`x2=x1+l2*costheta2
`y2=y1+l2*sintheta2`
M(ct) is used here to get the frames.
clear all
close all
clc
l1=1;
l2=.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);
x0=0;
y0=0;
x1=l1*cosd(THETA1);
y1=l1*sind(THETA1);
x2=x1+l2*cosd(THETA2);
y2=y1+l2*sind(THETA2);
plot([x0,x1],[y0,y1],[x1,x2],[y1,y2],'linewidth',3)
axis([-1 1.5 0 1.5])
pause(.03)
M(ct)=getframe(gcf)
ct=ct+1;
end
end
movie(M)
videofile = VideoWriter('forward_kinemaatics.avi','uncompressed AVI');
open(videofile)
writeVideo(videofile,M)
close(videofile)