5/17/07

第十一章 齒輪(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