Robot's Manipulator Kinematic Study and Workspace Visualization
Robot’s Manipulator Kinematic Study and Workspace Visualization.
AIM:
To visualize the simulation to analyze. To have understanding of workspace with the help of kinematics study of Manipulator (2d).
GOVERNING EQUATIONS IF ANY: -
The transformation matrix T for the end-effector with respect to the coordinate frame {n o a} is written as
In the transformation matrix T, the vector is the translation of end – effector frame from the reference frame and vectors (n , o, a) describe the orientation of end – effector.
The vector n, o, and a represent the X, Y, Z axes of the end-effector frame.
Matric T is applicable to any co-ordinate frame and any joint of the manipulator.
n is normal vector in the X axis.
o is orientation vector in the Y axis.
a is approach vector in the Z axis
OBJECTIVES OF THE PROJECT:-
- To calculate and find out the continuous variation in the position of end-effector with the variation in the input angles of links.
- To plot a continuous graph of the manipulator to visualize the workspace and movement of manipulator.
- Finally, to record this continuous simulation of graph in .AVI file, for the further analysis like smoothness, workspace, & working and also for the record.
BODY OF THE CONTENT: -
The Project has been coded in MATLAB, which Is also acceptable to RUN in OCTAVE, although some syntax for making record of simulation to form an video is different as of MATLAB.
Example:
file_text=sprintf(“output%d.png”,n)
saveas (gca, file_text);
Where,
- “output” is the user given filename for the file (it can be varied according to your convenience)
- “n” is the variable that changes its value for every loop iteration
Apart of this above mention code, rest all are were written same.
Some Glimpse are as follows : -
- Defined Input for Simulation are :-
- sdfsdssdf
Length of link 1 ; Length of link 2 ; Angle of link 1 - FOR-END LOOP : -
for i = 1 : length(theta1)
THETA1 = theta1(i)
for j = 1 : length(theta2)
THETA2 = theta2(j)
End
End
Error faced :-
For loop was terminated just after once as I missed out giving count for loop.
So after this given
ct = 1;
ct = ct+1;
- APPLIED MOVIE COMMAND :-
movie(S)
videofile = VideoWriter('Kinematic_manipulator_simulation.avi','Uncompressed AVI');
open(videofile)
writeVideo(videofile,S)
close(videofile)
Error faced : -
Misspelled the command write(videofile,S)
Result in error, so finally re-correct it as writeVideo(videofile,S).
INPUT REQUIRED :-
(X0 = 0 ,Y0 = 0) ; (X1 = L1*,Y1 = L1*) ; (X3 = L2*,Y3 = L2*
RESULTS : -
The following resultant were obtained after the successful MATLAB code execution.
https://youtu.be/CAag9UV6GxU - Animation of 2R kinematics analysis of robot manipulator would be easily accessible through this YouTube link
clear all
close all
clc
%Input
L1=1;
L2=0.5;
%For varying angle of link 1 and link 2 , constantly varying inputs
theta1 = linspace(0,90,40);
theta2 = linspace(0,90,40);
%count for the increament of loop after its completion everytime
ct = 1;
%we will have an dependency on the number of intermediate angle theta is
%taking in between (0 to 90), in the 'FOR' loop
for i = 1 : length(theta1)
THETA1 = theta1(i);
for j = 1 : length(theta2)
THETA2 = theta2(j);
%base coordinate of the manipulatoe
x0 = 0 ;
y0 = 0 ;
%end coordinate of link 1 or starting coordinate of link 2
x1 = L1*cosd(THETA1);
y1 = L1*sind(THETA1);
% finally the end coordinate of link 2 or end-effector
x2 = x1 + L2*cosd(THETA2);
y2 = y1 + L2*sind(THETA2);
%visualizing the simulation of graph to know the workspace of
%manipulator
plot([x0 x1],[y0 y1],[x1 x2],[y1 y2],'linewidth',3);
axis([-0.2 1.5 0 1.5])
pause(0.03)
%pause of 0.03 is neccessity to hold every frame to under the motion
S(ct) = getframe(gcf);
ct = ct + 1;
end
end
%finally recording the simulation as film as .avi file, for record and
%understanding of workspace concept
movie(S)
videofile = VideoWriter('Kinematic_manipulator_simulation.avi','Uncompressed AVI');
open(videofile)
writeVideo(videofile,S)
close(videofile)