All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM: To simulate the forward kinematics of the 2R arm manipulator in MATLAB. PROBLEM STATEMENT: L1 is the length of link1 and l2 is the length of link 2. θ1is the angle…
Bharath Gaddameedi
updated on 23 Feb 2022
AIM: To simulate the forward kinematics of the 2R arm manipulator in MATLAB.
PROBLEM STATEMENT:
L1 is the length of link1 and l2 is the length of link 2.
θ1is the angle between link 1 and horizontal and θ2 is between link 2 and horizontal axis.
and x0, y0 are the coordinates at the base. x1,y1 is the position of the joint between links 1 and 2.
x2, y2 is the end position of link 2.
OBJECTIVE:
CODE EXPLANATION:
Code
%forward kinematics of 2R robotic arm manipulator
clear
close all
clc
%inputs to define the geometry of mechanism
l1 = 1;
l2 = 0.5; % lengths of two arms of manipulator
theta1 = linspace(0,90,10);
theta2 = linspace(0,90,10); %angle between arms and horizontal axis
ct = 1; %counter for keeping track of frames
for i = 1:length(theta1)
THETA1 = theta1(i);
for j = 1:length(theta2)
THETA2 = theta2(j);
x0 = 0; y0 = 0; %base of the robotic arm
x1 = l1*cosd(THETA1); y1 = l1*sind(THETA1); %positions of link 1
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.5 0 1.5])
M(ct) = getframe(gcf); %saving the frames
ct = ct+1;
end
end
movie(M)
videofile = VideoWriter('Forward.avi','Uncompressed AVI');
open(videofile)
writeVideo(videofile,M)
close(videofile)
ERRORS While programming:
The most common error I have made during the programming is the mistakes with case-sensitive commands.
RESULTS:
The Matlab program is executed and the animation plot is hence obtained.
Link for the animation plot of 2R robotic arm manipulator: https://youtu.be/Sd87VtSnUdo.
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Week 1- Mixing Tee
…
08 Jul 2023 06:07 PM IST
Week 2 Challenge : Surface meshing on a Pressure valve
Surface meshing on a Pressure valve Aim: Check the geometrical errors on the pressure valve and perform topology cleanup. Meshing it for three target lengths. Objectives: Mesh it for target lengths 1mm, 3mm, and 5mm.…
10 Apr 2023 03:12 AM IST
Week 7 - Simulation of a 1D Super-sonic nozzle flow simulation using Macormack Method
Simulation of a 1D Super-sonic nozzle flow simulation using Macormack Method Aim: To simulate the isoentropic flow through a quasi 1D subsonic-supersonic nozzle using conservation and non-conservation forms of governing…
19 Dec 2022 08:52 AM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.