Week 2- 2R Robotic Arm Challenge
2R Robotic arm -The robo are use in different industry for differnt use.it helps to do complicated work
here we run 2R bobotic arm in this two links are connected by the joint and theta1 is the angle created by link 1 to the x axis and theta2 is angle created by the link2
CODE-
clear all
close all
clc
%input
L1=1.0;
L2=0.7;
theta1=(0:10:90);
theta2=(0:10:90);
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);
figure(1)
plot([x0,x1],[y0,y1],[x1,x2],[y1,y2],'linewidth',2)
xlabel('x axis')
ylabel('y axis')
legend('arm 1','arm 2')
axis([0 2 0 2])
M(ct)= getframe(gcf)
ct=ct+1;
end
end
movie(M);
videofile=VideoWriter('robotic.avi','Uncompressed AVI');
open(videofile);
writeVideo(videofile,M);
close(videofile);
OUTPUTS-
outputs in detail -
to find co ordinats of link at base x0=0 because at the base x axis value is zero.
as same at origin y0=0
at length (L1) the co ordinates" x1= L1*cosd(theta1)" here the values of input puts then output will show as x1=0
now we find y1 co ordinates y1=L1*sind(theta1) here we put L1 & theta1 values as respectively(1,90)
so output will be y1=1*sind(90)
y1=1
now we find out the value at the link 2 co ordinates
here we use x1 & y1 values and length (L2)
x2=x1+L2*cosd(theta 2)
here we have x1=0 and L2 =0.7 and theta=90 (x1 is added because x2 at link after link 1 so we x1 is added in equation
so we x2=0+0.7*cos(90)
x2=0
as the same we find out y2 co ordinates
y2=y1+L2*sind(theta)
y2=1+0.7*sind(90)
y2=1+0.7
y2=1.7
Animation link-
https://drive.google.com/file/d/1ysMc4dbHapTH2J09b6Ejkwz9wie8f16g/view?usp=drivesdk