Week 2- 2R Robotic Arm Challenge
AIM: To simulate forward kinematic of a 2R robotic arm manipulator
BASICS EQUATION OF ROBOTIC ARM :
%forward kinematic of a 2Rrobotic arm manipulator
clear all
close all
clc
%inputs
l1=1;
l2=0.5;
theta1=45;
theta2=30; theta2=0; theta2=90;
%cooradinates
x0=0;
y0=0;
x1=l1*cosd(theta1);
y1=l1*sind(theta1);
x2= x1 + l2*cosd(theta2);
y2= Y1 + l2*sind(theta2);
%plotting
line([x0 x1],[y0 y1],'linewidth',3,'color','b')
line([x1 x2],[y1 y2],'linewidth',3,'color','r')
EXPLAIN OF BACIS SOLUTION:
1) Its consists of base, two arm or kinematic links and rotational arm joints. These links will have motion in them when they are programmed.
2) They are have two links , to calculatied poistion of link1 and Another position of link2.
3) We take a coordinate at(0,0) at the end of first link and starting of second link the coordinate are (x1 y1), and finally at the manipulator the coordinate will be (x2 y2).
Where,
X0= 0, Y0= 0 (AT THE BASE)
X1=L1*cosd(THETA1),Y1=L1*sind(THETA1)
X2=X1 + L2*cosd(THETA2) , Y2= Y1 + L2*sind(THETA2)
THEROY:
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 possiblt 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.
PROGRAM:
clear all
close all
clc
%inputs
%length of robotic arm
l1 = 2;
l2 = 1;
%angle between the base and robotic arm
theta1 = linspace(0,90,10);
theta2 = linspace(0,90,50);
%for end loop
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
line([x0 x1],[y0 y1],'linewidth',3,'color','b')
line([x1 x2],[y1 y2],'linewidth',3,'color','r')
axis([-0.1 3 0 3])
pause(0.01)
M(ct) = getframe(gcf);
ct = ct+1;
end
end
%conversion of plot into video
movie(M)
Videofile = VideoWriter('forward kinematics.avi','uncompressed AVI')
open(Videofile,M)
close(Videofile)
RESUILTS:
The final animation will be given file below
12 previousCallingContextType = 'unknown';
9 narginchk(2,3);
Videofile =
VideoWriter
General Properties:
Filename: 'forward kinematics.avi'
Path: 'C:\Users\pravin\Documents\MATLAB'
FileFormat: 'avi'
Duration: 0
Video Properties:
ColorChannels: 3
Height: []
Width: []
FrameCount: 0
FrameRate: 30
VideoBitsPerPixel: 24
VideoFormat: 'RGB24'
VideoCompressionMethod: 'None'
Methods
Error using VideoWriter/open
Too many input arguments.
>>