All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Simulation/Forward Kinematic of a 2R Robotic Arm Aim:- Development of a program in Matlab to simulate the forward kinematics of a 2R Robotic Arm and to create an animation file of the plot. Principle:- Forward kinematics refers to the use of the kinematic equations of a robot to determine the position of the manipulator…
Saransh Dimri
updated on 24 Nov 2020
Simulation/Forward Kinematic of a 2R Robotic Arm
Aim:-
Development of a program in Matlab to simulate the forward kinematics of a 2R Robotic Arm and to create an animation file of the plot.
Principle:-
Forward kinematics refers to the use of the kinematic equations of a robot to determine the position of the manipulator from specified values for the joint parameters. The kinematics equations of the robot are used in robotics and animation.
Theory:-
Robot kinematics refers to the analytical study of the motion of a robot manipulator, robotic arm is the most useful mechanical device which is used where accuracy and precision are needed. These things work similarly to the human arm and can be programmed as well. The traditional robotic arm will have n number of links, which are connected by joints with which links are rotated or translated. These links and joints form a Kinetic chain which has a Manipulator at the last link.
The above kinematics is made on Matlab Software
Steps Used-
Step 1 -: Calculating the position of Link 1
Start Point = (x0,y0) =(0,0)
End Point =(x1,y1) = (L1cos(theta1),L1sin(theta1)
Step 2 -: Calculating the position of Link 2
Start Point = (x1,y1) =(L1cos(theta1),L1sin(theta1))
End Point =(x2,y2) = (x1+L2cos(theta2),y1+L2sin(theta2))
Step 3 -: Calculating the Solution Set
[x0,y0],[x1,y1],[x2,y2]
Step 4 -:Plotting of a graph and its animation
We have used different values for each value of theta1 and theta2 for both links and stitch together to make an animation
_____________________________________________________________________________________________
CODE->
%Program with an animation plot forward kinematics of robotic arm
clear all
close all
clc
%Inputs
l1=1;
l2=0.5;
theta1=linspace(0,90,10);
theta2=linspace(0,90,10);
%For loop using
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 1.5 0 1.5])
pause(0.03)
M(ct) = getframe(gcf);
ct=ct+1;
end
end
movie(M)
videofile= VideoWriter('forward_kinematics.avi','Uncompressed AVI')
open(videofile)
writeVideo(videofile,M)
close(videofile)
__________________________________________________________________________________________
Explanation of the above code -:
Comments are used to make the code user friendly
linspace command is used to greater 10 numbers between 0 to 90 with an equal interval or gap
plot method was used to generates xy plot , linewidth was used to give width to the line in the plot
gets a frame from the figure or plot
Result:-
Click on the link below to view the Simulation of the 2R Robotic Arm
Youtube link for an animation
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 11 Project 2- MATLAB Module to calculate Forces and Displacements for a 3D Frame Structure(nonlinear analysis)
Objective: MATLAB Module to calculate Forces and Displacements for a 3D Frame Structure(nonlinear analysis) Solution procedure: 1) Develop a Matlab function to accept Node information: Node numbers, Node coordinates, and information on nodes to perform analysis on a 3D planar frame structure. 2) Based on the Matlab…
08 Aug 2022 02:32 PM IST
Week 1-Model Creation in DesignModeler Challenge
Objective: Model a butterfly valve Solution Procedure: 1 - Main Housing 2)SHAFT 3) UPPER PLATE:- 4) LOWER PLATE:- 5) BUTTERFLY VALVE ASSEMBLY IMPORT THE GEOMETRY FILE 6)BOLT AND NUT CONCLUSION AND LEARNING:- Learned about using design modeller learned about components sketch tools learned about…
18 Apr 2022 04:56 PM IST
Week 6 Project 1- MATLAB Module to calculate Forces and Displacements for a 3D Frame Structure(Linear analysis)
Objective: MATLAB Module to calculate Forces and Displacements for a 3D Frame Structure(Linear analysis) Solution procedure: 1) Develop a Matlab function to accept Node information: Node numbers, Node coordinates, and information on nodes to perform analysis on a 3D planar frame structure. 2) Based on the Matlab module…
08 Apr 2022 08:33 AM IST
Week 10 Challenge- Frame analysis and MATLAB Module for Gauss Elimination Method
OBJECTIVE:- 1) Assume a structure frame. Write down a displacement matrix with variables corresponding to pre-selected degrees of freedom and degrees of freedom to be eliminated. Mathematically, derive the process that takes the original set of equations and condense it to the form shown below Equtaion given is[k][δ]=[p]The `[delta(b)…
03 Apr 2022 08:03 AM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.