FORWARD KINEMATICS OF 2R ROBOTIC ARM USING MATLAB
FORWARD KINEMATICS OF 2R ROBOTIC ARM USING MATLAB
1. AIM :
A program to simulate forward kinematics of 2R robotic arm using matlab
2.INTRODUCTION:
A robotic arm is a type of mechanical arm,usually programmable, with similar function to human arm;the arm may be the sum total of mechanism or may be part of complex robot .The links of such manipulator are connected by joints allowing either rotational motion(such as an articulatedf robot ) or translational (linear )displacement .The links of the manipulator can be considered to form kinmatic chain.The terminus of the kinematic chain of the manipulator is called end effector and it is analogous to the human hand.
Forward Kinematics refers to the use of the kinematic equations of the robot to compute the position of end effector from from specified values for the joint parameters. The kinematics equations of the robot are used in several applications as well and also in animations.The forward kinematics equations can be used as a method in 3D computer graphics for animating models.
The essential concept of forward kinematic animation is that the positions of particular parts of the model at a specified time are calculated from the position and orientation of the object, together with any information on the joints.
% inputs
ct =1;
% angles
theta1 = linspace(0,90,10);
theta2 = linspace(0,90,10);
%lengths of the links
l1 = 1;
l2 = 0.5;
for i= 1 : length(theta1)
Theta1 = theta1(i);
for j =1:lengtgh(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
figure(ct)
plot([x0,x1],[y0,y1],'linewidth',3,'color','b')
plot([x1,x2],[y1,y2],'linewidth',3,'color','r')
axis([-0.1 1.5 0 1.5])
M(ct) =getframe(gcf);
ct=ct+1;
pause(0.1)
end
end
movie(M)
videfile=VideoWriter('roboticarm.avi','uncompressed AVI');
open(videofile)
writeVideo(videofile,M)
close(videofile)
output
output movie
https://drive.google.com/file/d/1C2u0f3DXT07U-V1Ecv6L1SKZdhKbqkic/view?usp=sharing