Showing posts with label 齒輪. Show all posts
Showing posts with label 齒輪. Show all posts

5/17/07

第十二章 齒列(1)

9-1.3滾動錐角之計算



9-1.3.1外接錐之錐角比
就圖9.5所示,滾動接觸點應沿著OP線,令其頂點為O。則兩錐角之和與合錐角之關係如下:
Σ=γ2+γ3                                                9.6


各錐與錐角之函數關係為:
sinγ2  = AP/OP ;  sinγ3 =BP/OP                          9.7

sinγ2/sinγ3= AP/BP =ω3 /ω2 = sin (Σ-γ3)/sinγ3       9.8

改寫上式,得:
[sinΣ cosγ3 - cosΣ sinγ3 ]/ sinγ3=ω3 /ω2       9.9


左邊分子分母各除以cosγ3可以解tanγ3,得到
tanγ3= sinΣ / [ω3 /ω2 + cosΣ]                    9.10


公式9.10可用電腦程式計算,亦可利用圖解法。例如要作一轉速比ω2 :ω3 = 5:3比例之圓錐,設合錐角Σ為60度,其MATLAB之程式如下:
function [gama1,gama2]=bevel_angle(omega,sigma,mode)
%
% Demo9.1:
%      [gama1,gama2]=bevel_angle(omega,sigma,mode)
% mode:1 for outer set; -1 for innner set
% sigma: combined angle, degrees
% omega: angular velocity ratio=w1/w2, decimal
% gama1: cone angle for gear 1, degrees
% gama2: cone angle for gear 2, degrees
% Examples:[gama1,gama2]=bevel_angle([1 2 3 4 5],45,1)
d2g=pi/180;
sa=sigma*d2g;
gama1=atan(sin(sa)./(omega+mode*cos(sa)))/d2g;
gama2=sigma-mode*gama1;



-------------------------------------------
執行例一:ω1 /ω2 =5/3;Σ=60;
>> [gama1,gama2]=bevel_angle(5/3,[60],1)
gama1 =   21.7868
gama2 =   38.2132


執行例二:ω1 /ω2 =5/3;Σ=[60 50 40 30];
>> [gama1,gama2]=bevel_angle(5/3,[60 50 40 30],1)
gama1 =   21.7868   18.3506   14.8008   11.1676
gama2 =   38.2132   31.6494   25.1992   18.8324


9-1.3.2內接錐之錐角比



若兩錐組合一為內輪γ2,外輪γ3,則上述公式更改如下:
tanγ3= sinΣ / [ω3 /ω2  - cosΣ]              9.10


利用電腦程式執行如下:

執行例三:ω1 /ω2 =7/3;Σ=[ 30];內接錐
>> [gama1,gama2]=bevel_angle(7/3,[30],-1)
gama1 =   18.8171
gama2 =   48.8171

執行例三:ω1 /ω2 =[7/3 5/3 4/3]7/3;Σ=[ 30];內接錐
>> >> [gama1,gama2]=bevel_angle([7/3 5/3 4/3],[30],-1)
gama1 =   18.8171   31.9848   46.9357
gama2 =   48.8171   61.9848   76.9357


9-7.2齒輪之接觸比



齒輪作用之另一重要特性為接觸比(Contact ratio),亦即在同一時間內有多少對牙齒同時相互嚙合。其對數愈多,表示各對牙齒所承受的負荷較輕,力量之傳遞也愈為均勻;對數愈少,齒牙負荷相對愈重,若接觸比小於1,即表示在某些時候可能沒有齒牙配對,則這兩對齒輪在力的傳遞上就會發生不均勻的問題。一般之接觸比應不小於1.2,亦即80%的時間是兩對牙齒共同協力作業,而約有20%的時間,僅有一對負責傳遞的工作。

長度之計算
圖9.24中之兩齒輪顯示其喫合在兩個位置,一為接觸開始時,一為離開時。在這兩點間,接觸點沿著壓力作用線MN方向移動,發生接觸係自A開始,是為壓力線與齒輪2之齒冠交點;離開點B則為壓力線與齒輪3之齒冠交點。F與G點為齒輪2之齒形在接近點A與離開點B時與節圓相交的兩點;同理,D與E為齒輪3在其節圓之對應點。由於兩節圓相互滾動接觸,故此兩點構成的弧長應相等。

圖9.24 兩齒輪之接觸長度


兩齒輪之接觸路徑應等於基圓切線上之線段AB,設兩對齒輪之齒冠均為a,則其長度為LAB:

接觸比之計算



接觸比mc應為接觸路徑長度與基周節之比,其公式如下:

作用角



對齒輪2與3 而言(圖9.24),其節圓上之作用弧(Arcs of action)為FPG及DPE,其對應角θ2與θ3,稱為作用角。作用角由接近角與退遠角組成,接近角(Angle of approach)則為兩齒輪接觸之點開始至節點間之夾角,分別α2與α3其對應弧分別為弧FP與DP,而其角度應以切線MN上之對應線段FP與DP與其基圓周節相除得之(圖9.25):

圖9.25

退遠角(Angle of recess)則是齒輪自節點開始至離開不接觸時之角度,或β2與β3,對應線段則為PG與PE。同理可表示如下:




通常接近角與遠退角不相等。作用角則為上述兩角之和,如公式(9-31)及(9.32)

9-7.2.4 MATLAB程式



上式9.25可以用MATLAB函式contact_ratio()計算,此函式之輸入值為徑節、兩齒輪之齒數及壓力角,輸出項包括公式9.26至公式9.32所計算之結果。其中之參數ag則為列矩陣,依序儲存兩齒輪之接近角、退遠角與作用角。其呼叫格式如下:

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];


執行例一:

某對齒輪之周節為4,分別有24及48齒,其壓力角為20度,求其接觸比及相關資料。
>> [c_ratio, c_length,ad,pc,pb,r2,r3,ag]=contact_ratio(4,20,30,20)
c_ratio =    1.6052
c_length =    1.1847
ad =    0.2500
pc =    0.7854
pb =    0.7380
r2 =     5
r3 =    7.5000
ag =14.8816   14.0115   28.8932
9.9211    9.3410   19.2621

所得之資訊如下:

接觸比=1.6052
接觸長度=1.1847 吋
齒冠=0.25吋
周節pc=0.7854;基周節pb=0.7380
齒輪節圓直徑r2=5吋, r3=7.5吋
齒輪2之接近角=14.8816度;遠退角=14.0115度
作用角=28.8932度
齒輪3之接近角=9.921度;遠退角=9.3410度
作用角=19.2621度

執行例二:

