- 機械原理Matlab輔助分析(第二版)
- 李濱城 徐超編著
- 1781字
- 2020-07-01 15:04:49
第二節 鉸鏈四桿機構的運動分析
在圖1-2所示的鉸鏈四桿機構中,已知各構件的尺寸及原動件1的方位角θ1和勻角速度ω1,需對其位置、速度和加速度進行分析。
一、數學模型的建立
為了對機構進行運動分析,先如圖1-2建立直角坐標系,并將各構件表示為桿矢,為了求解方便,將各桿矢用指數形式的復數表示。

圖1-2 鉸鏈四桿機構
1.位置分析
如圖1-2所示,由封閉圖形ABCDA可寫出機構各桿矢所構成的封閉矢量方程
(1-1)
其復數形式表示為
(1-2)
將式(1-2)的實部和虛部分離,得
(1-3)
由于式(1-3)是一個非線性方程組,直接求解比較困難,在這里借助幾何方法進行求解,在圖中連接BD,由此得
(1-4)
2.速度分析
將式(1-2)對時間t求一次導數, 得速度關系
(1-5)
將式(1-5)的實部和虛部分離,得
(1-6)
若用矩陣形式來表示,則式(1-6)可寫為
(1-7)
解式(1-7)即可求得兩個角速度ω2、ω3。
3.加速度分析
將式(1-2)對時間t求二次導數,可得加速度關系表達式
(1-8)
解式(1-6)即可求得兩個角加速度α2、α3。
二、計算實例
【例1-1】 如圖1-2所示,已知鉸鏈四桿機構各構件的尺寸為:l1=101.6mm,l2=254mm,l3=177.8mm,l4=304.8mm,原動件1以勻角速度ω1=250rad/s逆時針轉動,計算構件2和構件3的角位移、角速度及角加速度,并繪制出運動線圖。
三、程序設計
鉸鏈四桿機構MATLAB程序由主程序crank_rocker_main和子函數crank_rocker兩部分組成。
1.主程序crank_rocker_main文件
*************************************************
%1.輸入已知數據
clear;
l1=101.6; l2=254; l3=177.8; l4=304.8;
omega1=250;
alpha1=0;
hd=pi/180; du=180/pi;
%2.調用子函數 crank_rocker 計算鉸鏈四桿機構位移,角速度,角加速度
for n1=1:361
theta1=(n1-1)*hd;
[theta,omega,alpha]=crank_rocker(theta1,omega1,alpha1,l1,l2,l3,l4);
theta2(n1)=theta(1);theta3(n1)=theta(2);
omega2(n1)=omega(1);omega3(n1)=omega(2);
alpha2(n1)=alpha(1);alpha3(n1)=alpha(2);
end
%3.角位移、角速度、角加速度和四桿機構圖形輸出
figure(1);
n1=1∶361;
subplot(2,2,1); % 繪位移線圖
plot(n1,theta2*du,n1,theta3*du,'k');
title('角位移線圖');
xlabel('曲柄轉角 \theta_1/\circ')
ylabel('角位移/\circ')
grid on; hold on;
text(140,170,'\theta_3')
text(140,30,'\theta_2')
subplot(2,2,2); % 繪角速度線圖
plot(n1,omega2,n1,omega3,'k')
title('角速度線圖');
xlabel('曲柄轉角 \theta_1/\circ')
ylabel('角速度/rad\cdots∧{-1}')
grid on;hold on;
text(250,130,'\omega_2')
text(130,165,'\omega_3')
subplot(2,2,3); % 繪角加速度線圖
plot(n1,alpha2,n1,alpha3,'k')
title('角加速度線圖');
xlabel('曲柄轉角 \theta_1/\circ')
ylabel('角加速度/rad\cdots∧{-2}')
grid on;hold on;
text(230,2e4,'\alpha_2')
text(30,7e4,'\alpha_3')
subplot(2,2,4); % 鉸鏈四桿機構圖形輸出
x(1)=0;
y(1)=0;
x(2)=l1*cos(70*hd);
y(2)=l1*sin(70*hd);
x(3)=l4﹢l3*cos(theta3(71));
y(3)=l3*sin(theta3(71));
x(4)=l4;
y(4)=0;
x(5)=0;
y(5)=0;
plot(x,y);
grid on;hold on;
plot(x(1),y(1),'o');
plot(x(2),y(2),'o');
plot(x(3),y(3),'o');
plot(x(4),y(4),'o');
title('鉸鏈四桿機構');
xlabel('mm')
ylabel('mm')
axis([-50 350-20 200]);%
%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)=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)=0;
y(5)=0;
plot(x,y);
grid on;hold on;
plot(x(1),y(1),'o');
plot(x(2),y(2),'o');
plot(x(3),y(3),'o');
plot(x(4),y(4),'o');
axis([-150 350 -150 200]);
title('鉸鏈四桿機構'); xlabel('mm'); ylabel('mm')
m(j)=getframe;
end
movie(m);
2.子函數crank_rocker 文件
*************************************************
function [theta,omega,alpha]=crank_rocker(theta1,omega1,alpha1,l1,l2,l3,l4)
%1.計算從動件的角位移
L=sqrt(l4*l4﹢l1*l1-2*l1*l4*cos(theta1));
phi=asin((l1./L)*sin(theta1));
beta=acos((-l2*l2﹢l3*l3﹢L*L)/(2*l3*L));
if beta<0
beta=beta﹢pi;
end
theta3=pi-phi-beta; % theta3 表示桿3轉過角度
theta2=asin((l3*sin(theta3)-l1*sin(theta1))/l2); % theta2 表示桿2轉過角度
theta=[theta2;theta3]
%2.計算從動件的角速度
A=[-l2*sin(theta2), l3*sin(theta3); % 機構從動件的位置參數矩陣
l2*cos(theta2), -l3*cos(theta3)];
B=[l1*sin(theta1); -l1*cos(theta1)]; % 機構原動件的位置參數列陣
omega=A\(omega1*B); % 機構從動件的速度列陣
omega2=omega(1); omega3=omega(2);
%3.計算從動件的角加速度
A=[-l2*sin(theta2), l3*sin(theta3);
l2*cos(theta2), -l3*cos(theta3)];
At=[-omega2*l2*cos(theta2), omega3*l3*cos(theta3);
-omega2*l2*sin(theta2), omega3*l3*sin(theta3)];
B=[l1*sin(theta1); -l1*cos(theta1)]; % 機構原動件的位置參數列陣
Bt=[omega1*l1*cos(theta1); omega1*l1*sin(theta1)]; % Bt=dB/dt
alpha=A\(-At*omega﹢alpha1*B﹢omega1*Bt); % 機構從動件的加速度列陣
***********************************************
四、運算結果
圖1-3為鉸鏈四桿機構的運動線圖和機構運動仿真圖。

圖1-3 鉸鏈四桿機構運動線圖和機構運動仿真圖