Challenge

Week 2- 2R Robotic Arm Challenge

AIM : A program in Matlab to simulate the forward kinematics of a 2R Robotic Arm

Theory:

Kinematics is the study of the relationship between a robot's joint coordinates and its spatial layout, and is a fundamental and classical topic in robotics. Kinematics can yield very accurate calculations in many problems, such as positioning a gripper at a place in space, designing a mechanism that can move a tool from point A to point B, or predicting whether a robot's motion would collide with obstacles.

Objective :

The main objective behind this project is to determined the movement of manipulator on a different angles of first arm.

Program:

% program to simulate the forward kinematics of a 2R Robotic Arm

%lenght of first arm in m 
l1 = 1;
%lenght of second arm in m 
l2 = 0.5;
% angle of arms 
  theta1 = linspace(0,90,20); %angle of first arm
  theta2 = linspace(0,90,20); %angle of second arm
  ct=1;
  for i = 1:length(theta1)
      THETA1 = theta1(i);
       for j = 1:length(theta2)
           THETA2 = theta2(j);
           
            % first end coordinate point of first arm
            x0 = 0;
            y0 = 0;
            %second end corodinate points of first arm
            x1 = l1*cosd(THETA1);
            y1 = l1*sind(THETA1);
            %cordinate points of second arm
            x2 = x1+l2*cosd(THETA2);
            y2 = y1+l2*sind(THETA2);
  
            % lines of 2r robotic arm
            
           plot ([x0 x1],[y0 y1],[x1 x2],[y1 y2],'linewidth',3)
           axis ([0, 1.5, 0,1.5])
            %animation for 2r robotic arm
            pause (0.03);
           M = getframe(gcf)
           ct = ct+1
           
            
            
       end
  end
movie (M)
videofile = VideoWriter('fwd_kin_challegne.AVI','uncompressed.AVI')
open (videofile)
write (videofile,M)
close (videofile)

Result:

The recorded video of the animation is attached with the report.

conclusion:

  • The kinematics of a robot relate the joint angles of a robot to the coordinate frames of its links.

  • A robot's configuration is a minimal expression of its links position, and usually consists of the robot's joint angles.

  • The animation shows the movement of the manipulators which helps to determine the different positions at which the manipulator moves.

  • The animation also shows the defferent angles at which the first arm of the robot can be moved.
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.