0% found this document useful (0 votes)
20 views2 pages

Practica

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

Practica

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

close all

clear
clc

%Longitudes de los eslabones


a = 2.170;
b = 2.067;
c = 2.310;
d = 1;
f = 5.4;
g = 0;

%Angulos Iniciales
Theta1 = -102;
Theta2in = 0;
Theta2fin = 360;
cont = 1;

for Theta2 =Theta2in:1:Theta2fin


n = Theta2 - Theta2in;
A = -2*a*d* (cosd(Theta1)*cosd(Theta2) + sind(Theta1)*sind(Theta2));
B = c^2 + a^2 + d^2;
C = 2*c*d*cosd(Theta1) - 2*a*c*cosd(Theta2);
D = 2*c*d*sind(Theta1) - 2*a*c*sind(Theta2);
E = b^2 - B - A;
F = C+E;
G = -2*D;
I = E-C;
J = a^2 + b^2 + d^2;
K = 2*a*b*sind(Theta2) - 2*b*d*sind(Theta1);
L = 2*a*b*cosd(Theta2) - 2*b*d*cosd(Theta1);
M = -2*a*d*(cosd(Theta1)*cosd(Theta2) + sind(Theta1)*sind(Theta2));
N = -c^2 + J + M;
H = N-L;
O = L+N;
P = 2*K;
Theta3 = 2*atand((-P / (H*2)) + ((sqrt(P^2 - H*O*4)) / (H*2) ));
Theta4 = 2*atand((-G/ (F*2)) + ((sqrt(G^2 - F*I*4)) / (2*F) ));

%Calculo de los ángulos y longitud de la corredera


Theta5 = 180 - asind((c*sind(Theta4)-g)/f);
h = c*cosd(Theta4) - f*cosd(Theta4);

theta4(cont,1) = Theta4;
theta2c(cont,1) = Theta2;

Angulotran = abs(Theta3-Theta4);
if Angulotran>90
Angulo = 180 - Angulotran;
else
Angulo = Angulotran;
end

anguloc(cont,1) = Angulo;

Trans = Theta5 - 90;


if Trans>90
trans = 180 - Trans;
else
trans = Trans;
end
transc(cont,1) = Trans;

Z1 = d*(cosd(Theta1) + 1i*sind(Theta1) );
Z2 = a*(cosd(Theta2) + 1i*sind(Theta2));
Z3= b*(cosd(Theta3) + 1i*sind(Theta3));
Z4 = c*(cosd(Theta4) + 1i*sind(Theta4));
Z6 = f*(cosd(Theta5) + 1i*sind(Theta5));

Z = [0 Z2 Z2+Z3 Z2+Z3-Z4];
ZZ = [0 Z2 Z2+Z3 Z2+Z3-Z6 ];
ground1 = [0 Z2+Z3-Z4];
ground2 = [Z2+Z3-Z4 Z2+Z3-Z6];

subplot(4,1,1)
plot(Z,'Color','b','Marker','o','LineWidth',2)
hold on
plot(ZZ,'Color','b','Marker','o','LineWidth',2)
plot(ground1,'Color','k','Marker','o','LineStyle','--','LineWidth',2)
plot(ground2,'Color','k','Marker','o','LineStyle','--','LineWidth',2)
z6(cont,1) = Z6;
hc(cont,1) = h;
xlim([-2.5 8])
ylim([-4 4])
grid on
hold off
title('Mecanismo')

subplot(4,1,2)
plot(theta2c,theta4,'Color','r','LineWidth',1)
grid on
xlim([Theta2in Theta2fin])
title('Theta2 vs Theta4')

subplot(4,1,3)
plot(theta2c,hc,'Color','r','LineWidth',1)
xlim([Theta2in Theta2fin])
grid on
title('Theta2 vs Corredera')

subplot(4,1,4)
plot(theta2c,anguloc,'Color','r','LineWidth',1)
hold on
plot(theta2c,transc,'Color','b','LineWidth',1)
hold off
xlim([Theta2in Theta2fin])
ylim([0 90])
grid on
title('Theta2 vs angulo de transmision')
legend('B','C')

pause(0.005)
cont = cont + 1;
end

You might also like