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 a 2R Robotic Arm Theory: 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.…
Palukury Bereshith Jacob Alapan
updated on 20 Apr 2020
Aim: To simulate the forward kinematics of a 2R Robotic Arm
Theory:
MATLAB Program:
%Program to simulate working space of 2R robotic arm
clear all
close all
clc
%inputs
l1 = 1;
l2 = 0.5;
angle1 = linspace(0,90,10);
angle2 = linspace(0,90,10);
x0 = 0;
y0 = 0;
temp = 1;
%Simulation
for i = 1:length(angle1)
theta1 = angle1(i);
for j = 1:length(angle2)
theta2 = angle2(j);
x1 = x0+l1*cosd(theta1);
y1 = y0+l1*sind(theta1);
x2 = x1+l2*cosd(theta2);
y2 = y1+l2*sind(theta2);
plot([x0 x1],[y0 y1],[x1 x2],[y1 y2],'linewidth',4)
axis([0 1.5 0 1.5])
pause(0.3);
M(temp) = getframe(gcf);
temp = temp+1;
end
end
movie(M)
simulation = VideoWriter('Robotic_Arm_Simulation','Uncompressed AVI');
open(simulation)
writeVideo(simulation,M)
close(simulation)
Steps:
1) Define all the inputs
2) To run the same MATLAB program desired number of times, 'nested for loop' was used
3) Using MATLAB plot graphs all the positions of links that we have obtained for each angle was plotted.
4) The 'pause' command is used to get better animation speed.
5) The 'getframe' command was used to capture the motion of lines stored in variable 'M'.
7) To make a movie of all plots 'movie' command was used, it has to be stored in a variable 'M' and it has to be indexed. While defining inputs, a temporary variable must also be defined to index the plot.
8) To save this movie, the ‘videofile’ command is used which has the option to store the video in an Uncompressed ‘avi’ format along with the file name.
9) Then the video avi file is opened after the plot.
Errors:
Solution: The function must have uppercase 'V', and it is written as 'writeVideo'
Solution: In the relation '*' was not given, the correct relation is 'x1=x0+l1*cosd(theta1);'
Results:
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...
Powertrain for aircraft in runways
1) Search and list out the total weight of various types of aircraft. Weight is the force generated by the gravitational attraction of the earth on the airplane. Each part of the aircraft has a unique weight and mass, and for some problems, it is important to know the distribution.…
18 Feb 2021 11:35 AM IST
Braking
1) For a defined driving cycle, calculate the energy required for braking. We have to create a drive cycle excel file with random data of velocity concerning that time and plotted them to see the drive cycle Then import that file into Matlab. Then to create an array into the command window by entering code braking_energy…
15 Feb 2021 02:33 PM IST
Duty Cycle
1) Why power electronics circuits are efficient? In practice, which types of losses occur in power electronics circuits? Power Electronics: Power electronics involves the study of electronic circuits intended to control the flow of electrical energy. These circuits handle power flow at levels much higher than the individual…
14 Feb 2021 01:28 PM IST
Induction Motor Characteristics - II
1) Discuss the equivalent circuit network of the induction motor MATLAB model. Equivalent circuit of an Induction motor: In the equivalent circuit, R1 represents the resistance of the stator winding and X1 the stator leakage reactance (flux that does not link with the air gap and rotor). Magnetizing reactance required…
14 Feb 2021 09:26 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.