All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM - Program in Matlab to simulate the forward kinematics of a 2R Robotic Arm OBJECTIVE - Program in Matlab to simulate the forward kinematics of a 2R Robotic Arm PROCEDURE - The robotic arm is a mechanical arm us for different industrial operations. And it’s a programmable. The robotic arm is mainly consists with…
Aniket Kumbhar
updated on 06 Jun 2022
AIM -
Program in Matlab to simulate the forward kinematics of a 2R Robotic Arm
OBJECTIVE -
Program in Matlab to simulate the forward kinematics of a 2R Robotic Arm
PROCEDURE -
The robotic arm is a mechanical arm us for different industrial operations. And it’s a programmable. The robotic arm is mainly consists with the joints & links. The all links are joined with each other with a joint which calls servo motors & balancer. Forward kinematics is the optimizing the position & orientation of the manipulator in terms of joint variables.
Here,
Determining equation –
L1 = LENGHT OF ARM 1
L2 = LENGTH OF ARM 2
Q1 = ANGLE OF LINK 1
Q2 = ANGLE OF LINK 2
In MatLab staring our program with these 3 commands. Clear all - this command close all stored data in previous workspace Close all – this command close all previous figures, diag. Clc – this clears the command window. Now, First give the inputs for the link 1 , link 2 , theta 1, theta 2. with a ‘linspace’ command for equal gap within points. We have to define the theta 1 & 2 the separately so we can get the sets of value of x & y, now coordinates for starting Point the link 1 is defined.
The coordinates of end point link 1 or 2 are defined. Here ‘cosd’ & ‘sind’ is used to store values in degree. Then plotting the all points is done using the plot command having a line width is 7 unit. To determine the differentiate The link the legend command is used it helps to determines link with colour. For labelling the x axis and y axis we use the command of xlabel & ylabel and the pause command is use to pausing the program before processing the new sets of value.
For creating a move or animation is defined before for loop command as a ct and the variable is ‘M’. For capturing the frame every time ‘for’ command is used. Increment of ‘ct’ is add as 1. After for loop is ended, creating complete movie with command ‘movie’ assigning the filename and the then ‘writevideo’ Command used to make video and plot frame. And finally the ‘close’ command to close video.
here, the all report for progrming , analysising, graphs, video outputs are attchend bellow in brif explanation,
The youtube link for video output - https://youtu.be/rgzBFjp-ucU
The program -
clear all
close all
clc
%inputs
l1 = 1;
l2 = 0.5;
theta1 = linspace(0,90,10);
theta2 = linspace(0,90,10);
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);
%ploting
plot([x0 x1],[y0 y1],[x1 x2],[y1 y2],'linewidth',7)
axis([-0.1 1.5 0 1.5])
pause(0.3)
N(ct) = getframe(gcf);
ct = ct+1;
end
end
movie(N);
videofile = VideoWriter('forward_kinematics_with_forloop.avi','Uncompressed AVI');
open(videofile)
writeVideo(videofile,N)
close(videofile)
First graph output -
problem while running the program due to typing mistake , that is i change the capitle M fo movi with small m then it resolved.
Please find attached documents,....
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 - Final project
Aim: To Creation of CAD model considering Class A surface, Nominal thickness and Attachment strategy. Objective: To Creation of CAD model considering Class A surface, Nominal thickness and Attachment strategy. Create thickened part using master section for reference Create the mounting features as per design guidelines…
05 Jan 2023 11:12 AM IST
Hood design-Week 2
HOOD DESIGN OF A CAR AIM : To design the hood of a car with the given input Outer panel and its dimensions. Hood Introduction : The hood (North American English) or bonnet (Commonwealth English) is the hinged cove over the engine of motor vehicles. Hoods can open to allow access to the engine compartment…
01 Nov 2022 10:50 AM IST
Week 8 - Challenge 4 - Bumper
BUMPER DESIGN AIM: to make a model from the provided class-A surface.INTRODUCTION:CLASS-A SURFACE: a surface made by the designer which is given as an input to the plastic modeler to work on. It is aesthetic surfaceand the outer most surface.CLASS-B SURFACE: a surface below a certain thickness from the class-A…
18 Sep 2022 08:20 PM IST
Week 10- Assembly Workbench
AIMIn this week’s assignment, you will have to create 2 assemblies according to the contentcovered in the course videos. You will be provided with 2D diagrams of the componentsand you will have to first create the individual part files and then create a completeassembly of those part files in the assembly workbench.…
14 Sep 2022 01:38 PM 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.