Está en la página 1de 6

Stephanny Cedeño Vázquez. Matricula: 120035997. Ingeniería Mecatrónica. Grupo: M178.

Correo: 120035997@upq.edu.mx

“Mecanismo de 5 barras”
Stephanny Cedeño Vázquez. Matricula: 120035997. Ingeniería Mecatrónica. Grupo: M178.
Correo: 120035997@upq.edu.mx

% Modelo Cinemático Mecanismo de 5 barras if i<=180


clear Cx=Cx2;
close all Cy=Cy2;
clc elseif i>180
% Datos Cx=Cx1;
AB= 0.10; Cy=Cy1;
BC= 0.15; else
DC= 0.15; end
ED= 0.10; vCx(v)=Cx;
v=0; vCy(v)=Cy;
VBx(v)=Bx;
for i=0:0.01:0.1 %i es el contador, valor VBy(v)=By;
inicial=0, ":" incremento VPx(v)=Px;
v=v+1; VPy(v)=Py;
%Traqyectoria línea horizontal VDx(v)=Dx;
Ax=0; VDy(v)=Dy;
Ay=0; %derivadas para velocidad
Ex=.1; dBx=diff(VBx)/0.01;
Ey=0; dBy=diff(VBy)/0.01;
Px=i; dPx=diff(VPx)/0.01;
Py=0.2; dPy=diff(VPy)/0.01;
vPx(v)=Px; dDx=diff(VDx)/0.01;
vPy(v)=Py; dDy=diff(VDy)/0.01;
%Modelo Cinemático Inverso.
AC= sqrt(Px^2+Py^2); figure(1)
alpha1= atan(Py/Px); plot([Ax,Bx],[Ay,By],'-b',...
Beta1=acos((AC^2+AB^2-BC^2)/(2*AC*AB)); [Bx,Cx],[By,Cy],'-b',...
theta1= alpha1+Beta1; [Cx,Dx],[Cy,Dy],'-b',...
[Dx,Ex],[Dy,Ey],'-b',...
EC= sqrt((Ex-Px)^2+Py^2); [Ax,Ex],[Ay,Ey],'-k',...
alpha2= atan(Py/(Ex-Px)); vPx,vPy,'.r',...
Beta2=acos((EC^2+ED^2-DC^2)/(2*EC*ED)); vCx,vCy,'og',...
theta2= pi-alpha2-Beta2; Ax,Ay,'om',...
%Modelo Cinemático Directo. Bx,By,'om',...
Bx=AB*cos(theta1); Cx,Cy,'og',...
By=AB*sin(theta1); Dx,Dy,'om',...
Dx=Ex+ED*cos(theta2); Ex,Ey,'om')
Dy=ED*sin(theta2); grid on
%Cálculo Simbólico grid minor
syms SolCx SolCy axis([-.15 .25 -.1 .25])
title('Mecanismo de 5 Barras')
ec1= BC^2==(SolCx-Bx)^2+(SolCy-By)^2; xlabel('X (m)')
%Ecuación 1 ylabel('Y (m)')
ec2= DC^2==(Dx-SolCx)^2+(Dy-SolCy)^2;
%Ecuación 2 end
ec=[ec1,ec2]; %Declarar un sistema de
ecuaciones. figure(2)
Solc=solve(ec,[SolCx,SolCy]); %Resolver plot(VBx,'-g');
sistema de ecuaciones. title('Posición')
ValCx=eval(Solc.SolCx); %Resolución en xlabel('Tiempo(s)')
valor numérico ylabel('Posicion Bx(m)')
ValCy=eval(Solc.SolCy); legend('Posicion Bx','Location','northeast')
Cx1=ValCx(1); grid minor
Cx2=ValCx(2);
Cy1=ValCy(1); figure(3)
Cy2=ValCy(2); plot(VBy,'-m');
Stephanny Cedeño Vázquez. Matricula: 120035997. Ingeniería Mecatrónica. Grupo: M178.
Correo: 120035997@upq.edu.mx

title('Posición')
xlabel('Tiempo(s)') figure(9)
ylabel('Posicion By(m)') plot(dBy,'-m');
legend('Posicion By','Location','northeast') title('Velocidad')
grid minor xlabel('Tiempo(s)')
ylabel('Velocidad VBy(m/s)')
figure(4) legend('Velocidad
plot(VPx,'-g'); VBy','Location','northeast')
title('Posición') grid minor
xlabel('Tiempo(s)')
ylabel('Posicion Cx(m)') figure(10)
legend('Posicion Cx','Location','northeast') plot(dPx,'-g');
grid minor title('Velocidad')
xlabel('Tiempo(s)')
figure(5) ylabel('Velocidad VCx(m/s)')
plot(VPy,'-m'); legend('Velocidad
title('Posición') VBx','Location','northeast')
xlabel('Tiempo(s)') grid minor
ylabel('Posicion Cy(m)')
legend('Posicion Cy','Location','northeast') figure(11)
grid minor plot(dPy,'-m');
title('Velocidad')
figure(6) xlabel('Tiempo(s)')
plot(VDx,'-b'); ylabel('Velocidad VBy(m/s)')
title('Posición') legend('Velocidad
xlabel('Tiempo(s)') VCy','Location','northeast')
ylabel('Posicion Dx(m)') grid minor
legend('Posicion Dx','Location','northeast')
grid minor figure(12)
plot(dDx,'-b');
figure(7) title('Velocidad')
plot(VDy,'-r'); xlabel('Tiempo(s)')
title('Posición') ylabel('Velocidad VDx(m/s)')
xlabel('Tiempo(s)') legend('Velocidad
ylabel('Posicion Dy(m)') VDx','Location','northeast')
legend('Posicion Dy','Location','northeast') grid minor
grid minor
figure(13)
figure(8) plot(dDy,'-r');
plot(dBx,'-g'); title('Velocidad')
title('Velocidad') xlabel('Tiempo(s)')
xlabel('Tiempo(s)') ylabel('Velocidad VDy(m/s)')
ylabel('Velocidad VBx(m/s)') legend('Velocidad
legend('Velocidad VDy','Location','northeast')
VBx','Location','northeast') grid minor
grid minor
Stephanny Cedeño Vázquez. Matricula: 120035997. Ingeniería Mecatrónica. Grupo: M178.
Correo: 120035997@upq.edu.mx
Stephanny Cedeño Vázquez. Matricula: 120035997. Ingeniería Mecatrónica. Grupo: M178.
Correo: 120035997@upq.edu.mx
Stephanny Cedeño Vázquez. Matricula: 120035997. Ingeniería Mecatrónica. Grupo: M178.
Correo: 120035997@upq.edu.mx

También podría gustarte