2007年5月18日 星期五

作業九

A:本人5月3日有來上課,謝謝老師。

B:本人於5月10日下午兩點鐘有參加meeting

C:

請將偏置機構作另類分析,分析過程可採你所知的方式(包括講義中所列的方法)。運動中分以曲桿驅動及滑塊驅動的方式,並說明運動的界限或範圍。設此機構之曲桿長Rcm , 連桿Lcm,滑塊之偏置量為10cm等數據作分析。其中,R=10+(學號末二碼),L=R+5 。

ANS

所謂滑塊偏置機構,即是滑塊滑動方向和水平方向距離e(偏置量)。




我們若要分析此機構,我們首先必須求出偏移量對角度限制的影響。上圖中,我們若要讓此偏置機構動作,必須藉由其中的關係式,求出B點與C點的標。而在課本第四章中,我們參考其function[s,theta21,theta22]=slider_limit(R,L,e)的程式,可求出B點座標。但是我們可以將其函數稍微整理一下,用sind(),cosd()代替多出來角度的轉換,可使程式更為簡易。以下是我的function:

function [s,th1,th2]=slider_limit(R,L,e)
th1=asind(e./(R+L));
th2=180+asind((L-e)/R);
s=(R+L).*cosd(th1)-abs(R-L).*cosd(th2);

(其中s是滑塊的衝量(移動量),th1,th2是AB曲桿和水平夾角度的極限值)

在這裡我們必須注意的是th2的運算,課本所給的是R大於L的時候,所以輸出的値不會出現複數,但是老師給的値是L>R,故我們必須修改一下th2=180+asind((L-e)/R)。

爲了求出滑塊(C點)的座標,我們可以課本上的

function [d,theta3]=slider_solve(theta2,R,L,e,mode)
其程式如下:

function [d,theta3]=slider_solve(theta2,R,L,e,mode)
if nargin<5, mode="0;end" theta="theta2*d2g;" cc="(e-R.*sind(theta))./L;">=0,
theta3=asind(cc);
else
theta3=asind(-cc)+pi;
end
d=L.*cosd(theta3)+R.*cosd(theta);


*驅桿驅動

建立一個function slider_analysis(R,L,e)的函數,其程式碼如下:

function slider_analysis(R,L,e)
[s,th1,th2]=slider_limit(R,L,e)
%先呼叫slider_limit,以求出角度極限值
th=linspace(th1,th2,200 )
%設定角度間隔,角度範圍分成200等份
[d,th3]=slider_solve(th,R,L,e,1)
%呼叫slider_solve 以求出d

x=R*cosd(th),
y=R*sind(th)
%利用th求出B點座標(x,y)

for n=1:200
%建立一個for迴圈
axis ([-40 50 -30 40]);
axis equal;
%設定座標範圍
line([0,x(n),d(n)],[0,y(n),e]);
%將A B C三點聯成直線
line([d(n)-3,d(n)+3,d(n)+3,d(n)-3,d(n)-3],[e-2,e-2,e+2,e+2,e-2]);
%畫出滑塊
ground(0,0,2,0)
anchor(-2,0,0,0)
%畫底座
pause(0.05);
%每個0.5秒停格一次
clf;
%清除動畫前一次畫面

end


*滑塊驅動

若是滑塊驅動,則會比區柄驅動多一部份程式。
我建立了slider_analysis2,其程式碼如下:
function slider_analysis2(R,L,e)

[s,th1,th2]=slider_limit(R,L,e)
th=linspace( th1, th2,200 )
[d,th3]=slider_solve(th,R,L,e,1)
x=R*cosd(th),
y=R*sind(th)

for n=1:200
line([0,x(n),d(n)],[0,y(n),e]);
line([d(n)-3,d(n)+3,d(n)+3,d(n)-3,d(n)-3],[e-2,e-2,e+2,e+2,e-2]);
ground(0,0,2,0)
anchor(-2,0,0,0)
pause(0.01);
clf;
axis ([-100 100 -100 100]);
end
%多加的部份
th=linspace( th2,180-th1,200 )
[d,theta3]=slider_solve(th,R,L,e,-1)
%若mode輸入為-1,則輸出角度會和mode值為1時互補,這是滑塊驅動必須考慮的部份。
%這次角度的範圍要從th2到180-th1

x=R*cosd(th),
y=R*sind(th)

for n=1:200


line([0,x(n),d(n)],[0,y(n),e]);
line([d(n)-4,d(n)+4,d(n)+4,d(n)-4,d(n)-4],[e-3,e-3,e+3,e+3,e-3]);
ground(0,0,2,0)
anchor(-2,0,0,0)
pause(0.01);
clf;
axis ([-100 100 -100 100]);
end


在螢幕上輸入
slider_analysis(20,25,10)

slider_analysis2(20,25,10)

即可得到曲桿驅動以及滑塊驅動的圖形

曲桿驅動


滑塊驅動