2/2/07

5.2 死點角度之計算



以MATLAB程式計算第四桿為搖桿時之對應死點角度可用公式4.7-4.8求得其值ψ1與ψ2。其呼叫程式dead_point()如下:

function [phi41,phi42]=dead_point(r)

參數之定義同程式4.2。

程式內容



程式4.3
function [phi41,phi42]=dead_point(r)
% P4.3 [phi1,phi2]=dead_point(r)
%
% Find the max. and min. angles for r4 in a crank rocker mechanism.
% Examples:
% [phi41,phi42]=dead_point([4 2 4.2 2.6])
%
% Author: D.S.Fon, BIME, NTU, Date: Feb. 4,2007.
rr=r.*r;
d2g=pi/180;
ph1=acos(((r(2)-r(3))^2-rr(1)-rr(4))/(2*r(1)*r(4)));
ph2=acos(((r(2)+r(3))^2-rr(1)-rr(4))/(2*r(1)*r(4)));
phi41=ph1/d2g;
phi42=ph2/d2g;


範例4.4


四連桿組之桿長分別為4.0 cm,2.0 cm,4.2 cm,2.9 cm,試求死點狀態之桿4對應角度。

[解]:執行結果:

>> [phi41,phi42]=dead_point([4 2 4.2 2.6])

phi41 = 149.4898
phi42 = 41.0753

由於值ψ1與ψ2屬於搖桿之角度,若為虛數,表示沒有實際限制角;若為0度,表示該點為暫態點,其限制由另一角決定,但有對稱的關係。

程式.4.4則是針對公式4.9-4.10以計算桿2為搖桿時之對應輸入死點角,θ2max與,θ2min其呼叫函數dead_point2()如下:

function [theta21,theta22]=dead_point2(r)


程式4.4
function [theta21,theta22]=dead_point2(r)
% [th1,th2]=dead_point2(r)
%
% Find the max. and min. angles for r2 in a double rocker mechanism.
% Examples:
% [theta21,theta22]=dead_point2([4.2 2.6 2 4])
%
% Designed by D.S. Fon, BIME, NTU, Date:October 14,2002.
rr=r.*r;
d2g=pi/180;
th1=acos((rr(1)+rr(2)-(r(3)+r(4))^2)/(2*r(1)*r(2)));
th2=acos((rr(1)+rr(2)-(r(3)-r(4))^2)/(2*r(1)*r(2)));
theta21=th1/d2g;
theta22=th2/d2g;


範例4.5


若一組四連桿桿長分別為4.2 cm,2.6 cm,2 cm,4 cm,試求桿2之對應死點狀態之角度。

[解]:

>> [theta21,theta22]=dead_point2([4.2 2.6 2 4])

theta21 = 122.0822
theta22 = 20.9222


同理,由於θ值為曲桿之限制角度,若結果為虛根,表示曲桿在該點並無該死點狀態,亦無對應角度,應可自由轉動一圈;若存在另一角為實根角,表示仍然受到另一角之限制。若根為0度或180度,則表示一、二桿之和等於三、四桿之和。若分別為0與180度,表示曲桿可以完整轉動一圈。讀者可用grashop()函數進行印證。


程式之整合


上述兩程式雖分為兩部份,實際上應用時應該可以合併。第一項為桿四之限制角,第二項為曲柄桿之限制角。其程式內容如下:


function [theta]=deadangle(r,mode)
% Program 4.3 for the eqs 4.7 & 4.8.
% Finding the max. and min. angles of link 4.
% Input: r: linkage matrix.
% Output:theta:angles of link 2 & link 4.
% Examples:
% theta=deadangle([4 2 4.2 2.6])
% Author: D.S. Fon, BIME, NTU, Feb. 4, 2007.
rr=r.*r;d2g=pi/180;if nargin<2,mode=1;end
ph1=acos(((r(2)-r(3))^2-rr(1)-rr(4))/(2*r(1)*r(4)));
ph2=acos(((r(2)+r(3))^2-rr(1)-rr(4))/(2*r(1)*r(4)));
th1=acos((rr(1)+rr(2)-(r(3)+r(4))^2)/(2*r(1)*r(2)));
th2=acos((rr(1)+rr(2)-(r(3)-r(4))^2)/(2*r(1)*r(2)));
if ~isreal(th1),th1=0;end
if ~isreal(th2),th2=2*pi;end
if th1>th2,temp=th1;th1=th2;th2=temp;end
if th1==pi&th2==2*pi,th1=0;end
if th1==0&th2==pi,th2=2*pi;end
if th1==0&th2==0,th2=2*pi;end
if ~isreal(ph1),ph1=0;end
if ~isreal(ph2),ph2=2*pi;end
if ph1>ph2,temp=ph1;ph1=ph2;ph2=temp;end
if ph1==0&ph2==0,ph2=2*pi;end
theta=[th1,th2;ph1,ph2]/d2g;


此程式執行後,theta代表四個角度,前二者為曲柄桿之限制角,後二者為搖桿臂之限制角。
執行結果如下:

>> theta=deadangle([4 2 4.2 2.6])
theta =
0 360
41.075 149.49
>> theta=deadangle([1 2 3 4])
theta =
0 360
0 360
>> theta=deadangle([5 1 4 2])
theta =
0 360
101.54 180
>> theta=deadangle([4 7 3 8])
theta =
44.415 180
71.79 180