All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Aim: Write a program in Matlab to simulate the forward kinematics of a 2R Robotic Arm, as shown in the video. Create an animation file of the plot. What is forward kinematics ? Forward kinematics refers to the use of the kinematic equations of a robot to compute the position of the end-effector from specified…
Shaik Faraz
updated on 14 Apr 2022
Aim:
Write a program in Matlab to simulate the forward kinematics of a 2R Robotic Arm, as shown in the video.
What is forward kinematics ?
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. The reverse process that computes the joint parameters that achieve a specified position of the end-effector is known as inverse kinematics.
Here we have to create a program to simulate the forward kinematics of a 2R Robotic Arm, where 2R refers to 2 rotating links.
Theory:
Here a schematic representation of robotic arm with 2 links of length l1 and l2 is given
And the angles of both links l1 and l2 are known theta1 and theta 2 respectively
There two steps to find the position of links
Step 1
Two end points
Coordinates
Step 2
Two end points
Coordinates
Now we have all 3 Co-ordinates
(x0,y0) (x1,y1) (x2,y2)
## Code for simulating the Forward Kinematics of a 2R Robotic Arm ##
clear all
close all
clc
l1 =3;
l2 =2;
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);
plot([x0 x1],[y0 y1],[x1 x2],[y1 y2],LineWidth=3,Marker="o")
axis([-1 6 -1 6])
pause(0.002)
M(ct) = getframe(gcf);
ct = ct+1;
end
end
movie(M)
videofile_robtic_arm = VideoWriter('videofile_robotic_arm.avi','Uncompressed AVI');
open(videofile_robtic_arm)
writeVideo(videofile_robtic_arm,M)
close(videofile_robtic_arm)
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...
Project 1 : CFD Meshing for Tesla Cyber Truck
Aim: Performing topological cleanup and surface mesh on tesla cyber truck and on a wind tunnel based on selected target length values of its different components using element type as Tria, as well as appropriate selection of the volume that contains the vehicle and its surroundings with the wind tunnel for volumetric…
15 Nov 2022 04:17 AM IST
Week 5 Challenge : Surface wrap on Automotive Assembly
Aim: Perforform Topo cleanup and delete unwanted surfaces for Surface wrap. After Topo cleanup, Merge all 3 models and perform surface wrap. Target length for Wrap = 3 mm 1. Engine: 2. Gear box: 3. Transmission: Procedure: 1. Topo Cleanup : (Engine, Transmission & Gear Box)…
10 Nov 2022 08:22 AM IST
Week 4 Challenge : CFD Meshing for BMW car
Aim: To perform topological clean-up, and carry out the surface meshing of a BMW M6 car model and create a wind tunnel surrounding the same. Objectives: For the given model, check and solve all geometrical errors on half portion and Assign appropriate PIDs. Perform meshing with the given Target length and element Quality…
07 Nov 2022 11:33 AM IST
Week 3 Challenge : CFD meshing on Turbocharger
Aim: Performing CFD meshing on Turbocharger using ANSA Objective: For the given model, check for the geometrical errors to make appropriate volumes. Create and assign PIDs as shown in the video. Perform surface mesh with the given target lengths as per PIDs. Blade stage-1 = 1 mm Blade stage-2 = 1 mm Impeller = 2 mm…
03 Nov 2022 08:06 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.