130 likes | 355 Views
Theory of Machines. Lecture 15. Four Bar Mechanism. F. 3. 3. A. 3. 2. 2. B. k. 4. 4. 4. 2. C. e. O. d. The Equation. 3. F. 3. A. 3. 2. 2. B. 4. 2. 4. 4. C. e. O. d. k. Mass Matrix. 3. F. 3. A. 3. 2. 2. B. 4. 2. 4.
E N D
Theory of Machines Lecture 15
Four Bar Mechanism F 3 3 A 3 2 2 B k 4 4 4 2 C e O d
3 F 3 A 3 2 2 B 4 2 4 4 C e O d k Mass Matrix
3 F 3 A 3 2 2 B 4 2 4 4 C e O d k Four bar Mechanism Joint O i=1 j=2 Joint A i=2 j=3 Joint B i=3 j=4 Joint C i=4 j=1
3 F 3 A 3 2 2 B 4 2 4 4 C e O d k Force Vector
3 F 3 A 3 2 2 B 4 2 4 4 C e O d k Acceleration
Matlab code global m2,i2,m3,i3,m4,i4, L2,L3,L4,L0,k,F % Define const L2= ___ ;L3=___ ;L4=___;d=___;e=_____; m2=___;m3=___;m4=___;L0=___;k=____; i2=m2*L2^2/12;i3=m3*L3^2/12;i4=m4*L4^2/12; F=____; % Initial geometry % calculate x2,y2 etc . . . y0=[x2;y2;th2;x3;y3;th3;x4;y4;th4;zeros(9:1)]; [t,y]=ode45(@difffour,[0,2],y0); figure(1) plot(t,y(:,9) xlabel(‘Time s’) ylabel(‘Theta 4’)
Matlab Code function ydot=difffour(y,t) global m2,i2,m3,i3,m4,i4, L2,L3,L4,L0,k,F m=massfour(m2,i2,m3,i3,m4,i4); J=gradfour(q,L2,L3,L4); f=forcefour(q,m2,m3,m4,L0,k,F); gam=zeros(8,1); A=[m –J’;J zeros(8)]; b=[f;gam]; X=A\b; ydot=[y(10:18);X(1:9)];
Matlab Code function f=forcefour(y,m2,m3,m4,L,L0,k,F) brac=k*(sqrt((y(4)-y(1))^2+(y(5)-y(4))^2)-L0)/ sqrt((y(4)-y(1))^2+(y(5)-y(4))^2)) g=9.81; f=[(y(1)-y(4))*brac;… -F-m2*g- +(y(2)-y(5))*brac;… -F*L/2*cos(y(3);… (y(4)-y(1))*brac;… -m3*g-(y(5)-y(2))*brac;… 0;… 0;… -m4*g;… 0];