Challenge

Week 2- 2R Robotic Arm Challenge

AIM :

        To write a program in matlab to simulate the forward kinematic of a 2R robotic arm 

OBJECTIVE :

        Animating and creating a movie from the plots obtained from the program .

THEORY:

     A manipulator end effector movement determines the workspace where the roboic arm can be applicable our motive is t animate the movement of robotic arm with the subseqent relative motion between the two comprising links

INTRODUCTION:

         *  Kinematics is the relationships between the positions,velocities and accelerations of the link of a manipulator 

         *   The forward kinematics is when the kinematical data are known for the joint coordinator the variables of the end-effector in a given cartesin space are to be computed 

         *  Robotic  arms are machines that are programmed to exeute a specific task or job quickly ,efficiently and extremely accuratly 

         *  A robotic  joint provides relative motion between two links of the robot each point or axis provides a certain degee-ofpfreedom(DOF)

INPUTS:

    (x0,y0) = starting point of link 1

    (x1,y1) = end point of link1 and starting point of link 2

     (x2,y2) = end point of link 2

          l1 = length of link attached to the base 

          l2  = length of link between the first and the end effection 

  theta 1 = angle made by link 1 with x -axis 

  theta 2 = amgle made by link 2 with x-axis 

CODE EXPLANATION:

    *   Programming language used in MATLAB 

    *   starting program by using commands 

    *  clear all-remove data from the workspace frecing up system memory

    *  close all -deletes the current figure or specific figure

    *   clc - clears all input and output from the command windows display giving you clean screen 

    *    providing the inputs variables like 

    *     predefining the length /values of robotic arms 

    *    providing the values for theta 1 and theta 2 using linspace command for theta 0 to 90 degree  for l1 values 

    *    providing the Cr(compression ratio) value specfic digit 

OUTPUT :

     The simulation  of the forward kinematics of a 2R -robotic arm amnipulator is done and we observed that each 10 degree of movement of the link 1 there is 90 degree of the link 2

FOR LOOP : for loop is used here for the iteration of the values from 0 to 90 degree I is used as outer loop and J is inner loop 

COSD and SIND  are used to coverd the radians into degrees beacuse MATLAB by defult takes in radians 

PAUSE : we have paused the code so that process can be visulised more clearly

Ct : ct is used for saving the frames in order to create a movies frames

GETFRAME: similarly getframe is used to caputre the frame and then by fast movement of those frames it can be convert into       a movie 

 Movie: movie command is used to create the movie frames caputre 

video writter: It is create a video file of the movie created and save in pc hard disc

plot: the plot command is used to plot the graphs of the coordinates provided 

Axis: the axis command is used to create the axis upon which we are going to the plot the coordinates 

Linspace: the linspace command is useful creating an arrays of values specified by the user

PROGRAMMING:

A% forward kinematics of a 2R robotic manipulator
clear all
close all
clc
% Inputs
l1 = 1;
l2 = 0.5;
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);
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',3)
axis([-0.1 1.5 0 1.5])
pause(0.03)
M(ct) = getframe(gcf);
ct = ct+1;
end
end
movie(M)
videofile = VideoWriter('forward kinematics.avi' , 'Uncompressed AVI');
open(videofile)
writeVideo(videofile,M)
close(videofile)
 
Video file:
https://drive.google.com/file/d/1-ZKxd-bH1zWcBQsILfRtNMKEhYtiYspp/view?usp=sharing

 CONCLUSION:

      *  A practical scenario regarding the functioning of the robotic arm and its workspace has been expernced by simulating the forward kinematics with a program in MATLAB 

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.