Project

Simulation of forward kinematic of a 2R Robotic arm

1.AIM: To Write a program in Matlab to simulate the forward kinematics of a 2R Robotic Arm.

2.Equations Used:

  1. `x_2=x_1+l_2cosΘ_2`
  2. `y_2=y_1+l_2sinΘ_2`

3.Theory: Robotics is playing a tremendous role in the field of mechanical engineering in today’s world. For design a robot we must know the function and movement of the robot as per the desired application of it. It is very important for us to know the kinematics of link of a robotic arm that is a mechanism which consists of multiple links. If we are able to determine the movement of the robotic arm then it will help us to find the workspace of the arm. The workspace refers to the possible locations that a robot can reach.

The general layer of a 2R robotic arm is followed:-

Here;

Inputs = theta1 and theta2 | l1 and l2

Outputs = Movement of Manipulator

  1. Procedure:

Step1:- To calculate the position of link1.

  • The link 1 consist of the starting co-ordinate and end co-ordinate.
  • The starting co-ordinate of link 1 are x0 = 0, y0 = 0 because it is fixed at the origin.
  • The end co-ordinate of the link 1 are x1 = 1*cosd(theta1) , y1 = 1*sind(theta1)

Step2:- To calculate the position of link 2.

  • The ending co-ordinates of link 1 will work as the starting co-ordinate of link 2 ( x1,y1)
  • The ending co-ordinate of link 2 are

X2 = x1+l2cos(theta2)

Y2 = y1+l2sin(theta2)

  1. Objective:-

To Write a program in Matlab to simulate the forward kinematics of a 2R Robotic Arm

6. Programming language used:- HTML

7.Code( Forward kinematics of a 2R robotic arm 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);
      
    %coordinates
    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)
    text = sprintf('text%d.png',ct)
    saveas(gca,text)
     ct = ct+1
     end
 end

 

8.Output:-

9.Conclusion:-

  • Programme for simulation of forward kinrmatics of a 2R Robotic Arm has been written
  • Movement of Manipulator has been shown
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.