0第0页
大作业(一)
平面连杆机构的运动分析
班 级:
姓 名: 姓 名:
姓 名:
指 导 教 师:
完 成 日 期: v1.0
可编辑可修改
1第1页
一、题目及原始数据
、平面连杆机构的运动分析题目:
如图所示,为一平面六杆机构。设已知各构件的尺寸如表 所示,又知原动件1以等角速度1= 1rad/s 沿逆时针方向回转,试求各从动件的角位移、角速度及角加速度以及位移E点的位移、速度及加速度的变化情况。
表 平面六杆机构的尺寸参数
2'l=65mm,Gx=,Gy=
题 号 1l 2l 3l 4l 5l 6l A B C
1-A 25 60° 1l= 1l=24 1l=
要求每组(每三人为一组,每人一题)至少打印一份源程序,每个同学计
算出原动件从 0º到 360º时(计算点数 N=36)所要求各运动变量的大小,并绘出各组应的运动线图以及 E 点的轨迹曲线。
图
2第2页
二、平面连杆机构运动分析方程
、位移方程:
4312l4coscosl1cos0h
43311l4sinssinl1sin0h
43l4cosl3cossc0
43l4sinl3 sinh0
343cvv
、速度方程:
3433343314343cosl4sinssin0sinl4cosscos0V0l4sinl3sin10l4cosl3cos0
211Vl1sinl1cos00
3343Vcvv
3VV1\V2
、加速度方程:
3344333333443333311144334433sin14cosvsinscos014sin?vcosssin0014cos13cos0014sin13sin0A
112343cA=v v
11111112AA A
1211Al1cosl1sin00
11112AAA v1.0 可编辑可修改
3第3页
3343Aaca
321AA\A
三、计算程序框图
迭代次数IT=0IT=IT+1调用位置方程(1)子程序代入的初值θi,并计算fi|fi|≤E求得θi值YIT>ITmaxN停止Y调系数矩阵AV调用高斯消去法子程序求解A△θi=fi求出△θiθi=θi+△θi
4第4页
四、计算源程序
主程序
%输入已知数据
clear
l1=;
l2=;
l3=;
l4=;
l5=;
l6=;
l22=;
xg=;
yg=;
omega1=1;
alph1=0;
hd=pi/180;
du=180/pi;
t1=1:10:361;
theta2=1:10:361;
theta3=1:10:361;
theta5=1:10:361;
theta6=1:10:361;
omega2=1:10:361;
omega3=1:10:361;
omega5=1:10:361;
5第5页
omega6=1:10:361;
alph2=1:10:361;
alph3=1:10:361;
alph5=1:10:361;
alph6=1:10:361;
xe=1:10:361;
ye=1:10:361;
V=1:10:361;
a=1:10:361;
theta1=0;
options=gaoptimset('PopulationSize',100,'Generations',10000,'StallGenLimit',500,'TolFun',1e-100);
theta0=ga(@(thet) weiyi_0(thet,theta1),4,options);
if theta0(1)<0
theta0(1)=theta0(1)+2*pi;end
if theta0(1)>2*pi
theta0(1)=theta0(1)-2*pi;end
if theta0(2)<0
theta0(2)=theta0(2)+2*pi;end
if theta0(2)>2*pi
theta0(2)=theta0(2)-2*pi;end
if theta0(3)<0
theta0(3)=theta0(3)+2*pi;end
if theta0(3)>2*pi
theta0(3)=theta0(3)-2*pi;end
if theta0(4)<0
theta0(4)=theta0(4)+2*pi;end
6第6页
if theta0(4)>2*pi
theta0(4)=theta0(4)-2*pi;
end
%调用子函数Fun_jixie计算该六杆机构的各杆角位移、角速度、角加速度以及E点的角位移、角速度、角加速度
for n1=1:10:361
theta1=(n1-1)*hd;
t1(n1)=theta1*du;
theta=fsolve(@(thet) weiyi(thet,theta1),theta0);
if theta(1)<0
theta(1)=theta(1)+2*pi;end
if theta(1)>2*pi
theta(1)=theta(1)-2*pi;end
if theta(2)<0
theta(2)=theta(2)+2*pi;end
if theta(2)>2*pi
theta(2)=theta(2)-2*pi;end
if theta(3)<0
theta(3)=theta(3)+2*pi;end
if theta(3)>2*pi
theta(3)=theta(3)-2*pi;end
if theta(4)<0
theta(4)=theta(4)+2*pi;end
if theta(4)>2*pi
theta(4)=theta(4)-2*pi;end
[xe(n1),ye(n1)]=weiyi_E(theta1,theta,l1,l2,l22);
7第7页
[omega,alph] = Fun_jixie(theta1,omega1,l1,l2,l3,l5,l6,l22,theta);
[V(n1),a(n1)]=sudu_jasudu_E(omega(1),alph(1),theta,theta1,omega1,l1,l2,l22,alph1);
theta2(n1)=theta(1);theta3(n1)=theta(2);theta5(n1)=theta(3);theta6(n1)=theta(4);omega2(n1)=omega(1);omega3(n1)=omega(2);omega5(n1)=omega(3);omega6(n1)=omega(4);
alph2(n1)=alph(1);alph3(n1)=alph(2);alph5(n1)=alph(3);alph6(n1)=alph(4);
theta0=theta;
end
%绘制各杆件的角位移、角速度、角加速度
n2=1:10:361;
n1=1:10:361;
figure(1);%%%%%%
subplot(2,2,1)%绘制位移线图
plot((n1-1),theta2(n2)*du,'r-',(n1-1),theta3(n2)*du,'g-',(n1-1),theta5(n2)*du,'y-',(n1-1),theta6(n2)*du,'k-','LineWidth',;
title('各杆角位移线图');
xlabel('原动件1\theta_1/\circ');
ylabel('角位移/\circ');
grid on;hold on;
text(200,60,'θ2');
text(200,150,'θ3');
text(200,350,'θ5');
text(200,260,'θ6');
%%%%%%
subplot(2,2,2)%绘制角速度线图
plot((n1-1),omega2(n2),'r-',(n1-1),omega3(n2),'g-',(n1-1),omega5(n2),'y-',(n1-1),omega6(n2),'k-','LineWidth',;
title('各杆角速度线图');
8第8页
xlabel('原动件1\theta_1/\circ');
ylabel('角速度/rad\cdots^{-1}');
grid on;hold on;
%%%%%%
subplot(2,2,3)%绘制角加速度线图
plot((n1-1),alph2(n2),'r-',(n1-1),alph3(n2),'g-',(n1-1),alph5(n2),'y-',(n1-1),alph6(n2),'k-','LineWidth',;
title('各杆角加速度线图');
xlabel('原动件1\theta_1/\circ');
ylabel('角加速度/rad\cdots^{-2}');
grid on;hold on;
%%%%%%%
%求E点的位移
figure(2)
subplot(2,2,1)
plot(xe(n1),ye(n1),'r-','LineWidth',;
title('E的位移线图');
xlabel('E在x方向位移');
ylabel('E在y方向位移');
grid on;hold on;
%求E点角速度与角加速度
subplot(2,2,2)%绘制E点角速度
plot((n1-1),V(n1),'r-','LineWidth',;
title('E点角速度');
xlabel('原动件1\theta_1/\circ');
ylabel('E点角速度/rad\cdots^{-1}');
grid on;hold on;