Project

Simulation of forward Kinematics of 2R robotic arm and its animations

INTRODUCTION:

Robots are very powerful elements of today’s industry. They are capable of performing many different tasks and operations precisely and do not require common safety and comfort elements humans need. However, it takes much effort and many resources to make a robot function properly.

Using kinematics model, a programmer can determine the configuration of input reference that should be fed to every actuator so that the robot can do coincide movements of all joint to reach the desired position. On the other hand, with information of position that is shown by every joint while robot is doing a movement, the programmer by means of kinematics analysis can determine where is arm tip position or which parts of the robot should be moved in spatial coordinate. Kinematics problem consists of forward and inverse kinematics and each type of the kinematics has its own function.

Forward kinematics is used for transferring joint variable to get end-effector position. On the other hand, inverse kinematics will be applied to find joint variable from end-effector position.

in this case we are going to simulate the Forward kinematics of 2R Robotic arm.

AIM:

To Write a program in Matlab to simulate the forward kinematics of a 2R Robotic Arm, and creating an animation plot.

PROCEDURE:

A simple forward kinematics can be derived from its space using graphical solution. With a two link planar robot in fig., the graphical method for solving forward kinematics will be described in this section.


Using the vector algebra solution to analyse the graph, the coordinate of the robot end-effector can be solved as follows.

Length of Link1=l1

Length of Link2=l2

Angle made by Link1=ѳ1

Angle made by Link2=ѳ2

Initial co-ordinates

(x,y)=(0,0)

w.r.to angle ѳ1 the co-ordinates of link1

(x1,y1)=(l1cosѳ1,l1sinѳ1)

w.r.to angle ѳ2 the co-ordinates of link2

(x2,y2)=(x1+l2cosѳ2,y1+l2sinѳ2)…………………(1)

For each position of link1 ,the position of link2 also will change.

Let us assume

l1=1,

l2=0.5

ѳ1=10

ѳ2=

now x1=l1cos ѳ1=1*cos(10)

y1=l1sin ѳ1=1*sin(10)

(x1,y1)=(0.984,0.173)--------------------------(2)

As per eq :1 ----(x2,y2)=(1.476,0.259),,

Similarly, we need to calculate from 0 to 90 degrees of angle positions with 10 degrees as interval.

We will get for each link1 position, the link2 manipulator will operate in all specified angle positions in working space.

Errors:

  1. Wrongly mentioned ‘ linspace’ command.

Error was eliminated after typo error correction.

  1. While creating animation the command for movie creation didn’t work properly because of case sensitives in syntax.

After checking in matlab program files in C drive. I adjusted to movie(M)

Programing Code:

%Farward Kinematics of robotics%
%inputs%
%Length of the links%
l1=1;
l2=0.5;
%Angle of operation at different positions%
theta1=linspace(0,90,10)
theta2=linspace(0,90,10)
%Starting coordinates%
x0=0;
y0=0;
%w.r.to link1 angle link2 also will change%
ct=1
for i=1:length(theta1)
    THETA1=theta1(i);
    for j=1:length(theta2)
        THETA2=theta2(j);
        %1st link%
        %coordinates%
        x0=0;
        y0=0;
        x1=l1*cosd(THETA1);
        y1=l1*sind(THETA1);
        %2nd link%
        x2=x1+l2*cosd(THETA2);
        y2=y1+l2*sind(THETA2);
        %ploting%
        plot([x0,x1],[y0,y1],[x1,x2],[y1,y2],'linewidth',2);
        axis([-0.1 1.5 0 1.5])
        pause(0.1)
        M(ct)=getframe(gcf);
        ct=ct+1;
        
    end
end
        movie(M)
        videofile=VideoWriter('FWD_kinematics.avi','Uncompressed AVI');
        open(videofile)
        writeVideo(videofile,M)
        close(videofile)

Youtube link ;https://www.youtube.com/watch?v=2IsjNjei_Ys

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.