FORWARD KINEMATICS OF A 2R ROBOTIC ARM SIMULATION
AIM :
To Simulate Forward Kinematics of a 2R Robotic Arm using MATLAB.
OBJECTIVE :
By using MATLAB to Create a Program and Simulate the Forward Kinematics of a 2R Robotic Arm.
THEORY :
Kinemat ics - is the study of object in motion, there Velocity, Acceleration and Momentum. For example Car moving in the road.
Momentum - is the Product of Mass and Velocity. For example when a man pulling a car in a hill towards upward direction require high momentum and pulling a car in a hill towards downward direction requires less momentum.
Forward Kinematics - refers to the use of the Kinematic equation of a robot to compute the position of the end effector from specified values for the joint parameters. Kinematics equations of a Robot are used in Robotics, Computer games and Animation.
EXPLANATION :
In this Project, we have to do a Forward Kinematics of a 2R Robotic Arm Simulation using MATLAB. 2R Robotic Arm contains 2 Links & 2 Rotational Joints,
Therefore,
- Link 1 - θ1 with respect to X-axis,
- Link 2 - θ2 with respect to X-axis,
- Length of Link 1 is L1,
- Length of Link 2 is L2,
Link 1 has 2 end points, Starting Point connected with base Robot and ending point is connected to Link 2. The Co-ordinate of Starting Points is (x0,y0) and Co-ordinate of ending point of the First link is (x1,y1),
Now,
x1 = L*cosθ1,
y2 = L*sinθ1,
End Point Link 1 is the Starting point of Link 2. We have to assign the co-ordinates (x1,y1) to starting point of Link 2 and also assign the co-ordinates (x2,y2) to ending point of Link 2.
Now,
x2 = x1+L*cosθ2,
y2 = y1+L*sinθ2,
We have to determine the Co-ordinates of three points as the Origin point, Ending point of Link 1 or Starting point of Link 2 and the Ending point of Link 2.
where, Three Co-ordinates are (x0,y0),(x1,y1),(x2,y2) with these three co-ordinates can be able to plot a two lines and also with the help of these co-ordination write a program to simulate animation using MATLAB.
PROGRAM :
% A Program to Simulate Forward Kinematics of a 2R Robotic Arm
clear all
close all
clc
%inputs
l1=0.8;
l2=0.4;
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',4)
axis([0 2 0 2])
pause(0.03)
M(ct)= getframe(gcf);
ct=ct+1;
end
end
Movie(M)
videofile = videowriter('Forward_kinematics_Movie_program.avi','uncompressed AVI')
open(videofile)
writeVideo(videofile,M)
close(videofile)
OUTPUT :
Video Link has been attached below, In that link you can watch the Simulation of Forward Kinematics of a 2R Robotic Arm using MATLAB.
Link - https://youtu.be/7KF5TuAFsSg
ERROR & CORRECTIONS :
In the above Program, Error has been occured as Movie(M) and it is corrected as movie(M). Likewise videowriter is also an error and it is corrected as a VideoWriter.
CONCLUSION :
Finally Errors has been rectified and Simulation has done in Forward Kinematics of a 2R Robotic Arm using MATLAB.