- 機械原理Matlab輔助分析(第二版)
- 李濱城 徐超編著
- 3598字
- 2020-07-01 15:04:50
第五節 六桿機構的運動分析
由于六桿機構的類型很多,任何一個四桿機構,若加上一個二級桿組就成為一個六桿機構,我們就使用較廣泛的一類六桿機構——由曲柄、擺動導桿、連桿和滑塊組成的來進行運動分析和程序設計,圖1-8所示的牛頭刨床主運動機構就是這樣一類六桿機構。
圖1-8所示為牛頭刨床主運動機構的運動簡圖。設已知各構件的尺寸及原動件1的方位角θ1和勻角速度ω1,需對導桿的角位移、角速度和角加速度以及刨頭的位置、速度和加速度進行分析。
一、數學模型的建立
為了對機構進行運動分析,先如圖1-8建立直角坐標系,將各構件表示為桿矢,并將各桿矢用指數形式的復數表示。

圖1-8 牛頭刨床主運動機構
1.位置分析
如圖1-8所示,由于這里有四個未知量,為了求解需要建立兩個封閉矢量方程。由封閉圖形ABCA可寫出機構一個封閉矢量方程
(1-25)
其復數形式表示為
(1-26)
將式(1-26)的實部和虛部分離,得
(1-27)
由式(1-27)得
(1-28)
由封閉圖形CDEGC可寫出機構另一個封閉矢量方程
(1-29)
其復數形式表示為
(1-30)
將式(1-30)的實部和虛部分離,得
(1-31)
由式(1-31)得
(1-32)
2.速度分析
將式(1-26)和式(1-30)對時間t求一次導數,得速度關系
(1-33)
將式(1-33)的實部和虛部分離,得
(1-34)
若用矩陣形式來表示,則式(1-34)可寫為
(1-35)
3.加速度分析
將式(1-26) 和式(1-30)對時間t求二次導數,可得加速度關系表達式
(1-36)
二、計算實例
【例1-4】 如圖1-8所示,已知牛頭刨床主運動機構各構件的尺寸為: l1=125mm,l3=600mm,l4=150mm,l6=275mm,l'6=575mm,原動件1以勻角速度ω1=1rad/s逆時針轉動,計算該機構中各從動件的角位移、角速度和角加速度以及刨頭5上E點的位置、速度和加速度,并繪制出運動線圖。
三、程序設計
牛頭刨床主運動機構MATLAB程序由主程序six_bar_main和子函數six_bar兩部分組成。
1.主程序six_bar_main文件
*************************************************
%1.輸入已知數據
clear;
l1=0.125;
l3=0.600;
l4=0.150;
l6=0.275;
l61=0.575;
omega1=1;
alpha1=0;
hd=pi/180;
du=180/pi;
%2.調用子函數 six_bar 計算牛頭刨床機構位移,角速度,角加速度
for n1=1:459;
theta1(n1)=-2*pi﹢5.8119﹢(n1-1)*hd;
ll=[l1,l3,l4,l6,l61];
[theta,omega,alpha]=six_bar(theta1(n1),omega1,alpha1,ll);
s3(n1)=theta(1); %s3表示滑塊2相對于CD桿的位移
theta3(n1)=theta(2); %theta3表示桿3轉過角度
theta4(n1)=theta(3); %theta4表示桿4轉過角度
sE(n1)=theta(4); %sE表示桿5的位移
v2(n1)=omega(1); %滑塊2的速度
omega3(n1)=omega(2); %構件3的角速度
omega4(n1)=omega(3); %構件4的角速度
vE(n1)=omega(4); %構件5的速度
a2(n1)=alpha(1); %a2表示滑塊2的加速度
alpha3(n1)=alpha(2); %alpha3表示桿3的角加速度
alpha4(n1)=alpha(3); %alpha4表示桿4的角加速度
aE(n1)=alpha(4); %構件5的加速度
end
%3.位移,角速度,角加速度和牛頭刨床圖形輸出
figure(3);
n1=1:459;
t=(n1-1)*2*pi/360;
subplot(2,2,1); %繪角位移及位移線圖
plot(t,theta3*du,'r-.');
grid on;
hold on;
axis auto;
[haxes,hline1,hline2]=plotyy(t,theta4*du,t,sE);
grid on;
hold on;
xlabel('時間/s')
axes(haxes(1));
ylabel('角位移/\circ ')
axes(haxes(2));
ylabel('位移/m')
hold on;
grid on;
text(1.15,-0.65,'\theta_3')
text(3.4,0.27,'\theta_4')
text(2.25,-0.15,'s_E')
subplot(2,2,2); %繪角速度及速度線圖
plot(t,omega3,'r-.');
grid on;
hold on;
axis auto;
[haxes,hline1,hline2]=plotyy(t,omega4,t,vE);
grid on;
hold on;
xlabel('時間/s')
axes(haxes(1));
ylabel('角速度/rad\cdots∧{-1}')
axes(haxes(2));
ylabel('速度/m\cdots∧{-1}')
hold on;
grid on;
text(3.1,0.35,'\omega_3')
text(2.1,0.1,'\omega_4')
text(5.5,0.45,'v_E')
subplot(2,2,3); %繪角加速度和加速度圖
plot(t,alpha3,'r-.');
grid on;
hold on;
axis auto;
[haxes,hline1,hline2]=plotyy(t,alpha4,t,aE);
grid on;
hold on;
xlabel('時間/s')
axes(haxes(1));
ylabel('角加速度/rad\cdots∧{-2}')
axes(haxes(2));
ylabel('加速度 /m\cdots∧{-2}')
hold on;
grid on;
text(1.5,0.3,'\alpha_3')
text(3.5,0.51,'\alpha_4')
text(1.5,-0.11,'a_E')
subplot(2,2,4); %牛頭刨床機構
n1=20;
x(1)=0;
y(1)=0;
x(2)=(s3(n1)*1000-50)*cos(theta3(n1));
y(2)=(s3(n1)*1000-50)*sin(theta3(n1));
x(3)=0;
y(3)=l6*1000;
x(4)=l1*1000*cos(theta1(n1));
y(4)=s3(n1)*1000*sin(theta3(n1));
x(5)=(s3(n1)*1000﹢50)*cos(theta3(n1));
y(5)=(s3(n1)*1000﹢50)*sin(theta3(n1));
x(6)=l3*1000*cos(theta3(n1));
y(6)=l3*1000*sin(theta3(n1));
x(7)=l3*1000*cos(theta3(n1))﹢l4*1000*cos(theta4(n1));
y(7)=l3*1000*sin(theta3(n1))﹢l4*1000*sin(theta4(n1));
x(8)=l3*1000*cos(theta3(n1))﹢l4*1000*cos(theta4(n1))-900;
y(8)=l61*1000;
x(9)=l3*1000*cos(theta3(n1))﹢l4*1000*cos(theta4(n1))﹢600;
y(9)=l61*1000;
x(10)=(s3(n1)*1000-50)*cos(theta3(n1));
y(10)=(s3(n1)*1000-50)*sin(theta3(n1));
x(11)=x(10)﹢25*cos(pi/2-theta3(n1));
y(11)=y(10)-25*sin(pi/2-theta3(n1));
x(12)=x(11)﹢100*cos(theta3(n1));
y(12)=y(11)﹢100*sin(theta3(n1));
x(13)=x(12)-50*cos(pi/2-theta3(n1));
y(13)=y(12)﹢50*sin(pi/2-theta3(n1));
x(14)=x(10)-25*cos(pi/2-theta3(n1));
y(14)=y(10)﹢25*sin(pi/2-theta3(n1));
x(15)=x(10);
y(15)=y(10);
x(16)=0;
y(16)=0;
x(17)=0;
y(17)=l6*1000;
k=1:2;
plot(x(k),y(k));
hold on;
k=3:4;
plot(x(k),y(k));
hold on;
k=5:9;
plot(x(k),y(k));
hold on;
k=10:15;
plot(x(k),y(k));
hold on;
k=16:17;
plot(x(k),y(k));
hold on;
grid on;
axis ([-500 600 0 650]);
title('牛頭刨床運動仿真');
grid on;
xlabel('mm')
ylabel('mm')
plot(x(1),y(1),'o');
plot(x(3),y(3),'o');
plot(x(4),y(4),'o');
plot(x(6),y(6),'o');
plot(x(7),y(7),'o');
hold on;
grid on;
xlabel('mm')
ylabel('mm')
axis ([-400 600 0 650]);
%4.牛頭刨床機構運動仿真
figure(2)
m=moviein(20);
j=0;
for n1=1:5:360
j=j﹢1;
clf;
x(1)=0;
y(1)=0;
x(2)=(s3(n1)*1000-50)*cos(theta3(n1));
y(2)=(s3(n1)*1000-50)*sin(theta3(n1));
x(3)=0;
y(3)=l6*1000;
x(4)=l1*1000*cos(theta1(n1));
y(4)=s3(n1)*1000*sin(theta3(n1));
x(5)=(s3(n1)*1000﹢50)*cos(theta3(n1));
y(5)=(s3(n1)*1000﹢50)*sin(theta3(n1));
x(6)=l3*1000*cos(theta3(n1));
y(6)=l3*1000*sin(theta3(n1));
x(7)=l3*1000*cos(theta3(n1))﹢l4*1000*cos(theta4(n1));
y(7)=l3*1000*sin(theta3(n1))﹢l4*1000*sin(theta4(n1));
x(8)=l3*1000*cos(theta3(n1))﹢l4*1000*cos(theta4(n1))-900;
y(8)=l61*1000;
x(9)=l3*1000*cos(theta3(n1))﹢l4*1000*cos(theta4(n1))﹢600;
y(9)=l61*1000;
x(10)=(s3(n1)*1000-50)*cos(theta3(n1));
y(10)=(s3(n1)*1000-50)*sin(theta3(n1));
x(11)=x(10)﹢25*cos(pi/2-theta3(n1));
y(11)=y(10)-25*sin(pi/2-theta3(n1));
x(12)=x(11)﹢100*cos(theta3(n1));
y(12)=y(11)﹢100*sin(theta3(n1));
x(13)=x(12)-50*cos(pi/2-theta3(n1));
y(13)=y(12)﹢50*sin(pi/2-theta3(n1));
x(14)=x(10)-25*cos(pi/2-theta3(n1));
y(14)=y(10)﹢25*sin(pi/2-theta3(n1));
x(15)=x(10);
y(15)=y(10);x(16)=0;
y(16)=0;
x(17)=0;
y(17)=l6*1000;
k=1:2;
plot(x(k),y(k));
hold on;
k=3:4;
plot(x(k),y(k));
hold on;
k=5:9;
plot(x(k),y(k));
hold on;
k=10:15;
plot(x(k),y(k));
hold on;
k=16:17;
plot(x(k),y(k));
hold on;
grid on;
axis ([-500 600 0 650]);
title('牛頭刨床運動仿真');
grid on;
xlabel('mm')
ylabel('mm')
plot(x(1),y(1),'o');
plot(x(3),y(3),'o');
plot(x(4),y(4),'o');
plot(x(6),y(6),'o');
plot(x(7),y(7),'o');
axis equal;
m(j)=getframe;
end
movie(m)
2.子函數six_bar 文件
********************************************************
function [theta,omega,alpha]=six_bar(theta1,omega1,alpha1,ll)
l1=ll(1);
l3=ll(2);
l4=ll(3);
l6=ll(4);
l61=ll(5);
%1.計算角位移和線位移
s3 =sqrt((l1*cos(theta1))*(l1*cos(theta1))﹢(l6﹢l1*sin(theta1))*(l6﹢l1*sin(theta1))); %s3表示滑塊2相對于CD桿的位移
theta3 =acos((l1*cos(theta1 ))/s3 ); %theta3表示桿3轉過角度
theta4 =pi-asin((l61-l3*sin(theta3 ))/l4); %theta4表示桿4轉過角度
sE =l3*cos(theta3 )﹢l4*cos(theta4 ); %sE表示桿5的位移
theta(1)=s3;
theta(2)=theta3;
theta(3)=theta4;
theta(4)=sE;
%2.計算角速度和線速度
A=[sin(theta3 ),s3 *cos(theta3 ),0,0; %從動件位置參數矩陣
-cos(theta3 ),s3 *sin(theta3 ),0,0;
0,l3*sin(theta3 ),l4*sin(theta4 ),1;
0,l3*cos(theta3 ),l4*cos(theta4 ),0];
B=[l1*cos(theta1 );l1*sin(theta1 );0;0]; %原動件位置參數矩陣
omega=A\(omega1*B);
v2 =omega(1); %滑塊2的速度
omega3 =omega(2); %構件3的角速度
omega4 =omega(3); %構件4的角速度
vE =omega(4); %構件5的速度
%3.計算角加速度和加速度
A=[sin(theta3 ),s3 *cos(theta3 ),0,0; %從動件位置參數矩陣
cos(theta3 ),-s3 *sin(theta3 ),0,0;
0,l3*sin(theta3 ),l4*sin(theta4 ),1;
0,l3*cos(theta3 ),l4*cos(theta4 ),0];
At=[omega3 *cos(theta3 ),(v2 *cos(theta3 )-s3 *omega3 *sin(theta3 )),0,0;
-omega3 *sin(theta3 ),(-v2 *sin(theta3 )-s3 *omega3 *cos(theta3 )),0,0;
0,l3*omega3 *cos(theta3 ),l4*omega4 *cos(theta4 ),0;
0,-l3*omega3 *sin(theta3 ),-l4*omega4 *sin(theta4 ),0];
Bt=[-l1*omega1*sin(theta1 );-l1*omega1*cos(theta1 );0;0];
alpha=A\(-At*omega﹢omega1*Bt); %機構從動件的加速度列陣
a2 =alpha(1); %a2表示滑塊2的加速度
alpha3 =alpha(2); %alpha3表示桿3的角加速度
alpha4 =alpha(3); %alpha4表示桿4的角加速度
aE =alpha(4); %構件5的加速度
四、運算結果
圖1-9為牛頭刨床主運動機構的運動線圖和機構運動仿真圖。


圖1-9 牛頭刨床主運動機構運動線圖和機構運動仿真圖