Sei sulla pagina 1di 8

DEPARTAMENTO DE ENERGA Y MECNICA

INGENIERA MECATRNICA

ROBTICA INDUSTRIAL

NOMBRE:
Christian Canchignia

CARRERA:
Ingeniera Mecatrnica

NIVEL:
9no

TEMA:

Herramientas de Robtica de Matlab para realizar


operaciones bsicas de traslacin y rotacin.

LATACUNGA ECUADOR
TRABAJO EN CLASE
ROBTICA INDUSTRIAL
MODELAMIENTO DE ROBOT INDUSTRIAL
Resolucin

PROBLEMA CINEMATICO DIRECTO PARA UN ROBOT PLANAR DE 2 GDL TIPO RRl1=80;


%Longitud del primer eslabon
l2=50; %Longitud del segundo eslabon
th1=[0:(pi/2)/20:pi/2]; %Dibujar 21 puntos trayectoria que
recorre el EF
th2=[0:(pi/2)/20:pi/2]; %Articulaciones 1 y 2 varian de 0 a 90
grados
px=l1*cos(th1)+l2*cos(th1+th2); %Ecuaciones obtenidas por metodo
geometrico
py=l1*sin(th1)+l2*sin(th1+th2); %La posicion X,Y del EF
plot(px,py)
pause

t1=100; %Valor para la primer articulacion (prismatica)


th=[0:(pi/2)/20:pi];
x=t1+l1+l2*cos(th); %Ecuaciones obtenidas por el metodo geometrico
y=l2*sin(th); %La posicion X,Y del EF
plot(x,y)

2
clc
clear

%MODELAMIENTO DE ROBOTS INDUSTRIALES


%
%PRIMER SCRIPT
L1=1;
L2=1;
th1=0:(pi/2)/20:pi/2;
th2=0:(pi/2)/20:pi/2;
px=L1*cos(th1)+L2*cos(th1+th2);
py=L1*sin(th1)+L2*sin(th1+th2);
plot(px,py);

disp('pulse una tecla para seguir');


pause;
%borrar todas las variables ceradas anteriormente
clear all
%cerrar todas las figuras
close all
%
%LLAMADA A UNA FUNCIN
%llamada con 0 argumentos de salida
pcd(1,1,0:pi/20:pi/2,0:pi/40:pi/4)
disp('pulse una tecla');
pause

%llamada con 1 argumento de salida


p=pcd(1,1,0:pi/20:pi/2,0:pi/40:pi/4);
sprintf('p es un vector %d x %d\n',size(p,1),size(p,2))
plot(p(1,:),p(2,:))
disp('pulse una tecla');
pause

3
%llamada con 2 argumentos de salida
[px,py]=pcd(1,1,0:pi/20:pi/2,0:pi/40:pi/4);
sprintf('px es un vector %d x %d\n',size(px,1),size(px,2))
sprintf('py es un vector %d x %d\n',size(py,1),size(py,2))
plot(px,py)
disp('pulse una tecla');
pause

close all

%SEGUNDO SCRIPT
%Modificacion del primer script para llamar a la funcion
L1=1;
L2=1;
th1=0:(pi/2)/20:pi/2;
th2=0:(pi/2)/20:pi/2;
p=pcd(L1,L2,th1,th2);
plot(p(1,:),p(2,:),'b-s');

disp('pulse una tecla para seguir');


pause;
%borrar todas las variables creadas anteriormente
clear all
close all

%TERCER SCRIPT
%Modificacion del script para pintar (ubicar) el robot en la posicion
final
L1=1;
L2=1;
th1=0:(pi/2)/20:pi/2;
th2=0:(pi/2)/20:pi/2;
%esperar 1 segundo para continuar
pause(1);
%si no es el ultimo punto, borrar la figura
%if(n<Npuntos)
% clf;
%end
%end
disp('pulse una tecla para seguir');
pause;
%borrar todas las variables creadas anteriormente
clear all
close all

%Trayectoria 2
Npuntos=10;
L1=1;
L2=1;
% puntos inicial y final de la trayectoria
p1=[2;0];
p2=[0;2];
u=(p2-p1); %vector que une los puntos
%Construir una matriz p con los puntos intermedios
p=p1*ones(1,Npuntos+1)+u*[0:Npuntos]/Npuntos;
%calcular para cada punto la posicion articular
th=pcd(L1,L2,p(1,:),p(2,:));
%inicializar los puntos de la trayectoria la matriz vacia
pxy=[];
for n=0:Npuntos
%Como las matrices en MATLAB se indexan desde "uno", el punto "n"
esta
4
%en la columna "n+1"
th1=th(1,n+1);
th2=th(2,n+1);
pxy=[pxy pcd(L1,L2,th1,th2)];
plot(pxy(1,:),pxy(2,:),'b-s')
hold on;
robot(L1,th1,pxy(:,end)');
hold off
pause(1)
if(n<Npuntos)
clf;
end
end
disp('pulse una tecla para seguir')
pause;
% borrar todas las variables creadas anteriormente
clear all
close all

%TRAYECTORIA 3
Npuntos=10;
L1=1;
L2=1;
p1=[1; 1];
p2=[-1; 0];
u=(p2-p1); %Vector de la recta
p=p1*ones(1,Npuntos+1)+u*[0:Npuntos]/Npuntos;
th=pcd(L1,L2,p(1,:),p(2,:));
pxy=[];
for n=0:Npuntos
th1=th(1,n+1);
th2=th(2,n+1);
pxy=[pxy pcd(L1,L2,th1,th2)];
plot(pxy(1,:),pxy(2,:),'b-s');
hold on;
robot(L1,th1,pxy(:,end)');
hold off;
pause(1);
if (n<Npuntos)
clf;
end
end
disp('Pulse una tecla para seguir');
pause;
%Borrar todas las variables creadas anteriormente
clear all
close all

%TRAYECTORIA 4
Npuntos=10;
L1=1;
L2=1;
p1=[1; 0];
p2=[-1; 0];
u=(p2-p1); %Vector director de la recta
p=p1*ones(1,Npuntos+1)+u*[0:Npuntos]/Npuntos;
th=pcd(L1,L2,p(1,:),p(2,:));
pxy=[];
for n=0:Npuntos
th1=th(1,n+1);
th2=th(2,n+1);
pxy=[pxy pcd(L1,L2,th1,th2)];
plot(pxy(1,:),pxy(2,:),'r-s');
5
hold on;
robot(L1,th1,pxy(:,end)');
hold off;
pause(1);
if (n<Npuntos)
clf;
end
end
disp('Pulse una tecla para seguir');
pause;
%Borrar todas las varia
bles creadas anteriormente
clear all
close all

6
7
8

Potrebbero piacerti anche