2007年6月8日 星期五

機動學 作業十二

作業十二 b94611042 王志豪 (Due date: 12pm June 6,2007)
我5/31日曾全程來上課

我的blog

題目:
1. 請聲明5/31日曾全程來上課。
2. 一組標準全齒輪齒輪之徑節為8(亦可使用自設值),齒數分別為30T與48T,其工作壓力角為20度(可為14.5或25度,自選)。

* 試求其接觸線長度,與接觸比。
* 兩齒輪之節圓、基圓直徑各為如何?請列式計算其結果。
* 此組齒輪是否會產生干涉現象?試列式證明之。
* 可否利用draw_gear.m繪出其接合情形,並繪出其動畫效果。

12.1
我5/31日曾全程來上課



12.2
==>一組標準全齒輪齒輪之徑節為8(亦可使用自設值),齒數分別為30T與48T,其工作壓力角為20度(可為14.5或25度,自選)。

* 試求其接觸線長度,與接觸比。
* 兩齒輪之節圓、基圓直徑各為如何?請列式計算其結果。
* 此組齒輪是否會產生干涉現象?試列式證明之。
* 可否利用draw_gear.m繪出其接合情形,並繪出其動畫效果。
Ans:

1.
假設齒輪徑節為8,齒數為30T跟48T,工作壓力角為20度.
此時,我們可以利用教學網站上的一個function來解決這個問題.
也就是function [c_ratio, c_length, ad, pc, pb, d2, d3, ag] = contact_ratio(pd, n2,n3, phi)

其中輸入的參數分別如下:
Pd:徑節
n2, n3:兩齒輪之齒數
phi:壓力角

輸出參數:
cr_ratio:接觸比
cr_length:接觸長度
ad:齒冠
pc, pb:周節及基周節
d2, d3:兩齒輪節圓直徑。
ag:兩齒輪之接近角、遠退角及作用角

************************************
function [c_ratio,c_length,ad,pc,pb,d2,d3,ag]=contact_ratio(pd,n2,n3, phi)
%
%Find the contact ratios
% Inputs:
% Pd: Diametrial pitch;
% n2,n4:number of both gears;
% phi: pressure angle, degrees
% Outputs:
% c_ratio, c_length: contact ratio and length
% ad:addendium
%   pc,pb: circular and basic circular pitches
%   r2, r3: radii of pitch circles
%  ag: angles of action, in matrix of
% [alpha2 beta2 theta2 alpha3 beta3 theta3]
% Example: [c_r,c_l,ad,pc,pb,d2,d3,ag]
% =contact_ratio(6,24,48,20)
% Revised: March 9, 2006
d2g=pi/180;
pangle=phi*d2g;
cosx=cos(pangle);sinx=sin(pangle);
ad=1./pd;pc=pi./pd;
pb=pc.*cosx;
r2=n2./(2*pd);r3=n3./(2*pd);d2=2*r2;d3=2*r3;
rb2=r2.*cosx;rb3=r3.*cosx;
ax=sqrt((r3+ad).^2-(r3.*cosx).^2)-r3.*sinx;
xb=sqrt((r2+ad).^2-(r2.*cosx).^2)-r2.*sinx;
c_length=ax+xb;
c_ratio=c_length./pb;
ag1=[ax./rb2 xb./rb2 c_length./rb2]/d2g;
ag2=[ax./rb3 xb./rb3 c_length./rb3]/d2g;
ag=[ag1;ag2];
**************************************

主程式
==>
function [c_ratio, c_length, ad, pc, pb, d2, d3, ag] =contact_ratio(8,30,48,20)

結果如下:

接觸比 =1.7005
接觸長度 =0.6275
齒冠 =0.1250
周節=0.3927
基周節=0.3690
齒輪一節圓直徑=3.7500
齒輪二節圓直徑=6
兩齒輪的接近角、遠退角及作用角
==>(1)10.4850 9.9211 20.4061
(2)6.5532 6.2007 12.7538

因此
==>
*接觸比:c_ratio = 1.7005
*接觸長度:c_length =0.6275

所謂接觸比,即同時有幾對齒相互嚙合,數值越大力量分散較平均,因此最好大於1,這樣比較可以避免有未嚙合的狀況,因此,這個狀況是符合的.

若欲手動計算,可用課本上的公式
==>
接觸比 mc = 接觸路徑長度/基周節




