Project

Forward Kinematics of 2R robotic arm

This following Matlab program is used to solve the forward kinematics of the 2R robotic arm manipulator.

THEORY :

Kinematics is the analysis of motion without considering the forces. Here, we need only geometric properties such as length and degree of freedom of the manipulator bodies.

Forward kinematics refers to use of kinematics equation of a robot to compute the position of end effector from specified values for the joint parameters.

If we know the geometry of the robot and all its joint points, we can do the math and figure out the position and orientation of any point on the robot. i.e, if we can able to figure out how the robot is going to move then we can figure out its workspace (workspace refers to possible location that the robot can reach).

These robots have various complex industrial application

  • Welding in automobile industry.
  • Material handling.
  • Assembly operations.
  • Machine loading and unloading.
  • Spray painting of automobile bodies.

PROJECT SETUP :

It consists of base, two arms or kinematic links and two rotational joints. These links will have motion in them when they are programmed.

The link one will make make an angle theta1 eith respect to base, similarly link two will make an angle theta2.

So we need to create a plot at various angular positions upto which these arms can move. For this we need to findout the coordinates involved at the joints.

At the base the coordinates will be (0,0), at the end of first link and starting of second link the coordinates are(x1, x2), and finally at the manipulator the coordinates will be(x2, y2).

Whereas,

X0 = 0, Y0 = 0 (AT THE BASE)

X1 = L1*COS(THETA1), Y1 = L1*SIN(THETA1)

X2 = X1+L2*COS(THETA2), Y2 = Y1+L2*SIN(THETA2)

PROGRAM:

clear all
close all
clc

%inputs

%length of robotic arm
l1 = 2;
l2 = 1;

%Angle between the base and robotic arm
theta1 = linspace(0,90,10);
theta2 = linspace(0,90,50);

%for end loop
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 3 0 3])
        pause(0.01)
        M(ct) = getframe(gcf);
        ct = ct+1;
    end
        
end

%conversion of plot into video
movie(M)
videofile = VideoWriter('forward_kinematics.avi','uncompressed AVI');
open(videofile)
writeVideo(videofile,M)
close(videofile)

RESULT:

The final Animation can be seen in the given linkbelow,

https://youtu.be/jAtDjmzriCg

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.