Challenge

Week 2- 2R Robotic Arm Challenge

Aim:

To write a program in Matlab to simulate the forward kinematics of a 2R Robotic Arm, as shown in the video.

Basic Introduction:

In our Program, we are going to use the basic arms of the robot to do that we are dealing with the linkage known as Forward kinematics of a 2R Robotic arm (where 2R means 2-rotating Link i.e 2 is a number of link and R is rotation). ... We need to Animate the Arm and find out its behavior in Different conditions.

Points To Remember:

1.Co-ordinates of link 1

2.Co-ordinates of link 2

3.angles

4.Ploting

program:

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

clear all
close all
clc
% Inputs
l1=2;
l2=1;
theta1 = linspace(0,80,10);
theta2 = linspace(0,80,10);
a1=theta1;
a2=theta2;

ct=1;
for i= 1:length(a1) %represents the no of value in angle1
    A1=a1(i);
    for j= 1 : length(a2)
        A2=a2(j);
x0=0;
y0=0;
x1 = l1* cosd(A1);
y1 = l1* sind(A1);
x2 = x1+l2* cosd(A2);
y2 = y1+l2* sind(A2);
%plotting
plot([x0 x1],[y0 y1],[x1 x2],[y1 y2],'linewidth', 3);
axis([-0.3 3.6 -0.3 3.6])
pause(0.1);
M(ct)=getframe(gcf);
ct=ct+1;
    end
end
movie(M)
videofile = VideoWriter('forward_kinematics.mp4');
open(videofile)
writeVideo(videofile, M)
close(videofile)

Output:

Explanation:

1.Based on governing equation we are taking x,y Co-ordinates & theta's.

2.Perform and ploting the forward kinematics of a 2R Robotic arm.

Errors:

Reducing Errors:

I am facing Little bit of errors in plotting but Again Reduced by Relearn the video which was in our website Matlab skill-lync.

So My animation of forward kinematics of a 2R Robtic Arm YOUTUBE link was given below:

https://youtu.be/kHmrPs430dA

Coclusion:

It would be applicable in 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.

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.