2.
節圓
==>
由公式: Pd=N/D (徑節=齒數/節圓直徑)

30T的齒輪節圓直徑: 8=30/D D=3.75 (cm)
48T的齒輪節圓直徑: 8=48/D D=6 (cm)

和第一小題用程式執行的結果一樣.

基圓
==>
利用課本的公式,將節圓直徑乘上工作壓力角的餘弦值即是答案:

30T的齒輪基圓直徑: 3.75*cos(20)=3.524 (cm)
48T的齒輪基圓直徑: 6*cos(20)=5.638 (cm)


3.
關於這個,可以分為接近角以及退遠角兩方面來討論.

接近角
==>
必須滿足MP>=AP
條件可以變成(N2^2+2*N2*N3)sin(壓力角)^2>=4+4*N3
是以N2=30,N3=48,壓力角=20度,代入.
(900+2880)*sin(20)^2=442.176 > 4+4*N3=196
結論,不會干涉.

退遠角
==>
必須滿足NP>=BP
條件可以變成(N3^2+2*N3*N2)sin(壓力角)^2>=4+4*N2
(2304+2880)sin(20)^2=606.41 > 4+4*N2=124
結論,不會干涉.

所以總結,不會產生干涉現象!

以下即為齒輪干涉的概念圖==>














另外,假如不想要每次那麼麻煩計算.
網路講義中有提供了一個程式可供使用判斷呦.
這個程式就是function [x]=isinterf(phi,N1,N2)

***********************************************
function [x]=isinterf(phi,N1,N2)
%
% Test if the gear set exists an interference
% phi:pressure angle, in degrees
% N1,N2:teeth of both gears
% x=0:no interference; x=1 interence exists
x=0;
sinx=sin(phi*pi/180);
if N2if N1*(N1+2*N2)*sinx*sinx<4*(1+N2), x=1;end
************************************************
phi為壓力角
N1為齒輪一齒數
N2為齒輪二齒數
x=1表示產生干涉
x=0表示不產生干涉

主程式
==>
function [x]=isinterf(20,30,48)

ans=0
所以是不產生干涉,與計算結果符合的!


4.
function [coords]=draw_gear(Dp,N,phi,range,x0,y0)

關於這個函式,它的基本參數定義如下:
Dp: 節矩
N: 齒數
phi: 壓力角
range: 繪出之部份
x0,y0: 齒輪中心座標

*************************************************
function [coords]=draw_gear(Dp,N,phi,range,x0,y0)
% [coords]=draw_gear(Dp,N,phi,range,x0,y0)
% To draw a whole gear
% Inputs:
% Dp: Diametrical pitch
% N: no of teeth in a gear
% phi: pressure angle, degrees
% range: the section range to be drawn
% x0,y0: the location of the gear center
% Example [coords]=draw_gear(10,15,20,360,0,0)
[coord,theta,rp,rb]=tooth(Dp,N,phi);
coords=[];i=0;
while i coord1=rotate2D(coord,-i,x0,y0);
coords=[coords;coord1];
i=i+theta;
end
plot(coords(:,1),coords(:,2));hold on;
[coord]=bushing(rp/8,x0,y0);
plot(coord(:,1),coord(:,2),'b-');
[coord]=bushing(-rp,x0,y0);
plot(coord(:,1),coord(:,2),'r:');
[coord]=bushing(-rb,x0,y0);
plot(coord(:,1),coord(:,2),'b:');
axis equal;
*************************************************

[coords]=draw_gear(8,48,20,360,9.75/2,0,12.7538)

圖形如下==>















由於我們的目標是期望它能繪出動畫效果.
而這個程式本身只是會製齒輪外型使其成為一齒輪組.
因此,勢必要加入變數theta,使其擁有轉動的動畫效果.
方式是將程式裡頭的while迴圈中......
把coord1=rotate2D(coord,-i,x0,y0)中的-i改成-i+theta2.
一開始可供輸入的變數則變為如下:

function [coords]=draw_gear(Dp,N,phi,range,x0,y0,theta2)

改造程式完成後,便可開始進行動畫繪製工作.
在此,利用第一小題程式求得的作用角~~
以及第二小題求得的節圓直徑.
將這兩變數代入程式後,多個for迴圈.
如此一來,便大功告成!

主程式
==>
for theta=0:0.5:24
clf
[coords]=draw_gear(8,30,20,360,0,0,20.4061+theta)
[coords]=draw_gear(8,48,20,360,9.75/2,0, 12.7538-theta*.625)
pause(0.2)
end
axis equal




