平面六杆机构设计Word格式文档下载.docx
《平面六杆机构设计Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《平面六杆机构设计Word格式文档下载.docx(11页珍藏版)》请在冰豆网上搜索。
omega1=1;
theta7=60;
alpha1=0;
hd=pi/180;
du=180/pi;
m=-1;
forn1=1:
360
theta1=(n1-1)*hd;
aa=2*l1*l3*sin(theta1);
bb=2*l3*(l1*cos(theta1)-l4);
cc=l2*l2-l1*l1-l3*l3-l4*l4+2*l1*l4*cos(theta1);
theta3(n1)=2*atan((aa+m*sqrt(aa*aa+bb*bb-cc*cc))/(bb-cc));
s1=l3*sin(theta3)-l1*sin(theta1);
theta2(n1)=atan(s1/(l4+l3*cos(theta3)-l1*cos(theta1)));
xe=l1*cos(theta1)+l2*cos(theta2)+l9*cos(theta2-theta7);
ye=l1*sin(theta1)+l2*sin(theta2)+l9*sin(theta2-theta7);
s2=yg-ye;
theta8(n1)=atan(s2/(xg-xe));
s3=(xe-xg).*(xe-xg)+(ye-yg).*(ye-yg)+l5*l5-l6*l6;
theta9(n1)=acos(s3/(2*l5*sqrt((xe-xg).*(xe-xg)+(ye-yg).*(ye-yg))));
theta5(n1)=theta8(n1)-theta9(n1)+pi;
s4=ye+l5*sin(theta8-theta9)-yg;
theta6(n1)=atan(s4/(xe+l5*cos(theta8-theta9)-xg));
theta9(n1)=2*pi-(theta7-theta2(n1));
omega3(n1)=omega1*l1*sin(theta1-theta2)/l3/sin(theta3-theta2);
omega2(n1)=-omega1*l1*sin(theta1-theta3)/l2/sin(theta2-theta3);
omega5(n1)=omega2(n1)*(l2*sin(theta2(n1)-theta6(n1))+l9*sin(theta2(n1)-theta7-theta6(n1)))+omega1*l1*sin(theta1-theta6(n1))/l5/sin(theta5(n1)-theta6(n1));
omega6(n1)=-omega2(n1)*(l2*sin(theta2(n1)-theta5(n1))+l9*sin(theta2(n1)-theta7-theta5(n1)))+omega1*l1*sin(theta1-theta5(n1))/l6/sin(theta5(n1)-theta6(n1));
s4=l2*omega2(n1)*omega2(n1)+l1*omega1*omega1*cos(theta1-theta2)-l3*omega3(n1)*omega3(n1)*cos(theta3-theta2);
s5=l3*omega3(n1)*omega3(n1)-l1*omega1*omega1*cos(theta1-theta3)-l2*omega2(n1)*omega2(n1)*cos(theta2-theta3);
s6=omega1*omega1*l1*cos(theta1-theta6(n1))+omega2(n1)*omega2(n1)*(l2*cos(theta2(n1)-theta6(n1))+l9*cos(theta2(n1)-theta7-theta6(n1)))-l5*omega5(n1)*omega5(n1)*cos(theta5(n1)-theta6(n1))-l6*omega6(n1)*omega6(n1);
s7=omega1*omega1*l1*cos(theta1-theta5(n1))+omega2(n1)*omega2(n1)*(l2*cos(theta2(n1)-theta5(n1))+l9*cos(theta2(n1)-theta7-theta5(n1)))-l5*omega5(n1)*omega5(n1)-l6*omega6(n1)*omega6(n1)*cos(theta6(n1)-theta5(n1));
alpha3(n1)=s4/(l3*sin(theta3-theta2));
alpha2(n1)=s5/(l2*sin(theta2-theta3));
alpha5(n1)=(s6+alpha2(n1)*(l2*sin(theta2(n1)-theta6(n1))+l9*sin(theta2(n1)-theta7-theta6(n1))))/l5/sin(theta5(n1)-theta6(n1));
alpha6(n1)=-(s7+alpha2(n1)*(l2*sin(theta2(n1)-theta5(n1))+l9*sin(theta2(n1)-theta7-theta5(n1))))/l6/sin(theta5(n1)-theta6(n1));
vex=-l1*omega1.*sin(theta1)-l2*omega2.*sin(theta2)-l9*omega2.*sin(theta2-theta7);
vey=l1*omega1.*cos(theta1)+l2*omega2.*cos(theta2)+l9*omega2.*cos(theta2-theta7);
ve=sqrt(vex.*vex+vey.*vey);
aex=-l1*alpha1.*sin(theta1)-l1*omega1.*omega1.*cos(theta1)-l2*omega2.*omega2.*cos(theta2)-l2*alpha2.*sin(theta2)-l9*alpha2.*sin(theta2-theta7)-l9*omega2.*omega2.*cos(theta2-theta7);
aey=l1*alpha1.*cos(theta1)-l1*omega1.*omega1.*sin(theta1)+l2*alpha2.*cos(theta2)-l2*omega2.*omega2.*sin(theta2)+l9*alpha2.*cos(theta2-theta7)-l9*omega2.*omega2.*sin(theta2-theta7);
ae=sqrt(aex.*aex+aey.*aey);
end
figure
(1);
n1=1:
360;
subplot(2,3,1);
plot(n1,real(theta2*du),n1,real(theta3*du),n1,real(theta5*du),n1,real(theta6*du),'
k'
);
title('
角位移线图'
xlabel('
曲柄转角\phi_1/\circ'
)
ylabel('
角位移/\circ'
gridon;
holdon;
text(100,100,'
\phi_3'
text(100,40,'
\phi_2'
text(100,175,'
\phi_5'
text(100,0,'
\phi_6'
subplot(2,3,2);
plot(n1,real(omega2),n1,real(omega3),'
角速度23线图'
角速度/rad\cdots^{-1}'
text(100,0.1,'
\omega_2'
text(100,0.35,'
\omega_3'
subplot(2,3,3);
plot(n1,real(omega5),n1,real(omega6),'
角速度56线图'
曲柄转角\phi_1/\circ'
角速度/rad\cdots^{-1}'
text(200,14,'
\omega_5'
text(200,25,'
\omega_6'
subplot(2,3,4);
plot(n1,real(alpha2),n1,real(alpha3),'
角加速度23线图'
角加速度/rad\cdots^{-2}'
text(200,0,'
\alpha_2'
text(200,-0.2,'
\alpha_3'
subplot(2,3,5);
plot(n1,real(alpha5),n1,real(alpha6),'
角加速度56线图'
text(200,-200,'
\alpha_5'
text(200,-450,'
\alpha_6'
subplot(2,3,6);
plot(n1,real(ve),n1,real(ae),'
e点的速度和加速度线图'
)
速度/m*s^{-1}'
text(80,25,'
ve'
text(65,45,'
ae'
figure
(2)
m=moviein(20);
j=0;
5:
j=j+1;
clf;
x
(1)=0;
y
(1)=0;
x
(2)=l1*cos((n1-1)*hd);
y
(2)=l1*sin((n1-1)*hd);
x(3)=l4+l3*cos(theta3(n1));
y(3)=l3*sin(theta3(n1));
x(4)=l4;
y(4)=0;
x(5)=l4+l3*cos(theta3(n1));
y(5)=l3*sin(theta3(n1));
x(6)=l4+l3*cos(theta3(n1))+l2-cos(theta2(n1)-theta7);
y(6)=l3*sin(theta3(n1))+l2*sin(theta2(n1)-theta7);
x(7)=xg+l6*cos(theta6(n1));
y(7)=yg+l6*sin(theta6(n1));
x(8)=xg;
y(8)=yg;
plot(real(x),real(y));
gridon;
holdon;
plot(x
(1),y
(1),'
o'
plot(x
(2),y
(2),'
plot(x(3),y(3),'
plot(x(4),y(4),'
plot(x(5),y(5),'
plot(real(x(6)),re