Week 2- 2R Robotic Arm Challenge
AIM
To simulate the forward kinematics of the robotic arm using MATLAB
programming.
Objective:
Nowadays in the industries, most of the processes are automated by using
Robots, thus inorder to create the geometries of the robotic arm and its
workspace we have find the extent upto which the end effector can move with respect to the position of two arms. Thus by this program we can find the workspace and movement of one arm with respect to other.
sarting with
clear all
close all
clc
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
hold off
plot([x0 x1],[y0 y1],'linewidth',3,'color','r')
hold on
axis([-0.1 1.5 0 1.5])
plot([x1 x2],[y1 y2],'linewidth',3,'color','r')
M(ct) = getframe(gcf)
ct=ct+1
end
end
movie(M)
videofile = VideoWriter('forwar_kinematics.avi','Uncompressed AVI');
open(videofile)
writeVideo(videofile,M)
close(videofile)
PROGRAM ALGORITHM:
Inputs such as length of the two links and array of angles where it can move
is incorprated.
• FOR LOOP is used to find the length of the links at various position.
By trignometric formulae length of the links are found.
• Then two links positions are plotted and different images are captured
using the command to get the images at different frames.
• Inorder to get the images at various positions ct .ct-1,save as and sprintf
command are given.
• Now the captured images are made as a video file by using image magick
software.
Hence the 2R-ROBOTIC ARM CHALLENGE is done.
https://drive.google.com/file/d/1WWWE89XAxN4Yk5vzmxqToI3dmaYbdUy9/view?usp=sharing