Challenge

Week 2- 2R Robotic Arm Challenge

AIM:

       To write the code for simulate the Forward kinematics 2R arm of a robotic arm in MATLAB.

OBJECTIVE:

       1. To solve and simulation the forward kinematics fo a robotic manipulator and to get the moment of manipulator.

       2. To create the animation of robotic manipulator through the axial mention.

INTRODUCTION:

        The mainlly the robotic arm are used in the mechanical emerged as a field of during the industrial revolution.To use the robotic arm for welding and assemblly parts of the product and goods.The robotic arm also similarlly to the human hand.The program the robotic manipulator to perform the required function and works.The links of the manipulator are connected with the joints are rotational joints.

In above the image are consider the four major parts such as,

           1) The BASE ,robotic arms are mounted on the strong base for the moment and actions, the base connect with the links .

           2) The LINK are length of the arm(l1 is length of the first link) and link2 connect with along the link1.

           3) The JOINT are connect the two links are called joint.

           4) The GRIPPER are mounted the end of the manipulator, the use to hold the parts and pick and place operation.

INPUTS:

           we need the input values of the length of the two links and angles.here, we create the animation the manipulator so we use the linspace function.

                   length of the link l1=1 in meter(for example).

                   length of the link l2=0.5 .

                   Angle of the link1 from base is [array of row vector by using the linspace command] 

                   theta1=linspace(0,90,15)

                   theta2=linspace(0,90,15)

                   Forward kinematics of 2R robotic arm manipulator,

                   x0=0

                   y0=0

                   x1=l1*cosθ

                   y1=l1*sinθ

                   x2=x1+l2*cosθ

                   y2=y1+l2*sinθ

MATLAB CODE:

                   

clear all
close all
clc
 
%input
l1=1;                                                                %length of first link l1
l2=0.5;                                                             %length of second link l2
theta1=linspace(0,90,15);                                  % theta1 value are row vector array by(linspace function) as well as theta2
theta2=linspace(0,90,15);
 
ct=1;
for i=1:length(theta1)                                   %for loop with robotic manipulator the array of the theta values assign the THETA1 and THETA2 variables. 
THETA1=theta1(i);
for j=1:length(theta2)
THETA2=theta2(j);
 
x0=0;                                                                % Forward kinematics of coordinate determination
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);             % plotting the coordinates for the animation 
axis([-0.1,1.5,0,1.5])                                                       % axis for fixed or limits
pause(0.003)
M(ct)=getframe(gcf);
ct=ct+1;
end
end
 
% avi saving command
movie(M)
videofile=VideoWriter('forward_kinematics_2r_arm.avi','Uncompressed AVI');
open(videofile)
writeVideo(videofile,M)
close(videofile)
 
OUTPUT VIDEO LINKS:
 
 
ERROR CORRECTION:
 
               Error occures when the case sensitive. Unrecognized function or variable error.
 
 
               To change the [Movie(M) to movie(M)] the error are rectified.
 
RESULT:
                  
             The output of the Forward kinematics of the 2R Robotic arm manipulator is run successfully.
 
 
            
 
 
 
             
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.