Project

Forward Kinematics Simulation of 2R Robotic Arm Using MATLAB/OCTAVE

Aim:- Forward Kinematics Simulation of 2R Robotic Arm using MATLAB/OCTAVE.

Softwares used:- MATLAB,OCTAVE

This program code is written in octave.

Introduction:-

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

The kinematics equations of the robot are used in robotics, computer games, and animation. The reverse process that computes the joint parameters that achieve a specified position of the end-effector is known as inverse kinematics.

Governing equation:-

Kinematics equations

The kinematics equations for the series chain of a robot are obtained using a rigid transformation [Z] to characterize the relative movement allowed at each joint and separate rigid transformation [X] to define the dimensions of each link. The result is a sequence of rigid transformations alternating joint and link transformations from the base of the chain to its end link, which is equated to the specified position for the end link,

[T] = [Z1][X1] [Z2][X2]… [Zn] [Xn-1]

where [T] is the transformation locating the end-link. These equations are called the kinematics equations of the serial chain.

Objective:-

  1. To calculate different values of the variables needed to study the link positions with respect to the joints.
  2. To create an animation simulating the manipulator movement.

Free Hand Diagram of Robotic Arm:-

Initial Inputs:-

Length of link1= 1 metres

Length of link2=0.5 metres

Starting point of link1=(X0,Y0)=(0,0)

End point of link1=(X1,Y1)=(`L1cos theta1, L1sin theta1`)

Start point of link2=End point of link1=(X1,Y1)

End point of link2=(X2,Y2)=[(X1+`L2 cos theta2`), (Y1+`L2 sin theta2`)`

`theta1` and `theta2` will vary from 0 to 90 degrees with each interval of 10(linspace function in code).

Program Code:-

%a program to simulate forward kinematics of 2r robotic arm in octave
%initial values

l1=1; %length of link1 in metres
l2=0.5; %length of link2 in metres
theta1=linspace(0,90,10); % angle between link1 and base in degrees
theta2=linspace(0,90,10); % angle between link2 and base in degrees
Ct=1;  %counter value for loop

% for loop for getting each values of variables with respect to theta 1 and theta2

for i=1:length(theta1)
    THETA1=theta1(i)
    for j=1:length(theta2)
        THETA2=theta2(j)
x0=0; %x value at base
y0=0; %y value at base
x1=l1*cosd(THETA1); %x value at end of link1 or start of link2
y1=l1*sind(THETA1); %y value at end of link1 or start of link2
x2=x1+l2*cosd(THETA2); %x value at end of link2
y2=y1+l2*sind(THETA2);%x value at end of link2

%plotting

plot([x0 x1], [y0 y1],[x1 x2], [y1 y2], "linewidth",3)
axis([-0.1 2, 0 2]) %axis limits set
pause(0.01)

%getting images for each counter for animation

M(Ct)=getframe(gcf);
text_file=sprintf("armanimation%d.png",Ct)
saveas(gca,text_file)
Ct=Ct + 1;
    end
end

Result:-

Animation:-

https://youtu.be/nk7mQ70ZDOU youtube link

https://drive.google.com/open?id=1X00dmfnLod1tGSkjWSUM0LdBR43x0VqH google drive link

Conclusion:-

  1. We computed the simulation of the movement of robotic arm by changing values of theta1 and theta2 representing similarly as in real world working of the same.
  2. In robotics, inverse kinematics makes use of the kinematicsequations to determine the joint parameters that provide a desired position for each of the robot's end-effectors. pecification of the movement of a robot so that its end-effectors achieve the desired tasks is known as motion planning. The movement of a kinematic chain, whether it is a robot or an animated character, is modelled by the kinematics equations of the chain. These equations define the configuration of the chain in terms of its joint parameters. Forward kinematics uses the joint parameters to compute the configuration of the chain, and inverse kinematics reverses this calculation to determine the joint parameters that achieve a desired configuration.
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.