後來在看講義的時候,發現有個好用的function
叫做move2_gear(Dpitch,nn1,nn2,phi,omega1)
做出來的效果很好......
因此,在此弄上這個漂亮許多的版本哩~~
(p.s.1上面那個自製似乎轉動速度慢了點...=.=)
(p.s.2 ctrl+C 是好物......good!)

***************************************************
function move2_gear(Dpitch,nn1,nn2,phi,omega1)
% move2_gear(Dpitch,nn1,nn2,phi,omega1)
% To draw a whole gear
% Inputs:
% Inputs:
% Dpitch:dimetral pitch
% nn1,nn2: no. of teeth for both gears
% phi:pressure angle, degrees
% omega1: angular velocity of gear 1
% Example move2_gear(10,15,20,20,10)
clf;
d2r=pi/180;delt=0.01;
[coord1,r1,rb1]=one_tooth(Dpitch,nn1,phi,360,0,0);
[coord2,r2,rb2]=one_tooth(Dpitch,nn2,phi,360,0,0);
st=180/nn2;if nn1+nn2>2*fix((nn1+nn2)/2),st=0;end
coord2=rotate2D(coord2,180+st,0,0);
xc1=coord1(:,1);yc1=coord1(:,2);
xc2=coord2(:,1);yc2=coord2(:,2);
height=max(r1,r2)*1.2;
ar=min(abs(r1),abs(r2));
coord=bushing(ar/5,0,0); % Get the coordinates of 1st bushing
xb1=coord(:,1)-r1;yb1=coord(:,2);
xb2=coord(:,1)+r2;yb2=coord(:,2);
coord=bushing(-r1,-r1,0);%Get the 1st pitch circle
xp1=coord(:,1);yp1=coord(:,2);
coord=bushing(-r2,r2,0);% Get the 2nd pitch circle
xp2=coord(:,1);yp2=coord(:,2);
plot(xb1,yb1,'r-');hold on;
plot(xb2,yb2,'k-');
plot(xp1,yp1,'r:');
plot(xp2,yp2,'k:');
plot([-r1,r2]',[0,0]','r:');
xx1=min([r1,r2])/2;phir=(90-phi)*d2r;
plot([0,0]',[-xx1*2,xx1*2]','b:');
plot([-xx1 xx1]',[-xx1*tan(phir), xx1*tan(phir)]','b:');

cir1=line('xdata',[],'ydata',[],'erasemode','xor','linewidth',1,'color','r');
cir2=line('xdata',[],'ydata',[],'erasemode','xor','linewidth',1,'color','k');
line1=line('xdata',[],'ydata',[],'erasemode','xor','linewidth',2,'color','r');
line2=line('xdata',[],'ydata',[],'erasemode','xor','linewidth',2,'color','k');
lx1=[0 -r1]';ly1=[0,0]';
lx2=[r2,0]';ly2=[0,0]';
axis([-2.5*r1 2.5*r2 -height height]);
axis equal;
title('Press Ctl-C to stop');
theta1=180;theta2=180;s1=omega1*delt/d2r;
while 1,
z1=rotate2D([xc1,yc1],theta1,-r1,0);
z2=rotate2D([xc2,yc2],theta2,r2,0);
L1=rotate2D([lx1,ly1],theta1,-r1,0);
L2=rotate2D([lx2,ly2],theta2,r2,0);
set(cir1,'xdata',z1(:,1),'ydata',z1(:,2)); % For 1st circle moving
set(cir2,'xdata',z2(:,1),'ydata',z2(:,2)); % For 2nd circle moving
set(line1,'xdata',L1(:,1),'ydata',L1(:,2)); % For 1st line
set(line2,'xdata',L2(:,1),'ydata',L2(:,2)); % For 2nd line
drawnow;
pause(1/s1); %Stop for a while so we can see the graph
theta1=theta1+s1;
theta2=theta2-s1*r1/r2;
if theta1>360, theta1=theta1-360;end; %Reverse the direction at bondary line
if theta2>360,theta2=theta2-360;end;
end
******************************************
Dpitch:節矩
nn1,nn2:兩齒輪之齒數
phi:壓力角,degrees
omega1: 齒輪1之角速度,rad/s


主程式
==>
move2_gear(8,30,48,20,10)



沒有留言: