1/26/07

4.6 四連桿之解(1)

四連桿位置解


有關四連桿位置使用幾何代數解法請參照馮丁樹著之參考書四章三節。此例所考慮之四連桿是較簡單的型式,其前提是將第一桿置於水平位置,因此其角度為零,在公式計算上可以簡化。由於各桿之尺寸為已知,第二桿作為曲桿,其水平角度為已知,因此只要求得第四點的位置及第三與第四桿之水平角度即可。



程式內容


以MATLAB應用程式解四連桿之相關位置實際上有多種用法,可參考機動學之位置分析。本程式函數four_link1之呼叫法如下:

function [theta3,theta4,Cx,Cy]=four_link1(theta2,r,mode)

其中輸入參數:

  theta2: 桿2之輸入角度,可為矩陣資料,其單位為度數。
  r: 列矩陣,各桿之長度,如:[r1 r2 r3 r4]。
  mode:+1或-1,選擇連桿組上下之方位。

輸出參數:

theta3,theta4:桿3及桿4之輸出角度。
Cx,Cy:第四桿C結之座標,若為虛數值表示該位置不存在,其輸出角度不能採用,是否為虛數,則可使用isreal函數進行測試。



程式4.5
function [theta3,theta4,Cx,Cy]=four_link1(theta2,r,mode)
% P4.4 function [theta]=four_link1(theta2,r)
% Find the angles of link 3 and link, given theta2 and [r]
% Example:
% [theta3,theta4, Cx, Cy]=four_link1(80,[4 2 4.2 2.6],1)
% Designed by D.S. Fon, BIME, NTU, Date:February 8,2003.
%
rr=r.*r;
d2g=pi/180;
theta=theta2*d2g;
Bx=r(2)*cos(theta);By=r(2)*sin(theta);
m=(rr(4)-rr(3)-rr(1)+rr(2))./(Bx-r(1))/2;
mm=(m-r(1)).^2;
p=By./(Bx-r(1));pp=p.*p;
rootin=mm.*pp-(pp+1).*(mm-rr(4));
arg=sqrt(rootin);
Cy=((m-r(1)).*p+mode*arg)./(pp+1);
Cx=m-p.*Cy;
theta3=atan2(Cy-By,Cx-Bx)/d2g;
theta4=atan2(Cy,Cx-r(1))/d2g;


範例4.6


如圖4.1之連桿長度分別為70、50、110、65mm,桿2之角度為80度,求其對應之θ3與θ4

[解]:

設theta2=80,r=[70 50 110 65],mode=+1,代入four_link1執行。

>> [theta3,theta4,Cx,Cy]=four_link1(80,[70 50 110 65],1)

theta3 = -3.1199
theta4 = 41.7160
Cx = 118.5194
Cy = 43.2536


範例4.7


有一組四連桿,其尺寸分別為[4 2 4.2 2.6]cm,桿1接地,並與地平行。試(A)以45度為區隔,令桿2迴轉一周,求其對應之θ3與θ4及C結座標。(B)另以MATLAB撰寫一程式,繪出以桿2迴轉間隔為10度之所有四連桿之軌跡。

[解]:

設theta2=[0:60:360] ,總計應有6個角度。r=[4 2 4.2 2.6]cm ,mode=+1,代入four_link1執行。其結果如下:

>> [theta3,theta4,Cx,Cy]=four_link1([0:60:360],[4 2 4.2 2.6],1)
theta3 =
27.6604 8.1593 9.8818 21.5404 48.0950 68.1593 27.6604
theta4 =
48.5827 63.5647 109.3695 143.6226 147.5827 123.5647 48.5827
Cx =
5.7200 5.1575 3.1377 1.9067 1.8052 2.5625 5.7200
Cy =
1.9498 2.3281 2.4528 1.5421 1.3938 2.1665 1.9498


由上面所得的結果可知,桿2可以完全迴轉。而最前與最後一項之結果相同,因為0度與360度是同樣的角度。

No comments:

Post a Comment