某對齒輪之周節為5,分別有20及30齒,其壓力角為20及25度,求其接觸比及相關資料。
>> [c_ratio, c_length,ad,pc,pb,d2,d3,ag]=contact_ratio(5,20,30,[20 25]')
c_ratio =
1.6052
1.4419
c_length =
0.9477
0.8211
ad =
0.2000
pc =
0.6283
pb =
0.5904
0.5694
d2 =
4
d3 =
6
ag =
14.8816   14.0115   28.8932
13.2629   12.6921   25.9550
9.9211    9.3410   19.2621
8.8419    8.4614   17.3033



指令中,壓力角之輸入以行型式輸入(即[20 25]' ),其結果亦以行之型式對應出現。其他變數亦可如此作對照。這種比較不限1X2行矩陣,也不限於僅使用於一個輸入變數,但需同大小之矩陣。若不需要後面之輸出項,則僅提及前面所需之項目即可。讀者可自行印證不同變數矩陣之應用,若使用矩陣輸入,以採用行向量型式為宜。

9-7.3齒厚之計算



為分析齒輪承受應力及其應變,需能計算齒輪在任何半徑下之齒厚。以圖9.26為例,某一齒牙之漸開線上,過節圓點P,令P對基圓作切點N,基於漸開線之繪製原理,知弧線BN應等於線段MP,故

圖9.26 漸開線函數之形成

9-7.3.1漸開線MATLAB函數



漸開函數可以查表或由計算程式中得知,而計算齒厚時,可以利用這一個漸開函數計算。用MATLAB之ainv()函式可以得到相對的答案,其呼叫格式如下:
function [epsilon, epsrad]=ainv(z)

其中,z為漸開函數值,得到之對應角度Φ為epsilon, epsrad,分別以度數及弧度表示。

function [epsilon, epsrad]=ainv(z)
% Find the inv funtion of involute angle.
% Using Secant's method.
% Input: z:(<2.2)
% outputs:epsrad, angle in radians
%              epsilon: angle in degrees.
e1=0.63166;z1=0.1;
e2=0.97502;z2=0.5;
ok=0;
while ~ok
e0=(z-z1)/(z2-z1)*(e2-e1)+e1;
z0=tan(e0)-e0;
if abs(z0-z)<1e-6;
break;
else
if z0>z2
z2=z0;e2=e0;
else
z1=z0;e1=e0;
end
end
if abs(z2-z1)<1e-6; break; end
end
epsrad=e0;
epsilon=epsrad*180/pi;



執行例:
>> [ep,eprad]=ainv(0.1)
ep =       36.191
eprad=      0.63166
>> [ep,eprad]=ainv(1)
ep=        64.874
eprad =      1.1323


範例9.14


試以Pd、N及壓力角為輸入,寫一MATLAB程式,計算齒冠圓、節圓及基圓處之齒厚,並求齒尖端處之半徑。

function [r,thickness,beta]=tooth_thick(N,Pd,phi0)
%
% Find the thickness of a tooth in a gear
% Inputs: N, number of teeth; Pd: diametrical pitch;
%            phi0, pressure angle, in degrees
% Output:  r, radii of base, pitch, addendum and point circles
%              thickness: row matrix of 4 elements as above.
%              beta: row matrix of 4 beta angles as above.
d2g=pi/180;
phi=phi0*d2g;
rp=N/Pd/2;
ra=rp+1/Pd;
cosx=cos(phi);
rb=rp*cosx;
tp=pi/Pd/2;
betaa=acos(rp*cosx/ra);
betap=phi;
betab=0;
ta=2*ra*(tp/rp/2+invx(phi)-invx(betaa));
tb=2*rb*(tp/rp/2+invx(phi));
[a,beta0]=ainv(tp/rp/2+invx(phi));
r=[rb rp ra rb/cos(beta0)];
thickness=[tb tp ta 0];
beta=[betab betap betaa beta0]/d2g;

function a=invx(x);
a=tan(x)-x;


執行例:
>> [r,thickness,beta]=tooth_thick(30,4,20)
r =            3.5238         3.75            4       4.1612
thickness =      0.47406       0.3927      0.18435            0
beta =            0           20          28.241       32.132


範例9.15


一標準全齒正齒輪以壓力角20度進行加工,其徑節為6,若在半徑2.1吋處之齒厚為0.1860吋,求其在基圓及節圓處之齒厚。

[解]

由表9.2之周齒厚為



若就問題9.15撰寫一MATLAB函式,輸入值為r, t, Pd及 phi,輸出為N, rp, rb, tb等。其內容如下:

[解]
function [rb, tb, rp,beta, N]=find_thick(r,t,Pd,phi0)
%
%Find the thickness of tooth at base circle
%Inputs: r, t: thickness t at a radius r
%           Pd,phi0: dia pitch and pressure angle in deg.
%Outputs: rb, tb: thickness tb at base circle rb
%              rp, beta,N: radius,beta and No. of teeth for the pitch circle
d2g=pi/180;
phi=phi0*d2g;
cosx=cos(phi);
mm=pi*cosx/4/Pd/r;
kk=invx(phi)-t/2/r;
x1=phi;x2=phi/2;
f1=funcx(x1,mm,kk);
f2=funcx(x2,mm,kk);
ok=0;
while ~ok,
x=x1-f1*(x2-x1)/(f2-f1);
f=funcx(x,mm,kk);
if abs(f)<1e-5, ok=1; end
x2=x1;f2=f1;f1=f;x1=x;
if f1==f2, ok=1; end
end
beta=x/d2g;
N=2*Pd*r*cos(x)/cosx;
rp=N/Pd/2;
rb=rp*cosx;
tb=2*rb*(pi/N/2+invx(phi));

function [f]=funcx(beta,mm,kk)
f=mm/cos(beta)+kk-invx(beta);

function a=invx(x)
a=tan(x)-x;


執行例:

>> [rb, tb, rp,beta, N]=find_thick(2.1,0.186,6,20)
rb = 1.8794
tb = 0.30203
rp = 2
beta = 26.5
N = 24


範例9.17


一小齒輪與齒條機構中,令小齒輪之壓力角為20度,試求小齒輪與齒條運轉時不產生干涉之最小齒數為若干?

[解]

依據公式9.50
N = 2k/sin²ψ=2(1)/sin²(20) = 17.097~18T

故最低不干涉之齒數為18T

就上述之計算結果,試撰寫一MATLAB函式程式,計算參考書中表9.1中標準正齒輪系與一齒列產生干涉現象之最低齒數。

[解]
function [minT, value]=min_teeth(phi,k)
%
% Find the minimum teeth to avoid undercutting for standard gears
%  phi: pressure angle, in degrees
%  minT, value: Min. teeth and calculated value for the gear
%  k: coefficient(1 or 0.8)
if nargin<2
k=1;
end
d2g=pi/180;
sinx=sin(phi*d2g);
value=2*k./(sinx.*sinx);
minT=ceil(value);


執行例
>> [minT, value]=min_teeth([14.5 20 25 20],[1 1 1 0.8])
minT =    32       18      12       14
value =    31.903   17.097   11.198    13.678


其結果如參考書中之表9.1所示之數值。


範例9.19



有一對齒輪組,其壓力角為20o,兩輪之齒數分別為10T與30T,試問是否會產生干涉現象?

[解]
根據公式9.47,測試干涉之條件為:
(N2²+2N2 x N3)sin²>= 4 + 4N3


設N2=10T,N3=30T,Φ=20o 則

10(10+2*30)*sin²(20o)<4(1+30)

故會產生干涉。

範例9.20



設一組標準齒輪,壓力角為phi,齒數分別為N1、N2,試撰寫一MATLAB之程式,測試其是否發生干涉。

[解]

程式如下:
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 N2<N1,nn=N1;N1=N2;N2=nn;end
if N1*(N1+2*N2)*sinx*sinx<4*(1+N2), x=1;end



執行例:
>> isinterf(20,20,30)
ans =     0
>> isinterf(20,12,30)
ans =     1



範例9.21


一組標準齒輪其徑節為2,壓力角為14.5度,齒數分別為14T與16T。檢查是否會產生干涉?若發生干涉,則重新計算不產生干涉之齒冠高度及新的接觸比。

[解]

設小齒輪14T為齒輪2,16T為齒輪3。根據不干涉之條件為公式9.47之標準,即

(N2²+2N2 x N3)sin²>= 4 + 4N3


代入相關值,即
[14² + 2(14)(16)sin²(14.5)< 4 + 4(16)

或利用函式檢測:
>> isinterf(14.5,14,16)
ans =     1


顯然,此組齒輪有干涉現象。



不產生干涉之兩齒冠高度可利用公式9.44與9.48計算,令其為等式:

撰寫成程式如下:
function [a,r,AP,BP,length,mc]=addendum_cut(phi0,N1,N2,Pd)
%
% Find the shortening of addendum to avoid interferences
% Inputs: phi0:pressure angle, in deg.; N1,N2:No. of teeth
%            Pd:dia. pitch, or module in (1/Pd)
% outputs: a:row matrix for addendums [a1,a2,a1',a2',delta1,delta2]
%         AP,BP,length: contact length in portions and whole
%         mc: contact ratio
phi=phi0*pi/180;
cosx=cos(phi); sinx=sin(phi);
rp1=N1/Pd/2;rp2=N2/Pd/2;
r=[rp1 rp2];
a1=1/Pd;a2=a1;
aa1=sqrt((rp2*sinx+rp1*sinx)^2+(rp1*cosx)^2)-rp1;
if aa1>a1,
aa1=a1;
BP=sqrt((rp1+a1)^2-(rp1*cosx)^2)-rp1*sinx;
else
BP=rp2*sinx;
end
aa2=sqrt((rp1*sinx+rp2*sinx)^2+(rp2*cosx)^2)-rp2;
if aa2>a2,
aa2=a2;
AP=sqrt((rp2+a2)^2-(rp2*cosx)^2)-rp2*sinx;
else
AP=rp1*sinx;
end
a=[a1 a2 aa1 aa2 a1-aa1 a2-aa2];
length=AP+BP;
mc=length*Pd/pi/cosx;


執行例:
>> [a,r,AP,BP,length,mc]=addendum_cut(14.5,14,16,2)
a =   0.5    0.5   0.37406   0.30387  0.12594   0.19613
r =          3.5            4
AP =      0.87633
BP =       1.0015
length =    1.8779
mc =      1.2348

第十一章 齒輪(1)-漸開線

11.1 何謂漸開線(Involute)


漸開線常作為齒輪之齒面輪廊,使其接觸點能切於一點,其法線形成一壓力角。漸開線實際上是一捲繞在圓上之線往外拉開時,在同一點所走過的軌跡,亦即以一基圓為迴轉的平台,往外伸張的曲線。其表示式如下:
x = rb(cos(theta) + theta*sin(theta))
y = rb(sin(theta) − theta*cos(t))


其中,rb為基圓之半徑,theta為張開之角度,其單位為弧度。

當角度theta由零開始變化,亦即沿水平軸方向反時鐘方向展開,起始點始於基圓之表面,然後以螺線形往外延伸。依其延伸之角度,此曲線一直往外擴散。相關程式如involute_curve.m,其呼叫格式如下:
function h=involute_curve(rb,theta,mode,Nb)

其輸入參數如下:
rb=基圓半徑
theta = 展開角度,degrees
 Nb=區間之點數(預設值為100點)
 mode=控制參數,=1為單方向; =2 為雙方向

程式內容:
function h=involute_curve(rb,theta,mode,Nb)
% Create an involute curve
% Inputs:
%  rb=base radius
%  theta = max angle for limit, degrees
%  Nb=number of points
%  mode=1 for one direction, =2 for bi-direction
%  Example: involute_curve(5,720)
% Author:Din-sue Fon. BIME, NTU, March 10,2001
% Check the number of input arguments
if nargin<4,Nb=100;end
if nargin<3,mode=1;end
if nargin<2,theta=90;end
if nargin<1,rb=10;end
theta=theta*pi/180;
cth=linspace(0,2*pi,50);
if mode==1,
th=linspace(0,theta,Nb);
else
th=linspace(-theta,theta,Nb);
end
x0=rb*cos(th);y0=rb*sin(th);
x=rb*(cos(th)+th.*sin(th));
y=rb*(sin(th)-th.*cos(th));
for i=1:length(th)
line([x0(i) x(i)],[y0(i) y(i)],'color','b');
end
h=line(x,y,'color','k','linewidth',2);
hbase=line(rb*cos(cth),rb*sin(cth),'color','r','linewidth',1.5);
axis equal;axis off;


執行例:
>> involute_curve(5,360)

ans =  259.0045




>> involute_curve(5,360,2)

ans =  1.1680e+003


第十一章 齒輪(6)--齒輪之製造

11.6 齒輪之製造

齒列為一水平的齒輪,若製成磨刀則可以作為刻劃圓形齒輪之外形。本節中所列程式為利用齒列製造某一齒輪外形之方式,其中最重要的是依齒牙之外形先一水平面的方式製作齒列之齒牙外形。每顆齒牙均是對稱的,故其外形曲線可以僅考慮其一半即可,通常這個外形參數可以分五個區(regions)第一區為底部水平部份,第二區為底側圓角部份,第三區為斜坡部份,第四區為上部圓角,最後為頂部水平部份。這五個區的對應點可以設為參數,以ptregion參數表示一個陣列,包含五個元素,每個元素代表該區所要表示的點數。利用這些點數去繪出齒列上一顆齒牙之外形。



為繪出齒列上之牙齒,係呼叫rackm這個函數,計算其中之各點座標rack以及法線方向 n。其呼叫格式如下:

function [rack,n]=rackm(phir,Dp,A,B,rt,rf,ptregion)


上述函數係保留在整個gearrack.m函數中呼叫,其型式如下:

function gearrack(Dp,N,ar,br,ag,phi,rt,rf,npos,ptregion)

其輸入參數定義如下:
Dp     = 徑節
N       = 齒數
ar      = 齒冠
br      = 齒根
ag      = 齒輪之齒冠
phi     = 壓力角,度數
rt      = 頂部圓角半徑
rf      = 根部圓角半徑
r       = 齒輪節圓半徑
npos    = 齒列之位置數
ptregion=五區之點數,例如:[2 15 2 15 2]


程式內容
function gearrack(Dp,N,ar,br,ag,phi,rt,rf,npos,ptregion)
%
% Matlab program to show motion of rack relative to gear blank
% Input variables:
% Dp      = Diametral pitch
% N       = Number of gear teeth
% ar      = Addendum of the rack
% br      = Dedendum of the rack
% ag      = Addendum of the gear
% phi     = pressure angle in degrees
% rt      = tip radius of rack
% rf      = fillet radius of rack
% r       = pitch radius of gear
% npos    = Number of rack positions
% ptregion=points of different regions,eg.[2 15 2 15 2]
% Author: Kenneth J. Waldron, 1999
% Revised by DSFON, BIME, NTU Date:May 29,2007
% Example  gearrack(10,10)
if nargin<10, ptregion=[2 15 2 15 2];end
if nargin<9, npos=15;end
if nargin<3,ar=1.25;br=1.1;ag=1.0,phi=20;rt=0.02;rf=0.04;end
ans='y';
disp('   ')
disp('   This is the Rack Motion Program')
disp('   ')
height=0.8;width=0.8;
h=axes('position',[.05 .05 width height],'box','on','xcolor','k','ycolor','k');
set(gcf,'color', 'w')

% Compute basic parameter values.
r2d=180/pi;d2r=1/r2d;
A=ar/Dp;B=br/Dp;p=pi/Dp;
r=p*N/(pi*2);
theta=pi/N;
ro=r+ag/Dp;
phir=phi*d2r;
%gamma=pi/2-phir;
%lt=pi/(2*Dp)-2*A*tan(phir)-2*rt*tan(gamma/2);
%lb=pi/(2*Dp)-2*B*tan(phir)-2*rf*tan(gamma/2);

% Check for negative values for lt and lb.  If either is negative,
% set the value to zero and compute the corresponding radius.
[rack,n]=rackm(phir,Dp,A,B,rt,rf,ptregion)
figure(1);
clf;

% Draw the rack.  Start by defining the plots
rackline=line('xdata', [], 'ydata' ,[], 'linewidth',1,...
'erasemode', 'xor','color', 'r');
rackpitchline=line('xdata', [], 'ydata' ,[],'linewidth',0.4,...
'erasemode','xor','color', 'k', 'linestyle', '-.');
itotal=length(rack(1,:));
rackx=rack(1,:);racky=rack(2,:);
range=pi/Dp;
j=itotal;
for i=1:1:itotal-1
j=j+1;
rackx(j)=-rackx(itotal-i)+range;
racky(j)=racky(itotal-i);
end 
itotal=j;
xmax=max(rackx);xmin=min(rackx);xrange=xmax-xmin;
ymax=max(-racky);ymin=min(-racky);yrange=ymax-ymin;
ymin=ymin-0.05*yrange;
axis([xmin xmax ymin ymax]);axis equal

% Plot the positions
set(rackline, 'xdata', rackx, 'ydata', -racky);
set(rackpitchline, 'xdata',[xmin, xmax], 'ydata', [0,0]);
text(xmax-0.15*xrange, 0.01,'Pitch line');
title('The Tooth Profile');
% Draw the rack as it rolls about the gear through an angle theta.


% Define the pitch circle and blank circle arcs
figure(2);
clf;
bth=linspace(-theta,theta,20);hold on;
plot(ro*sin(bth),ro*cos(bth),'r:');
plot(r*sin(bth),r*cos(bth),'b:');
text(xmin-0.15*xrange, r*cos(bth(6)), 'Pitch Circle');
text(xmin-0.15*xrange, ro*cos(bth(6)), 'Blank Circle');
title('Motion of Rack Relative to Gear');
dth=4*theta/npos;
th=-theta-dth/1.5;
beta=-theta;
itotal=length(rackx);
for k=1:1:npos
th=th+dth;
cth=cos(th);sth=sin(th);
for i=1:1:itotal
tempx=-cth*(rackx(i)-r*th)+sth*(racky(i)-r);
tempy=-sth*(rackx(i)-r*th)-cth*(racky(i)-r);

% Rotate the coordinate system by -pi/N so that the y axis is along the
% centerline of the gear tooth instead of the centerline of the gap.

racktx(k,i)=tempx*cos(beta)-tempy*sin(beta);
rackty(k,i)=tempx*sin(beta)+tempy*cos(beta);
end
line(racktx(k,:),rackty(k,:));
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [rack,n]=rackm(phir,Dp,A,B,rt,rf,ptregion)
%
%Calculate a rack profile, with ptregion specifies 5-region points
% phir:pressure angle in radian
% Dp:diametral pitch
% ar: addendium
% br: bottom reference,dedendum of rack
% rt  = tip radius of rack
% rf  = fillet radius of rack
gamma=pi/2-phir;
lt=pi/(2*Dp)-2*A*tan(phir)-2*rt*tan(gamma/2);
lb=pi/(2*Dp)-2*B*tan(phir)-2*rf*tan(gamma/2);
if lt <0
lt=0;
rt=(pi/(2*Dp)-2*A*tan(phir))/(2*tan(gamma/2));
end
if lb <0
lb=0;
rf=(pi/(2*Dp)-2*B*tan(phir))/(2*tan(gamma/2));
end
i=0;
for k=1:length(ptregion) %for 5 regions
beta=0.0;nx=ptregion(k);dbeta=1/nx;
for j=1:nx
i=i+1; 
beta=beta+dbeta;
switch k
case 1
rack(:,i)=[beta*lt/2;A];n(:,i)=[0;1.0];
case 2
rack(:,i)=[lt/2+rt*sin(beta*gamma);...
A-rt*(1-cos(beta*gamma))];
n(:,i)=[sin(beta*gamma);cos(beta*gamma)];
case 3
sg=sin(gamma);cg=cos(gamma); 
rack(:,i)=[(1-beta)*(lt/2+rt*sg)+...
beta*(pi/(2*Dp)-lb/2-rf*sg);...
(1-beta)*(A-rt*(1-cg))+beta*(-B+rf*(1-cg))];
n(:,i)=[cos(phir);sin(phir)];
case 4
sb=sin((1-beta)*gamma); cb=cos((1-beta)*gamma);
rack(:,i)=[pi/(2*Dp)-lb/2-rf*sb;-B+rf*(1-cb)];
n(:,i)=[sb;cb];
case 5
rack(:,i)=[pi/(2*Dp)-lb/2*(1-beta);-B];
n(:,i)=[0;1];
end
end
end


執行例:

>> gearrack(10,10)

ag =    1


This is the Rack Motion Program


rack =

Columns 1 through 8

0.0095    0.0190    0.0207    0.0223    0.0239    0.0254    0.0270    0.0284
0.1250    0.1250    0.1249    0.1247    0.1244    0.1239    0.1234    0.1227

Columns 9 through 16

0.0298    0.0312    0.0324    0.0336    0.0347    0.0356    0.0365    0.0372
0.1218    0.1209    0.1199    0.1187    0.1175    0.1162    0.1148    0.1133

Columns 17 through 24

0.0378    0.0734    0.1090    0.1102    0.1117    0.1134    0.1154    0.1175
0.1118    0.0141   -0.0837   -0.0867   -0.0896   -0.0924   -0.0950   -0.0974

Columns 25 through 32

0.1198    0.1223    0.1250    0.1278    0.1307    0.1338    0.1369    0.1401
-0.0997   -0.1018   -0.1037   -0.1053   -0.1067   -0.1079   -0.1088   -0.1095

Columns 33 through 36

0.1433    0.1466    0.1518    0.1571
-0.1099   -0.1100   -0.1100   -0.1100


n =

Columns 1 through 8

0         0    0.0814    0.1622    0.2419    0.3201    0.3961    0.4695
1.0000    1.0000    0.9967    0.9868    0.9703    0.9474    0.9182    0.8829

Columns 9 through 16

0.5398    0.6065    0.6691    0.7274    0.7808    0.8290    0.8718    0.9088
0.8418    0.7951    0.7431    0.6862    0.6248    0.5592    0.4899    0.4173

Columns 17 through 24

0.9397    0.9397    0.9397    0.9088    0.8718    0.8290    0.7808    0.7274
0.3420    0.3420    0.3420    0.4173    0.4899    0.5592    0.6248    0.6862

Columns 25 through 32

0.6691    0.6065    0.5398    0.4695    0.3961    0.3201    0.2419    0.1622
0.7431    0.7951    0.8418    0.8829    0.9182    0.9474    0.9703    0.9868

Columns 33 through 36

0.0814    0.0000         0         0
0.9967    1.0000    1.0000    1.0000

第十一章 齒輪(3)-繪製齒輪



11.3 如何繪製齒輪

前面已經討論許多繪製齒輪必要的過程,本節將綜合各節所述,作成可以放置任意位置的齒輪組draw_gear.m,呼叫程式時,可以在任意的地方建立齒輪之外形。利用其轉動座標的功能,可以調整其契合的位置,成為齒輪組。
其呼叫型式如下:



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<range
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;




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [coords,theta,rp,rb]=tooth(Dp,N,phi)
% Example tooth(10,10,20)
nn=10;
d2r=pi/180;
phir=phi*d2r;
rp=N/Dp/2;
pc=pi/Dp;
ra=rp+1/Dp;
rb=rp*cos(phir);
rd=rp-1.25/Dp;
thpb=pc/rp;% angle respect to one pitch
tp=pc/2;
rr=linspace(rb,ra,nn)';
invphi=tan(phir)-phir;
for i=1:nn
beta=acos(rp/rr(i)*cos(phir));
tt(i)=(tp/rp/2+invphi-tan(beta)+beta);
end
coord1=[rr.*cos(tt') rr.*sin(tt')];
coord3=reverse(coord1);
th1=linspace(thpb/2,thpb/2-tt(nn),nn)';
coord0=[cos(th1) sin(th1)]*rd;
th2=linspace(tt(nn),-tt(nn),nn)';
coord2=[cos(th2) sin(th2)]*ra;
coord4=reverse(coord0);
coords=[coord0;coord1;coord2;coord3;coord4];
theta=thpb/d2r;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [B]=reverse(A)
nn=length(A); B=A;
for i=1:nn,B(i,:)=A(nn-i+1,:);end
B=[B(:,1) -B(:,2)];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [coords] = bushing(rr,x0,y0)
d2r=pi/180;
theta=[360:-10:0]*d2r;
r=abs(rr);
rx=r*cos(theta);ry=r*sin(theta);
if rr<0,
rx=rx+x0;
ry=ry+y0;
coords=[rx' ry'];
return;
end;
rx1=rx/2;rx2=-rx1;
ry1=ry/2;ry2=-ry1;
r4=r+r/4;r3=r/3;
bx=[ 0 0 0 -r -r -r4 -r4 r4 r4 -r r r];
by=[r3 -r3 0 0 -r -r -r4 -r4 -r -r -r 0];
coords(:,1)=[bx rx rx1 rx2]'+x0;
coords(:,2)=[by ry ry1 ry2]'+y0;

%%%%%%%%%%%%%%%%%%%%%%%%

function [coords]=rotate2D(coord,theta,x0,y0)
th=theta*pi/180;
c=cos(th);s=sin(th);fact=[c s;-s c];
coords=coord*fact;
coords(:,1)=coords(:,1)+x0;
coords(:,2)=coords(:,2)+y0;


執行範例



>> [coords]=draw_gear(10,15,20,360,0,0)




第十一章 齒輪(2)-齒輪曲線



11.2 齒輪曲線之形成

由前面齒列之程式可以瞭解齒輪雖然僅有齒牙相接觸,但其曲線之形成仍然必須依據特定的曲線規則。漸開線是最常用的曲線,為此可以使用齒列作為切刀,修正曲線之外廓。程式gear_curve.m除可產生齒輪之基本曲線外,可以依所需之齒數建立一個完整的齒輪,並且使其作適當的迴轉運動。程式中另呼叫onegear.m、rotate2xy.m。前者是將一個完整的齒輪的外形座標組合,後者則是座標旋轉的程式。程式gear_curve.m之呼叫格式如下:

  function [rack,gear]=gear_curve(Dp,N,phi,ar,br,rt,rf,ag,ptregion)


Dp      = 節矩
ar      = 齒列之齒冠
br      = 齒列之齒根
phi     = 壓力角, degrees
rt      = 頂部圓角半徑
rf      = 根部圓角半徑
r       = 齒輪之節圓半徑
ag      = 齒輪之齒冠
bg      = 齒輪之齒根
ptregion= 齒形之五區點數,列矩陣,例如:[5 15 5 15  5]
N       = 齒輪之齒數


function [rack,gear]=gear_curve(Dp,N,phi,ar,br,rt,rf,ag,ptregion)
%
% Matlab program to draw a gear generated by a straight flanked hob.
%
%Some of the important variables used are:
%
% Example  gear_curve(10,10,20,1.25,1,0.02,0.04,1.0,[30 30 40 30 30],10)
%          gear_curve(10,10)
%
%Dp      = Diametral pitch
%ar      = Addendum constant for rack
%br      = Dedendum constant for rack
%phi     = pressure angle in degrees
%rt      = tip radius of rack
%rf      = fillet radius of rack
%r       = pitch radius of gear
%ag      = Addendum constant for gear
%bg      = Dedendum constant for gear
%ptregion= No. of points for five regions, row matrix
%N       = Number of gear teeth
if nargin<4,
ar=1.25;br=1;rt=0.02;rf=0.04;ag=1;
%ptregion=[10 15 20 15 15];
ptregion=[10 15 10 15 10];
end
th=linspace(0,2*pi,50);
if nargin<3,phi=20;end ans="'y';" d2r="pi/180;" ansp="'y';" pc="pi/Dp;" r="pc*N/(pi*2);%" ro="r+ag/Dp;" phir="phi*d2r;" rackline="line('xdata'," rackpitchline="line('xdata'," xmax="max(rack(1,:));xmin="min(rack(1,:));xrange="xmax-xmin;" ymax="max(rack(2,:));ymin="min(rack(2,:));yrange="ymax-ymin;" ymin="ymin-0.05*yrange;" ymax="ymax+0.05*yrange;" dtheta="2*pi/N/d2r;" gear0="gear;" i="1:N-1," gear="[gear," gearline="line('xdata'," gearpitchline="line('xdata'," xtemp="gear(1,:);ytemp="gear(2,:);" xmax="max(xtemp);xmin="min(xtemp);xr="xmax-xmin;" ymax="max(ytemp);ymin="min(ytemp);yr="ymax-ymin;" s="0.1;" xgear="xtemp';ygear="ytemp';" ainc="1;" theta="0;i="0;">360,theta=theta-360;i=i+1; end
set(gearline, 'xdata', xgear, 'ydata', ygear);
[xgear,ygear]=rotate2xy(xgear,ygear,ainc);
theta=theta+ainc;
drawnow;
pause(0.01);
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [rack,n]=rackm(phir,Dp,A,B,rt,rf,ptregion)
%
%Calculate a rack profile, with ptregion specifies 5-region points
% phir:pressure angle in radian
% Dp:diametral pitch
% ar: addendium
% br: bottom reference,dedendum of rack
% rt  = tip radius of rack
% rf  = fillet radius of rack
gamma=pi/2-phir;
lt=pi/(2*Dp)-2*A*tan(phir)-2*rt*tan(gamma/2);
lb=pi/(2*Dp)-2*B*tan(phir)-2*rf*tan(gamma/2);
if lt < 0
lt=0;
rt=(pi/(2*Dp)-2*A*tan(phir))/(2*tan(gamma/2));
end
if lb <0
lb=0;
rf=(pi/(2*Dp)-2*B*tan(phir))/(2*tan(gamma/2));
end
i=0;
for k=1:length(ptregion) %for 5 regions
beta=0.0;nx=ptregion(k);dbeta=1/nx;
for j=1:nx
i=i+1; 
beta=beta+dbeta;
switch k
case 1
rack(:,i)=[beta*lt/2;A];n(:,i)=[0;1.0];
case 2
rack(:,i)=[lt/2+rt*sin(beta*gamma);...
A-rt*(1-cos(beta*gamma))];
n(:,i)=[sin(beta*gamma);cos(beta*gamma)];
case 3
sg=sin(gamma);cg=cos(gamma);
rack(:,i)=[(1-beta)*(lt/2+rt*sg)+beta*(pi/(2*Dp)-lb/2-rf*sg);...
(1-beta)*(A-rt*(1-cg))+beta*(-B+rf*(1-cg))];
n(:,i)=[cos(phir);sin(phir)];
case 4
sb=sin((1-beta)*gamma); cb=cos((1-beta)*gamma);
rack(:,i)=[pi/(2*Dp)-lb/2-rf*sb;-B+rf*(1-cb)];
n(:,i)=[sb;cb];
case 5
rack(:,i)=[pi/(2*Dp)-lb/2*(1-beta);-B];
n(:,i)=[0;1];
end
end
end

%%%%%%%%%%%%%%%%   

function [gear,plx,ply]=onegear(rack,n,r,ro,N)
%
%find coordinates of one gear
% rack:coordinates of a rack
% n: normal vector of each point on the rack
% r: pictch radius
% ro:outside radius
% N: no. of teeth
d2r=pi/180;
ang=(rack(1,:).*n(2,:)-rack(2,:).*n(1,:))./(r*n(2,:));
geart(1,:)=-cos(ang).*(rack(1,:)-r*ang)+sin(ang).*(rack(2,:)-r);
geart(2,:)=-sin(ang).*(rack(1,:)-r*ang)-cos(ang).*(rack(2,:)-r);

% Define the pitch circle arc

maxang=max(ang);
minang=min(ang);
dk=(maxang-minang)/20;
i=0;
for k=minang:dk:maxang
i=i+1;
plx(i)=r*sin(k);
ply(i)=r*cos(k);
end 

% Rotate the coordinate system by -pi/N so that the y axis is along the
% centerline of the gear tooth instead of the centerline of the gap.

[xx,yy]=rotate2xy(geart(1,:)',geart(2,:)',-pi/N/d2r);
xx=xx';yy=yy';
% Test for the undercut points which cannot be on the gear
itotal=length(rack(1,:));
jstop=itotal+1;
istop=itotal+1;
for i = 1:itotal-2
for j=i+1:itotal-1
if istop==itotal+1 & jstop==itotal+1
ra=[xx(i) yy(i)];
rb=[xx(i+1) yy(i+1)];
rc=[xx(j) yy(j)];
rd=[xx(j+1) yy(j+1)];
rba=rb-ra;rca=rc-ra;
rac=ra-rc;rda=rd-ra;
rdc=rd-rc;rbc=rb-rc;
rbd=rb-rd;
Aabc=rba(1)*rca(2)-rba(2)*rca(1);
Aabd=rba(1)*rda(2)-rba(2)*rda(1);
Acda=rdc(1)*rac(2)-rdc(2)*rac(1);
Aadb=rda(1)*rba(2)-rda(2)*rba(1);
Acdb=rdc(1)*rbc(2)-rdc(2)*rbc(1);
test1=Aabc*Aabd;
test2=Acda*Acdb;   

% Check for the intersection of two line segments

if test1<0 & test2<0
istop=i;
jstop=j+1;
alpha=abs(Acdb)/(abs(Acda)+abs(Acdb));
re(1)=alpha*ra(1)+(1-alpha)*rb(1);
re(2)=alpha*ra(2)+(1-alpha)*rb(2);
j=itotal;
i=itotal;
end 
end  
end
end

% If two lines intersect, delete the points in the undercut region.

j=0;
for i=1:itotal
if i<=istop | i >= jstop
j=j+1;
geart(:,j)=[xx(i);yy(i)];
if i==istop
j=j+1;
geart(1,j)=re(1);
geart(2,j)=re(2);
end
end
end
itotal=j;

% Check that the points do not extend beyond the addendum circle (ro).

j=0;
rtest1=0;
istop='n';
i=0;
for i=1:itotal
if istop=='n'
rtest2=sqrt(geart(1,i)^2+geart(2,i)^2);
if rtest2<=ro
j=j+1;
gear(:,j)=geart(:,i);
xx(j)=gear(1,j);
yy(j)=gear(2,j);
end

% If the points extend beyond the addendum circle, discard the
% points beyond ro and find the intersection of the gear with the
% ro circle.

if rtest2>ro
alpha=(ro-rtest1)/(rtest2-rtest1);
j=j+1;
gear(:,j)=geart(:,i-1)+alpha*(geart(:,i)-geart(:,i-1));
xx(j)=gear(1,j);
yy(j)=gear(2,j);
istop='y';
end
rtest1=rtest2;
end
end

% if the addendum is reached replace the points beyond the
% addendum with points on a circle arc.

if j<itotal
beta = atan2(gear(1,j), gear(2,j));
dbeta=beta/5;
betak=beta;
for k=1:5
j=j+1;
betak=betak-dbeta;
sbetak=sin(betak);
cbetak=cos(betak);
gear(1,j)=ro*sbetak;
gear(2,j)=ro*cbetak;
end
end
jtotal=j;

% Reflect the points to draw the rest of the gear tooth

for i=1:jtotal-1
j=j+1;
gear(1,j)=-gear(1,jtotal-i);
gear(2,j)=gear(2,jtotal-i);
end 
itotal=j;

%%%%%%%%%%%%%%%%%%%%%%%%

function [x,y]=rotate2xy(x,y,theta,x0,y0)
if nargin<4, x0=0;y0=0;end;
th=theta*pi/180;
c=cos(th);s=sin(th);fact=[c s;-s c];
coords=[x y]*fact;
x=coords(:,1)+x0;y=coords(:,2)+y0;


執行例:
>>gear_curve(10,10);



第十一章 齒輪(5)-齒列與齒輪



11.5 齒列與齒輪間之互動關係

本節將示範一齒列與一齒輪間之運動情形,程式是動態的變化,但可依參數輸入值決定其間之關係。其程式名稱為move2_rack.m,呼叫格式如下:
function move2_rack(Dpitch,nn1,phi,omega1)



輸入參數定義如下:

Dpitch:節矩
 nn1:齒輪數目
 phi:壓力角,degrees
 omega1: 齒輪角速度,rad/s

程式內容:

function move2_rack(Dpitch,nn1,phi,omega1)
%  move2_gear(Dpitch,nn1,nn2,phi,omega1)
% To draw a whole gear
% Inputs:
%  Inputs:
%    Dpitch:dimetral pitch
%    nn1: no. of teeth for both gears
%    phi:pressure angle, degrees
%    omega1: angular velocity of gear 1
% Example move2_rack(10,15,20,10)
clf;
d2r=pi/180;delt=0.01;
phir=phi*d2r;
pc=pi/Dpitch;
[coord1,r1,rb1]=one_tooth(Dpitch,nn1,phi,360,0,0);
[coord2]=rack(Dpitch,phi,nn1,0,0,-r1);
xc1=coord1(:,1);yc1=coord1(:,2);
xc2=coord2(:,1);yc2=coord2(:,2);
coord=bushing(r1/8,0,0); % Get the coordinates of  1st bushing
xb1=coord(:,1);yb1=coord(:,2);
coord=bushing(-r1,0,0);%Get the 1st pitch circle
xp1=coord(:,1);yp1=coord(:,2);
xp2=[0 0]';yp2=[0 -r1]';
plot(xb1,yb1,'r-');hold on;
plot(xp1,yp1,'r:');
plot(xp2,yp2,'k:');
xx=nn1*pc/2;xx1=xx/2;
plot([-xx xx]',[-r1 -r1]','r:');
plot([-xx1  xx1]',[xx1*tan(phir)-r1, -xx1*tan(phir)-r1]','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');
rm=r1+1/Dpitch;
axis([-1.2*rm 1.2*rm -1.3*rm 1.3*rm]);
axis equal;
title('Press Ctl-C to stop');
delta=0;delx=0;dels=omega1*delt;
while 1,
z1=rotate2D([xc1,yc1],delta,0,0);
z2=[xc2-delx,yc2];
L1=rotate2D([xp2,yp2],delta,0,0);
set(cir1,'xdata',z1(:,1),'ydata',z1(:,2)); % For 1st circle moving
set(cir2,'xdata',z2(:,1),'ydata',z2(:,2)); % For the rack moving
set(line1,'xdata',L1(:,1),'ydata',L1(:,2)); % For 1st line
drawnow;
pause(1/omega1);      %Stop for a while so we can see the graph
delta=delta+dels;
delx=delx-dels*r1*d2r;
if delta>360, delta=delta-360;end;   %Reverse the direction at bondary line
if delx<pc,delx=delx+pc;end;
end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [coords,rp,rb]=one_tooth(Dp,N,phi,range,x0,y0)
% [coords]=draw_gear(Dp,N,phi,range,x0,y0)
% To draw a whole gear
% Inputs:
%     Dp: Diametrial pitch
%     N: no of teeth in a gear
%     phi: pressure angle, degrees
%     range: the section range to be drawn
% Example one_tooth(10,10,20,360)
nn=10;
d2r=pi/180;
phir=phi*d2r;
rp=N/Dp/2;
pc=pi/Dp;
ra=rp+1/Dp;
rb=rp*cos(phir);
rd=rp-1.25/Dp;
thpb=pc/rp;% angle respect to one pitch
tp=pc/2;
rr=linspace(rb,ra,nn)';
invphi=tan(phir)-phir;
for i=1:nn
beta=acos(rp/rr(i)*cos(phir));
tt(i)=(tp/rp/2+invphi-tan(beta)+beta);
end
coord1=[rr.*cos(tt') rr.*sin(tt')];
coord3=reverse(coord1);
th1=linspace(thpb/2,thpb/2-tt(nn),nn)';
coord0=[cos(th1) sin(th1)]*rd;
th2=linspace(tt(nn),-tt(nn),nn)';
coord2=[cos(th2) sin(th2)]*ra;
coord4=reverse(coord0);
coord=[coord0;coord1;coord2;coord3;coord4];
theta=thpb/d2r;
coords=[];i=0;
while i<range
coord1=rotate2D(coord,-i,x0,y0);
coords=[coords;coord1];
i=i+theta;
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


function [coords]=rack(Dp,phi,nn,theta,x0,y0)
d2r=pi/180;
phir=phi*d2r;
h=2/Dp;
pc=pi/Dp;
sl=h/cos(phir);
m=sl*sin(phir);
m1=(pc/2-m)/2;
coord=[-pc/2 0;-m1-m 0;-m1,h;m1 h;m1+m 0;pc/2 0];
coords=coord;
for i=1:nn-1
coord1=[coord(:,1)+i*pc coord(:,2)];
coords=[coords;coord1];
end
nd=fix(nn/2)-mod(nn+2,4)*.25;
coords=rotate2D(coords,theta,x0-nd*pc,y0-h/2);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [B]=reverse(A,m)
if nargin==1,m=1;end
nn=length(A); B=A;
for i=1:nn,B(i,:)=A(nn-i+1,:);end
if m==1,  B=[B(:,1) -B(:,2)];end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [coords] = bushing(rr,x0,y0)
d2r=pi/180;
theta=[360:-10:0]*d2r;
r=abs(rr);
rx=r*cos(theta);ry=r*sin(theta);
if rr<0,
rx=rx+x0;
ry=ry+y0;
coords=[rx' ry'];
return;
end;
rx1=rx/2;rx2=-rx1;
ry1=ry/2;ry2=-ry1;
r4=r+r/4;r3=r/3;
bx=[ 0   0 0 -r -r -r4 -r4  r4 r4 -r  r r];
by=[r3 -r3 0  0 -r -r  -r4 -r4 -r -r -r 0];
coords(:,1)=[bx rx rx1 rx2]'+x0;
coords(:,2)=[by ry ry1 ry2]'+y0;

%%%%%%%%%%%%%%%%%%%%%%%%

function [coords]=rotate2D(coord,theta,x0,y0)
th=theta*pi/180;
c=cos(th);s=sin(th);fact=[c s;-s c];
coords=coord*fact;
coords(:,1)=coords(:,1)+x0;
coords(:,2)=coords(:,2)+y0;


執行例

>> move2_rack(10,15,20,10)


齒列與齒輪的互動

第十一章 齒輪(4)--兩齒輪之滾動



10.4 兩齒輪之滾動

若有兩個不同大小之齒輪在不同位置下相互契合,此時之滾動情形可利用下面程式示範。此程式稱為move2_gear.m,其呼叫方式與move2_rack.m幾乎相同。呼叫格式如下:

function move2_gear(Dpitch,nn1,nn2,phi,omega1)



輸入參數之定義如下:

Dpitch:節矩
nn1,nn2:兩齒輪之齒數
phi:壓力角,degrees
omega1: 齒輪1之角速度,rad/s

程式內容


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




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [coords,rp,rb]=one_tooth(Dp,N,phi,range,x0,y0)
% [coords]=draw_gear(Dp,N,phi,range,x0,y0)
% To draw a whole gear
% Inputs:
%     Dp: Diametrial pitch
%     N: no of teeth in a gear
%     phi: pressure angle, degrees
%     range: the section range to be drawn
% Example one_tooth(10,10,20,360)
nn=10;
d2r=pi/180;
phir=phi*d2r;
rp=N/Dp/2;
pc=pi/Dp;
ra=rp+1/Dp;
rb=rp*cos(phir);
rd=rp-1.25/Dp;
thpb=pc/rp;% angle respect to one pitch
tp=pc/2;
rr=linspace(rb,ra,nn)';
invphi=tan(phir)-phir;
for i=1:nn
beta=acos(rp/rr(i)*cos(phir));
tt(i)=(tp/rp/2+invphi-tan(beta)+beta);
end
coord1=[rr.*cos(tt') rr.*sin(tt')];
coord3=reverse(coord1);
th1=linspace(thpb/2,thpb/2-tt(nn),nn)';
coord0=[cos(th1) sin(th1)]*rd;
th2=linspace(tt(nn),-tt(nn),nn)';
coord2=[cos(th2) sin(th2)]*ra;
coord4=reverse(coord0);
coord=[coord0;coord1;coord2;coord3;coord4];
theta=thpb/d2r;
coords=[];i=0;
while i<range
coord1=rotate2D(coord,-i,x0,y0);
coords=[coords;coord1];
i=i+theta;
end

function [B]=reverse(A)
nn=length(A); B=A;
for i=1:nn,B(i,:)=A(nn-i+1,:);end
B=[B(:,1) -B(:,2)];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [coords] = bushing(rr,x0,y0)
d2r=pi/180;
theta=[360:-10:0]*d2r;
r=abs(rr);
rx=r*cos(theta);ry=r*sin(theta);
if rr<0,
rx=rx+x0;
ry=ry+y0;
coords=[rx' ry'];
return;
end;
rx1=rx/2;rx2=-rx1;
ry1=ry/2;ry2=-ry1;
r4=r+r/4;r3=r/3;
bx=[ 0   0 0 -r -r -r4 -r4  r4 r4 -r  r r];
by=[r3 -r3 0  0 -r -r  -r4 -r4 -r -r -r 0];
coords(:,1)=[bx rx rx1 rx2]'+x0;
coords(:,2)=[by ry ry1 ry2]'+y0;

%%%%%%%%%%%%%%%%%%%%%%%%

function [coords]=rotate2D(coord,theta,x0,y0)
th=theta*pi/180;
c=cos(th);s=sin(th);fact=[c s;-s c];
coords=coord*fact;
coords(:,1)=coords(:,1)+x0;
coords(:,2)=coords(:,2)+y0;

執行範例

>> move2_gear(10,15,20,20,10)



11/9/06

行星齒輪組之計算

為計算不同組合之行星齒輪組(參考機動學圖10.22),利用planetary()程式可以直接解各模組之關係,其呼叫格式如下:

function [WF,WA,WL,RV]=planetary(wf,wa,wl,gearset,mode)

其中之參數:

wf, WF:第一輸入軸之角速度,ωF(rad/s)。
wl, WL:最後齒輪軸之角速度,ωL(rad/s)。
wa, WA:旋轉臂之角速度,ωA(rad/s)。
gearset:齒輪之齒數組合(由第二個齒輪算起),列矩陣。
mode: 行星齒輪組之型式代碼(1~12, 參考圖10.22)。


執行上項函式時,輸入wf, wa, wl三個參數中,可容許一個為未知,其未知參數可用[]取代,但不能用0,因為0將認為該軸靜止不動或固定。若不知各組之齒輪數目及搭配之尺寸,則可設gearset=[],程式會自動產生一個例子,可以代入執行。然後再設法修正。程式會自檢測所輸入之組合齒數是否適當,讀者可以自行檢驗。

程式內容:



function [WF,WA,WL,RV]=planetary(wf,wa,wl,gearset,mode)
%Program for section 10.6 to solve Levai's models
% Find angular velocities of sun,arm and planetary
% Variables:
% wf,WF:angular vel. for the 1st input shaft
% wl,WL:angular vel. for the last input shaft
% wa,WA:anbular vel. for the arm shaft.
% gearset:no of gear tooth in row matrix [n1 n2,..]
% mode:types of gear set (1~12, as in Fig. 9.22)
%Note:one of wf, wl & wa can be unknown and replaced by [].
% if leave gearset in [], the program will respond
% an example that matches the specific mode.
% Example:[WF,WA,WL,RV]=planetary(60,1,[],[18 30 28 20],7)
% Designed by D. S. Fon, Bime of NTU, dated March 8,2003
% Revised: March 9, 2006
% preset signs for each set
sinx=[-1 +1 -1 +1 -1 -1 +1 +1 -1 +1 -1 +1];
example={'[15 45 105]','[18 15 12 72]','[30 15 12 18 54]',...
'[30 15 20 20 105]','[80 15 12 30 137]','[40 15 20 75]'...
,'[80 20 40 60]','[100 30 50 120]','[80 15 12 18 12 107]'...
,'[60 30 15 30 15 150]','[40 20 12 20 40 52]',...
'[60 30 12 30 162]'};
WA=0;WF=0;WL=0;RV=0;
gearmin=12;
mode(mode>12)=12;
if isempty(gearset)
disp('Example: ')
example(mode)
return
end
gearset=[mode gearset];
[code,ge]=examset(mode,gearset,gearmin);
switch code
case 2
disp('The last gear size has been modified.')
ge(2:end)
case 3
disp('Error occurs in size matching')
return
end

% set up the no of gears required in the mode.
switch mode
case 1, rv=ge(4)/ge(2)*sinx(1);
case 2, rv=ge(5)/ge(2)*sinx(2);
case 3, rv=ge(4)/ge(2)*ge(6)/ge(5)*sinx(3);
case {4,5}, rv=ge(3)/ge(2)*ge(6)/ge(4)*sinx(mode);
case {6,7,8},rv= ge(3)/ge(2)*ge(5)/ge(4)*sinx(mode);
case {9,10,11},rv= ge(3)/ge(2)*ge(5)/ge(4)*ge(7)/ge(6)*sinx(mode);
otherwise
rv= ge(4)/ge(2)*ge(6)/ge(5)*sinx(mode);
end
if isempty(wa), wa=(rv*wl-wf)/(rv-1);
elseif isempty(wf), wf=rv*(wl-wa)+wa;
else wl=1/rv*(wf-wa)+wa;
end
WA=wa;WF=wf;WL=wl;RV=rv;

function [code,ge]=examset(mode,gearset,gemin)
% Check the proper gear set imported
% set up the no of gears required for a mode.
max_item_no=[4 5 6 6 6 5 5 5 7 7 7 6];
code=1;
%Forcing the minimum required teeth in a gear.
gearset(gearset<gemin)=gemin;
itemmax=max_item_no(mode);
item_no=length(gearset);
if itemmax>item_no,
gearset=[gearset ones(1,12)*12];
gearset=gearset(1:item_no);
end
ge=abs(gearset);
switch mode
case 1, gtmp=ge(2)+2*ge(3);
case 2, gtmp=ge(2)+2*ge(3)+2*ge(4);
case 3, gtmp=ge(2)+2*ge(3)+ge(4)-ge(5);
case 4, gtmp=ge(2)+ge(3)+ge(4)+2*ge(5);
case 5, gtmp=ge(2)-ge(3)+ge(4)+2*ge(5);
case 6, gtmp=ge(2)+ge(3)+ge(4);
case 7, gtmp=ge(2)+ge(3)-ge(4);
case 8, gtmp=ge(2)-ge(3)+ge(4);
case 9, gtmp=ge(2)-ge(3)+ge(4)+ge(5)+ge(6);
case 10, gtmp=ge(2)+ge(3)+ge(4)+ge(5)+ge(6);
case 11, gtmp=ge(2)+ge(3)+ge(4)+ge(5)-ge(6);
case 12, gtmp=ge(2)+2*ge(3)+ge(4)+ge(5);
end
if ge(itemmax)~=gtmp,
ge(itemmax)=gtmp;
code=2;
end
if mode==5|mode==8|mode==9,
if ge(2)<ge(3), code=3;end
end

執行例一:


使用其內部設定之範例,設定mode=3。

>> [WF,WA,WL,RV]=planetary(60,1,[],[],3)
Example:
ans =
'[30 15 12 18 54]'
WF =
0
WA =
0
WL =
0
RV =
0


再將上值代入,執行結果:

>> [WF,WA,WL,RV]=planetary(60,1,[],[30 15 12 18 54],3)
WF =
60
WA =
1
WL =
-48.1667
RV =
-1.2000


執行例二:


如圖10.14及範例10.6所述之型式如圖10.22之第一型,其中N2=15,N3=45,N4=105。若N4內齒輪固定,旋臂(連結N3齒)每轉一圈(即ωA=1),則執行下列指令並得結果如下:

>> [WF,WA,WL,RV]=planetary([],1,0,[15 45 105],1)

WF = 8
WA = 1
WL = 0
RV = -7


執行例三:


如圖10.15及範例10.8設其旋轉臂轉速ωA為1 rad/s,而N2=A20=20,N3=B60=60,N4=D40=40,N5=E120=120,N6=C140=140。由圖10.15可知,本齒輪可由圖10.22中之第一型與第六型綜合。故開始時可利用第一型先求出輸入軸A對應旋轉臂之轉速,然後依第六型求得齒輪E之轉速。即


>> [WF,WA,WL,RV]=planetary([],1,0,[20 60 140],1)
WF = 8
WA = 1
WL = 0
RV = -7


由其結果得到ω2=8 rad/s。其次依第六型求輸出軸E如下:

>> [WF,WA,FL,rv]=planetary(WF,1,[],[20 60 40 120],6)
WF = 8
WA = 1
WL = 0.22222
RV = -9
由其結果得到ωE=0.22222 rad/s。其中WF為利用上式所得的結果。

謝福吉(Selfridge)法

由於齒數需為整數,其最大及最小齒數為Nmax、Nmin,其關係如下:

Nmin=ceil(N2N4VRlow)≤N3N5≤fix(N2N4VRhigh)=Nmax

式中,函數CEIL()表示將取接近數值之高整數;而函數FIX()則取接近數值之低整數。

利用電腦重複測試之能力可以找出合適之齒數,使其值落於Nmax與Nmin之間。
其MATLAB程式函數two_stage_trains()如下:

function [result,counter]=two_stage_trains(rv,nmin,nmax,epx)

此程式處理兩組合齒輪組。輸入參數為:

rv:速度比。
nmin:最低齒數限。
nmax:最高齒數限。
epx:容許誤差。


輸出則為RESULT及counter。前者包括齒輪2及3之齒數,該組之轉速比;齒輪4及5之齒數,該組之轉速比;總轉速比及誤差。counter為計數實際無法達成之次數,程式中每連續試一次無法達到原設定之容許誤差時,誤差值會自動加倍,直到得到較滿意的答案為止。

程式內容

程式10.2

function [RESULT,counter]=two_stage_trains(rv,nmin,nmax,epx)
%
%prog 10.2
% Find the grear teeth for the set of coaxil gear trains
% rv: velocity ratio
% nmax,nmin:max.& min. number of teeths can be used for gears
% epx: error
% RESULT:a row matrix of eight elements, including
% N2 N3 RV1 N4 N5 RV2 RV error
% Example:
% two_stage_trains(pi,15,100,3.1416e-5)
epsx=epx;
counter=0;
[' N2 N3 RV1 N4 N5 RV2 RV 誤差']
ok=1;
while ok,
ss=1;
rv_h=rv+epx; rv_l=rv-epx;
nh3=fix(nmax^2/rv_h);
nh4=fix(nmax/sqrt(rv_h));
for pin1=nmin:nh4
nhh=min(nmax,fix(nh3/pin1));
for pin2=pin1:nhh
tm=fix(pin1*pin2*rv_h);
tn=ceil(pin1*pin2*rv_l);
if tm>=tn
nm=max(nmin,fix((tn+nmax-1)/nmax));
np=sqrt(tm);
for k=tn:tm
for gear1=nm:np
if (mod(k,gear1))==0
gear2=k/gear1;
error=(rv-k/(pin1*pin2));
if error<=epx ratio1=gear1/pin1; ratio2=gear2/pin2; ratio=ratio1*ratio2; result(ss,:)=[pin1,gear1,ratio1,pin2,gear2,ratio2,ratio,abs(error)]; ss=ss+1; end end end end end end end if ss==1 epx=epx*2; counter=counter+1; else ok=0; end end RESULT=sortrows(result,8);


執行例:


設計一同軸複式齒例,其轉速比為π,最高齒數為100齒,最低為15齒,容許誤差為e-5π。執行two_stage_trains()函式,結果如下:


>> a=two_stage_trains(pi,15,100,3.1416e-5)
ans =
N2 N3 RV1 N4 N5 RV2 RV 誤差
a =
25 51 2.04 50 77 1.54 3.1416 7.3464e-006
29 88 3.0345 85 88 1.0353 3.1416 1.0503e-005
22 62 2.8182 61 68 1.1148 3.1416 1.2922e-005
33 68 2.0606 61 93 1.5246 3.1416 1.2922e-005
43 77 1.7907 57 100 1.7544 3.1416 1.7786e-005
28 85 3.0357 86 89 1.0349 3.1416 1.8642e-005
43 85 1.9767 56 89 1.5893 3.1416 1.8642e-005
23 75 3.2609 82 79 0.96341 3.1416 2.3194e-005
41 75 1.8293 46 79 1.7174 3.1416 2.3194e-005
17 54 3.1765 91 90 0.98901 3.1416 2.8336e-005
17 60 3.5294 91 81 0.89011 3.1416 2.8336e-005
16 63 3.9375 94 75 0.79787 3.1416 2.9687e-005
32 63 1.9688 47 75 1.5957 3.1416 2.9687e-005

經過排序之結果,誤差最小之組合為:

N2:N3=25:51, N4:N5=50:77。

共軸齒列之計算

題意:


設計一組共軸齒列,其減速比VR=18。

做法:

  • 1. 雖然VR不一定為整數,但若為整數則會使解題更為簡化。
  • 2. 將VR=18開平方,得4.2426,其值小於每組合應低於10之限制,故可使用兩組合串列的方式,構成一齒列。
  • 3. 若能找到將一組正好等於4.2626之轉速比時即可使用雙組同比值的方式,其軸距即可相同,並符合共軸之條件。其步驟是先以小齒輪最低齒數12開始,相乘之,利用MATLAB指令可計算如下:


>>VR=18;  %整組之轉速比設為18。
>>mr=sqrt(VR); %以開方先取得單組轉速比估計值。得mr=4.2426。
>>T1=[12:40]’; %先設定驅動輪由12齒開始至40齒可能範圍,行矩陣。
>> T2=round(T1.*mr); %以估計值計算被動齒輪之齒數。
>>VR2=(T2./T1).^2; %計算實際之總轉速比。
>>Diff=(VR2-VR)/VR*100;%求其誤差百分比。
>>[T1 T2 VR2 Diff] %列出相關值

ans =
12.0000 51.0000 18.0625 0.3472
13.0000 55.0000 17.8994 -0.5588
14.0000 59.0000 17.7602 -1.3322
15.0000 64.0000 18.2044 1.1358
16.0000 68.0000 18.0625 0.3472
17.0000 72.0000 17.9377 -0.3460
18.0000 76.0000 17.8272 -0.9602
19.0000 81.0000 18.1745 0.9695
20.0000 85.0000 18.0625 0.3472
21.0000 89.0000 17.9615 -0.2142
22.0000 93.0000 17.8698 -0.7231
23.0000 98.0000 18.1550 0.8612
24.0000 102.0000 18.0625 0.3472
25.0000 106.0000 17.9776 -0.1244
26.0000 110.0000 17.8994 -0.5588
27.0000 115.0000 18.1413 0.7849
28.0000 119.0000 18.0625 0.3472
29.0000 123.0000 17.9893 -0.0595
30.0000 127.0000 17.9211 -0.4383
31.0000 132.0000 18.1311 0.7284
32.0000 136.0000 18.0625 0.3472
33.0000 140.0000 17.9982 -0.0102
34.0000 144.0000 17.9377 -0.3460
35.0000 148.0000 17.8808 -0.6621
36.0000 153.0000 18.0625 0.3472
37.0000 157.0000 18.0051 0.0284
38.0000 161.0000 17.9508 -0.2732
39.0000 165.0000 17.8994 -0.5588
40.0000 170.0000 18.0625 0.3472


其中第一行為驅動軸由12齒至40齒之變化;第二行為轉速比維持4.2626時之被動輪齒數(整數);第三行為實際計算之轉速比;最後一行為計算誤差百分比。就所得之值觀察,T1=12之誤差為0.3472%,差強人意。最小者為T1=33,其誤差為-0.0102%,不過被動輪為140齒,顯然嫌大些。

  • 4. 採用18之質因數,並將兩組合設成不同轉速比。在每組VR值不超過10之情況下,其可能集合有[9X2]、[6X3]等兩種。在齒輪組的考慮中應選齒數較不懸殊的組合,故取[6X3]。
  • 5. 設兩組速度比之組合為[6X3]。原則上小齒輪應不小於12齒,故所選的組合必須乘一個係數。至於選取何係數,兩個組合可以不同。

共軸齒列之計算

共軸齒列之計算可利用MATLAB程式函數coaxial_trains(),其如下:

function coaxial_trains(rv,n2,n3,teeth_limit,pitch_list)


輸入參數:

rv:速度比。
n2,n3:第一齒輪組合之齒數。
teeth_limit:所選齒輪之最低齒數。
pitch_list:可被選用之齒輪周節選單。



程式內容(10.1)



function coaxial_trains(rv,n2,n3,teeth_limit,pitch_list)
%
%prog 10.1
% pitch_list is a row vector for listing pitches of gears
% rv: velocity ratio
% teeth_limit:number of teeth limit for gears
% n2,n3: no. of teeth for the first pair gears
% Example:
% pitch_list=[1:.25:2,2.5,3,3.5,4:2:18,20:4:56]
% coaxial_trains(10,20,30,15,[1:.25:2,2.5,3,3.5,4:2:18,20:4:56])
nlist=length(pitch_list);
fact=n3/n2/rv;
[' N4 N5 Pd2 Pd4']
for i=1:nlist
pd2=pitch_list(i);
for j=1:nlist
pd4=pitch_list(j);
for k=teeth_limit:200
n4=k;
n5=n4/fact;
n4f=(n2+n3)/(1+1/fact)*(pd4/pd2);
if fix(n5)==n5 & abs(n4f-n4)<0.1
[n4,n5,pd2,pd4]
end
end
end
end


執行例:


設RV=10,N2=20,N3=30 及 最低齒數=15,求其可能之組合。

>> coaxial_trains(10,20,30,15,[1:.25:2,2.5,3,3.5,4:2:18,20:4:56])
ans = N4 N5 Pd2 Pd4
ans = 87 580 1.5 20
ans = 174 1160 1.5 40
ans = 15 100 1.75 4*
ans = 87 580 3 40
ans = 15 100 3.5 8*
ans = 24 160 12 44*
ans = 15 100 14 32*
ans = 18 120 16 44*

上述中徑節比較接近的如具星號的組合。程式之輸入項中,pitch_list為業界所使用之可能徑節。

漸開線函數

漸開函數可以查表或由計算程式中得知,而計算齒厚時,可以利用這一個漸開函數計算。用MATLAB之ainv()函式可以得到相對的答案,其呼叫格式如下:

function [epsilon, epsrad]=ainv(z)

其中,z為漸開函數值,得到之對應角度Φ為epsilon, epsrad,分別以度數及弧度表示。

function [epsilon, epsrad]=ainv(z)
% Find the inv funtion of involute angle.
% Using Secant's method.
% Input: z:(<2.2)
% outputs:epsrad, angle in radians
% epsilon: angle in degrees.
e1=0.63166;z1=0.1;
e2=0.97502;z2=0.5;
ok=0;
while ~ok
e0=(z-z1)/(z2-z1)*(e2-e1)+e1;
z0=tan(e0)-e0;
if abs(z0-z)<1e-6;
break;
else
if z0>z2
z2=z0;e2=e0;
else
z1=z0;e1=e0;
end
end
if abs(z2-z1)<1e-6; break; end
end
epsrad=e0;
epsilon=epsrad*180/pi;


執行例:



>> [ep,eprad]=ainv(0.1)
ep = 36.191
eprad= 0.63166
>> [ep,eprad]=ainv(1)
ep= 64.874
eprad = 1.1323

接觸比之計算

公式9.25是接觸比之計算過程,可以用MATLAB函式contact_ratio()得到結果。此函式之輸入值為徑節、兩齒輪之齒數及壓力角,輸出項包括公式9.26至公式9.32所計算之結果。其中之參數ag為列矩陣,依序儲存兩齒輪之接近角、退遠角與作用角。其呼叫格式如下:

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];


執行例一:


某對齒輪之周節為4,分別有24及48齒,其壓力角為20度,求其接觸比及相關資料。

>> [c_ratio, c_length,ad,pc,pb,r2,r3,ag]=contact_ratio(4,20,30,20)
c_ratio = 1.6052
c_length = 1.1847
ad = 0.2500
pc = 0.7854
pb = 0.7380
r2 = 5
r3 = 7.5000
ag =14.8816 14.0115 28.8932
9.9211 9.3410 19.2621


所得之資訊如下:

接觸比=1.6052
接觸長度=1.1847 吋
齒冠=0.25吋
周節pc=0.7854;基周節pb=0.7380
齒輪節圓直徑r2=5吋, r3=7.5吋
齒輪2之接近角=14.8816度;遠退角=14.0115度
作用角=28.8932度
齒輪3之接近角=9.921度;遠退角=9.3410度
作用角=19.2621度


執行例二:


某對齒輪之周節為5,分別有20及30齒,其壓力角為20及25度,求其接觸比及相關資料。

>> [c_ratio, c_length,ad,pc,pb,d2,d3,ag]=contact_ratio(5,20,30,[20 25]')
c_ratio =
1.6052
1.4419
c_length =
0.9477
0.8211
ad =
0.2000
pc =
0.6283
pb =
0.5904
0.5694
d2 =
4
d3 =
6
ag =
14.8816 14.0115 28.8932
13.2629 12.6921 25.9550
9.9211 9.3410 19.2621
8.8419 8.4614 17.3033


指令中,壓力角之輸入以行型式輸入(即[20 25]' ),其結果亦以行之型式對應出現。其他變數亦可如此作對照。這種比較不限1X2行矩陣,也不限於僅使用於一個輸入變數,但需同大小之矩陣。若不需要後面之輸出項,則僅提及前面所需之項目即可。讀者可自行印證不同變數矩陣之應用,若使用矩陣輸入,以採用行向量型式為宜。

外接錐之錐角比計算

兩外錐相接,其公式如下(參閱機動學公式9.9):

tanγ3= sinΣ / [ω32 + cosΣ]

若改用電腦程式計算,其程式如下(其中參數mode=1表示外錐;mode=-1表示內錐)::

function [gama1,gama2]=bevel_angle(omega,sigma,mode)
%
% Demo9.1:
% [gama1,gama2]=bevel_angle(omega,sigma,mode)
% mode:1 for outer set; -1 for innner set
% sigma: combined angle, degrees
% omega: angular velocity ratio=w1/w2, decimal
% gama1: cone angle for gear 1, degrees
% gama2: cone angle for gear 2, degrees
% Examples:[gama1,gama2]=bevel_angle([1 2 3 4 5],45,1)
d2g=pi/180;
sa=sigma*d2g;
gama1=atan(sin(sa)./(omega+mode*cos(sa)))/d2g;
gama2=sigma-mode*gama1;

-------------------------------------------

執行例一:


作一轉速比ω2 :ω3 = 5:3比例之圓錐,設合錐角Σ為60度,其MATLAB之程式如下:
ω12 =5/3;Σ=60;

>> [gama1,gama2]=bevel_angle(5/3,[60],1)
gama1 = 21.7868
gama2 = 38.2132

執行例二:


ω12=5/3;Σ=[60 50 40 30];


>> [gama1,gama2]=bevel_angle(5/3,[60 50 40 30],1)
gama1 = 21.7868 18.3506 14.8008 11.1676
gama2 = 38.2132 31.6494 25.1992 18.8324


若改為內錐外錐相接,其公式更動如下(參閱機動學公式9.10):

tanγ3= sinΣ / [ω32 - cosΣ]


執行例三:


ω1 /ω2 =7/3;Σ=[ 30];內接錐


>> [gama1,gama2]=bevel_angle(7/3,[30],-1)
gama1 = 18.8171
gama2 = 48.8171


執行例四:


ω1 /ω2 =[7/3 5/3 4/3]7/3;Σ=[ 30];內接錐


>>[gama1,gama2]=bevel_angle([7/3 5/3 4/3],[30],-1)
gama1 = 18.8171 31.9848 46.9357
gama2 = 48.8171 61.9848 76.9357

11/8/06

凸輪從動件升程之計算

範例8.1


某凸輪開始時先在0-120∘區間滯留,其高度為零。升程落於120-180∘,並於180-210∘滯留,其總升程為8公分。設刻度區間為10∘,凸輪則以等角速度旋轉,且其升程與返程均採用等加速度運動。求其變化曲線。

由機動學課本中之演繹,可以針對升程(Demo8.1)與返程( Demo8.2)計算結果如下:

% Demo8_1
% 計算升程對應點之資料:位移,速度及加速度
theta=120:10:180;
for i=1:length(theta)
[ss(i), vv(i), aa(i)]=parabol_cam(theta(i),120,60,1,8,0);
end;
%(theta:對應角度; ss:位移, vv:速度, aa:加速度)
[theta' ss' vv' aa']

執行結果:

>> demo8_1
ans =
120.0000 0 0 29.1805
130.0000 0.4444 5.0930 29.1805
140.0000 1.7778 10.1859 29.1805
150.0000 4.0000 15.2789 -29.1805
160.0000 6.2222 10.1859 -29.1805
170.0000 7.5556 5.0930 -29.1805
180.0000 8.0000 -0.0000 -29.1805


返程之計算程式如下:

% Demo8_2
% 計算返程對應點之資料:位移,速度及加速度
theta=210:10:360;
for i=1:length(theta)
[ss(i), vv(i), aa(i)]=parabol_cam(theta(i),210,150,-1,8,0);
end;
%(theta:對應角度; ss:位移, vv:速度, aa:加速度)
[theta' ss' vv' aa']


執行結果:

>> demo8_2
ans =
210.0000 8.0000 0 -4.6689
220.0000 7.9289 -0.8149 -4.6689
230.0000 7.7156 -1.6297 -4.6689
240.0000 7.3600 -2.4446 -4.6689
250.0000 6.8622 -3.2595 -4.6689
260.0000 6.2222 -4.0744 -4.6689
270.0000 5.4400 -4.8892 -4.6689
280.0000 4.5156 -5.7041 -4.6689
290.0000 3.4844 -5.7041 4.6689
300.0000 2.5600 -4.8892 4.6689
310.0000 1.7778 -4.0744 4.6689
320.0000 1.1378 -3.2595 4.6689
330.0000 0.6400 -2.4446 4.6689
340.0000 0.2844 -1.6297 4.6689
350.0000 0.0711 -0.8149 4.6689
360.0000 0.0000 -0.0000 4.6689

五連桿齒輪解析

機動學中之公式7.30形成一矩陣,經簡化為:AW=C之型式。再以MATLAB指令W=A\C解出桿3、4、5之角速度。程式內容參見f5link()。其中之呼叫參數說明如下:

function [omega,theta,incta]=f5link(r1,R2,R4,r5,theta2,omega2)


輸入:r1、r5為第一(地桿)及第五桿之長度。
R2、R4為成對之齒輪半徑。
   omega2為桿2之驅動角速度,rad/s。
   theta2各桿2之對應角度。
輸出:omega為桿2、3、4、5之角速度。
   theta為桿2、3、4、5之水平角度。
   Incta為桿3與桿4成一直線時,桿3、4、5之初始角度。

利用下面之程式可以直接進行求解:


function [omega,theta,incta]=f5link(r1,R2,R4,r5,tha2,w2)
% Program 7.2
% Solve the angular velocities of a 5-link system
% Input:
% r1,r5: the length of ground and the 5th links.
% R2,R4: radius of the gear pair%
% tha2: angular position of link 2, degrees
% w2: angular velocity of link 2, rad/s
% Output:
% omega:the ang. velocitis of links, rad/s
% theta:the angles of links, degrees
% incta:initial positions of links, degrees
% omega=[omega3 omega4 omega5], in rad/s
% Example [omega,theta,incta]=f5link(8,3,3.5,6,60,10)
d2r=pi/180;th2=tha2*d2r;
r3=R2+R4;
if r3+r5<=r5,
theta='Not available';
incta=0;
return
end
r34=r3+R4;
cos5=(r34*r34-r5*r5-r1*r1)/(2*r1*r5);
cos3=(r1+r5*cos5)/r34;
th50=acos(cos5);
th30=acos(cos3);th40=th30;
incta=[th30 th40 th50]/d2r;
%============================================
% To solve the angular position of each links
rr=R4/R2;
func_1=1; func_2=1;
% Force next WHILE statement to be true
th5=th50;th4=th40;
while abs(func_1)>0.01 | abs(func_2)>0.01,
% Evaluate loop equations
th3=th30+(th2+rr*(th4-th40))/(1+rr);
func_1=r3*cos(th3)+R4*cos(th4)-r5*cos(th5)-r1;
func_2=r3*sin(th3)+R4*sin(th4)-r5*sin(th5);
F=[-func_1; -func_2];
% Evaluate partial derivatives
A=[-r3*sin(th3)*rr-R4*sin(th4) r5*sin(th5);...
r3*cos(th3)*rr+R4*cos(th4) -r5*cos(th5)];
% Solve 2 equations in 2 unknowns with Cramer's rule
delta=A\F;
% Make new guess for both theta3 and theta4
th4=th4+delta(1);
th5=th5+delta(2);
end;
theta=[0 th2 th3 th4 th5]/d2r;
%============================================
% Calculate the angular velocities of links
% Set up the 3x3 maxtrix A
A=[-r3*sin(th3) -R4*sin(th4) r5*sin(th5);...
r3*cos(th3) R4*cos(th4) -r5*cos(th5);...
1+rr -rr 0];
C=[0 0 w2]';
W=A\C; %Matrix division, or solution of AW=C
omega=[w2,W'];



執行例一:


設 r1=8 cm、R2=3 cm、R4=3.5 cm、r5= 6cm,θ2= 60度,ω2=10 rad/s

>> [w,theta,incta]=f5link(8,3,3.5,6,60,10)
w =   10.0000 2.7194 -3.5211 1.8456
theta = 0 60.0000 52.1875 13.8419 95.8522
incta = 36.8699 36.8699 90.0000


故ω3=2.7194 rad/s,ω4= -3.5211 rad/s, ω5= 1.8456 rad/s

執行例二:


設r1=50 cm、R2=12 cm、R4=14 cm、r5= 50cm,θ2= 30度,ω2=10 rad/s

>> [omega ,theta,incta]=f5link(50,12,14,50,30,10)
omega = 10.0000 2.4549 -4.0123 0.4351
theta = 0 30.0000 73.5832 54.0023 133.5048
incta =   66.4218 66.4218 132.8436


故ω3= 2.4549 rad/s,ω4=-4.0123 rad/s, ω5= 0.4351 rad/s

本程式中,實際上綜合f5link_init()函式之內容,並進行作位置解,將公式7.18及7.19利用疊代法求得各桿之對應角度。其後再利公式7.30之矩陣除法求得各桿之角速度。在求解過程中,桿2之角度及角速度均必須為已知值。

齒輪組構成之五連桿分析

下面為利用MATLAB撰寫之程式函式f5link_int(),以計算一組齒輪構成之五連桿(參閱機動學範例7.1),其齒輪2與4之直徑分別為6、7cm。其他桿之相關尺寸為r1=8cm,r5=6cm。齒輪2為驅動輪。在初始位置時ABC正好成一直線,設桿2角度之初始值為零。當桿2旋轉60度角時,其他相關之θ3、θ4、θ5值之變化可由f5link_int()程式求得,其呼叫型式為:

function [th3,th4,th5]=f5link_int(r)


其輸入項為r。其中包括五桿之長度,其中第二桿為驅動齒輪之半徑r2。

function [th3,th4,th5]=f5link_int(r1,R2,R4,r5)
% Program 7.1 solving eqs 7.11-7.17
% The 5 link system consists of 2 gears with one
% holding link(r5), except the ground(r1)
% Find the intial positions of the 5-link system
% Input:
% r1,r5: the length of ground and the 5th links.
% R2,R4: radius of the gear pair
%
% Output:
% th3,th4,th5: angles of link 3,4 & 5, degrees
% Example: [th3,th4,th5]=f5link_int(8, 3, 3.5, 6)
d2r=pi/180;
r3=R2+R4;
r34=r3+R4;
cos5=(r34*r34-r5*r5-r1*r1)/(2*r1*r5);
cos3=(r1+r5*cos5)/r34;
th50=acos(cos5);
th30=acos(cos3);
th3=th30/d2r;th4=th3;th5=th50/d2r;

執行例:

>> [th3,th4,th5]=f5link_int(8, 3, 3.5, 6)
th3 = 36.8699
th4 = 36.8699
th5 = 90