Challenge

Week 2- 2R Robotic Arm Challenge

AIM:

To create a matlab program and stimulate a forward kinematics for a robotic arm

OBJECTIVES :

The main objective of the program is to create workspace for a robot in industry it can be done by stimulating and animation

INTRODUCTION:

The robots which used in the industries can performs vital role making the advanced and modern industrial, and inorder to operate the robot correctly we should create the workspace that will be identified by the robots,if not the workspace will be created that should be a danger one.

INPUTS:

L1=1.5M

L2=1M

EQUATIONS:

X1=L1.cos(theta1)

Y1=L1.sin(theta2)

X2=X1+L2*cos(theta1)

y2=y1+L2*sin(theta2)

PROGRAM STRUCTURE:

This program is created by using the two links and two loops for covering the all possibilities of link motion,and this is done by setting a link which is "i" and "j" FOR loops which is also called as iteration loops this iteration loops is used for performing the operation again and again untill the limits ,and then it is plotted and animated and then it saved in avi movie file

CODE:

clear all
close all
clc
%set the input values which is lenghth of the robotic arm
L1=1.5;
L2=1;
%the movement of the robotic arm which is in the form of angles
theta1=linspace(0,90,5);
theta2=linspace(0,90,5);
X0=0;
Y0=0;
ct=1;
%for the repeatation process and iteration of 1to5 as theta1 which 10valu
for i=1:length(theta1)
THETA1=theta1(i);
for j=1:length(theta2)
THETA2=theta2(j);
%fix the starting points for arm1
%end points for arm 1 which is also starting of arm2
X1=L1*cosd(THETA1);
Y1=L1*sind(THETA1);
%fix the end point of arm2
X2=X1+L2*cosd(THETA2);
Y2=Y1+L2*sind(THETA2);
%PLOT THE GRAPH
plot([X0,X1],[Y0,Y1],[X1 X2],[Y1,Y2],'linewidth',3,'marker','*');
%limits of X,Y axis
axis([-0.1 3.0 0 3.0]);
% to pause the animation between jumping
pause(0.1)
%collecting the frames for Movie
M(ct)=getframe(gcf);
ct=ct+1;
end
end
%saving the movie i the'.avi'
movie(M)
videofile = VideoWriter('kinematics.avi', 'Uncompressed AVI');
open(videofile)
writeVideo(videofile,M)
close(videofile)
PROGRAM EXPLANATION:
  • First the input values arec assingned
  • And then set the length for the theta 1 and theta 2 values by using the linspace command and it will performs the operation by zero to 180 degrees
  • The counter variable is started eby ' ct ' commad
  • Then then iteration loops 'i' is created and i is limited upto theta 1 array
  • Then it is assigned THETA from theta 1 array to perform the calculation
  • Then with in a first iteration loops continued the second loop is created which is 'j'
  • It is also limitec upto theta 2 and it is called THETA
  • The equations which is write by using the cosd and sind command
  • The out put plotted and the line width will be 3
  • The process slowdown by 0.01 sec
  • The individual frame obtained bybthe frame command
  • Then the counter variable increased by 1
  • The movie is create d by using a movie command
  • The new avi file created and the frames are vstored in that file
  • Then the videofile is opened and closed by the commmand we write

ANIMATION :

https://youtu.be/1dpzMgriRAk

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.