Google Answers Logo
View Question
 
Q: Polar coordinate function to define spur gear shape ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Polar coordinate function to define spur gear shape
Category: Science > Math
Asked by: gw-ga
List Price: $5.00
Posted: 07 Jul 2002 11:09 PDT
Expires: 06 Aug 2002 11:09 PDT
Question ID: 37323
I am in search of a simple algorithm for writing a function that would
aid in plotting simple spur gear outlines.

Inputs to the function would include (at a minimum) the pitch radius,
number of teeth, and an angle; output would be the radius from the
center of the gear to a point on its perimeter as defined by the
angle.  I would call this function many times to build up a list of
polar coordinates to draw the outline.

I am aware that some other inputs may be needed, as gear geometry can
be complicated.  The only requirement I have is that gears of various
sizes will mesh together correctly.

I am aware that there exists complex software to design and model
gears.  Please do not refer me to those packages; I am looking for an
actual algorithm so that I can implement it myself.

Request for Question Clarification by calebu2-ga on 18 Jul 2002 10:50 PDT
Do you want the function for any specific type of gear, or would you
be OK if I just gave you the function for an involute gear (defacto
standard gear shape)?

Clarification of Question by gw-ga on 18 Jul 2002 12:56 PDT
The involute gear/"defacto standard gear shape" should be adequate for my needs.
Answer  
Subject: Re: Polar coordinate function to define spur gear shape
Answered By: calebu2-ga on 19 Jul 2002 08:50 PDT
Rated:5 out of 5 stars
 
gw,

People have written whole books on the geometry of gears, so anything
I give you here is very much a cut down lecture on gear geometry.
Material online, as usual varies in quality and is hard to search
through - although I was able to find some of the equations you wanted
online, the only place I could find decent descriptions of gear math
was in library textbooks I had close at hand.

In case you want more than just the formulae, might I refer you to an
excellent book by Dooner and Seireg "The Kinematic Geometry of
Gearing" (ISBN 0-471-04597-7) which tells you far more about gears
than most would ever want to know, but lays it out logically and
concisely.

Your question said that you just wanted a function, so I won't waste
too much time going over any more math except to say that for the sake
of my answer I will focus on the involute gear which is one of the
three basic toothing designs used. (The others being Cycloidial and
Circular-arc).

The Involute gear is based on the involute curve (no surprise there)
and is the easiest of the three to parameterize and also fairly easy
to work out forces and stresses on. That said, it is not the most
efficient gear, is prone to poor lubrication and has a high pressure
angle (it's going to break fast).

Here's where I am copying the basic equations from (it also has info
on cutting techniques if you are going to pass the information to a
computerized lathe) :

http://www.qtcgears.com/Q410/QTC/Q410P345.htm
http://www.geartechnology.com/mag/archive/0502/pro.pdf

The function is a lot easier to describe if I give you a function that
takes all the relevant parameters, a parameter t and gives you back
the radius, r and angle theta as an output.

To get the answer in the form you want (theta as an input), you need
to invert the theta function (which cannot be done analytically -
technically, it is the inverse of the involute function).

Inputs:
not = number of teeth

pangle = pressure angle (slope at the point where gears touch

m = module

x = correction factor of gear

od = outer diameter

rd = root diameter (1/2 of the distance between 2 gears of the same
size)

First you need the function that gives you the shape of half a gear
tooth - rtooth and thetatooth (Note thetatooth is in degrees, so if
your cos and tan functions work in radians, you need to insert a "*
Pi/180" into each of them) :

pcd = not*m

bcd = pcd*cos(pangle)

rbase = bcd/2

tt = (((3.141592654)*m)/2) + (2*m*x*tan(pangle))

k = bcd*((tt/pcd) + ((tan(pangle) – ((pangle *(3.141592654)))/180)))

gamma = (((bcd*(3.141592654)) – (not*k))/(not*2)) *(360/(bcd
*(3.141592654)))

rtooth = rbase/(cos(t*40))

inv = tan(t*40) – (((t*40) *(3.141592654))/180)

thetatooth = (((inv*180) /(3.141592654))+ gamma)

z = 0

(some of these functions are irrelevant for your needs, but the
geartechnology.com article describes their use).

Then what you need are composite functions r and theta that repeats
this pattern not (number of tooth) times, with r = rbase when not
drawing a tooth.

Such a pair of functions would look something like this :

r(ttt) = rtooth(ttt Modulo 1) for theta(ttt) defined below.

r = rbase for theta not defined by ttt below

theta(ttt) = Int(ttt/2) * gamma + thetatooth(ttt Modulo 1) for
Int(ttt) even

theta(ttt) = Int(ttt/2) * gamma - thetatooth(ttt Modulo 1) for
Int(ttt) odd

ttt varies from 0 to 2 * not (number of teeth).

This should help you - it's not an easy task to plot by any means -
Sorry that there isn't a single 1 line "r = f(theta,parameters)" that
I can give you - but if the programming language/CAD package allows
you to build functions out of subfunctions, you should be all set.

Enjoy,

calebu2-ga

Google search items:

involute function gear
involute equation gear teeth
cycloidial function gear
circular-arc function gear

Request for Answer Clarification by gw-ga on 20 Jul 2002 09:18 PDT
Hello,

I appreciate your effort in finding these equations!

I've translated them to Delphi / Object Pascal code and can see that
I'm close to having it working.

Using the sample input parameters direct from the magazine article, my
plot currently looks like this:

http://www.gw.ro/GearTestPlot.jpg

My trig functions work with angles in radians, but until I get the
plot completely working I did not want to obscure the equations by
converting back to degrees.  So, I created _Sin, _Cos, and _Tan
functions which work with degrees instead.  I'll clean up the code
later so it all works with radians.

Here's how the nested procedure looks, that finds R, Theta, and Gamma
for a given input T:

procedure Foo(const T: Double;
              out RTooth: Double;
              out ThetaTooth: Double;
              out Gamma: Double);

var
  PCD: Double;
  BCD: Double;
  RBase: Double;
  TT: Double;
  K: Double;
  Inv: Double;

begin
  PCD := _Not * M;
  BCD := PCD * _Cos(Pangle);
  RBase := BCD / 2;
  TT := (((Pi) * M) / 2) + (2 * M * X * _Tan(PAngle));
  K := BCD * ((TT / PCD) + ((_Tan(PAngle) - ((PAngle * (Pi))) /
180)));
  Gamma := (((BCD * (Pi)) - (_Not * K)) / (_Not * 2)) * (360 / (BCD *
(Pi)));
  RTooth := RBase / (_Cos(T * 40));
  Inv := _Tan(T * 40) - (((T * 40) * (Pi)) / 180);
  ThetaTooth := (((Inv * 180) / (Pi)) + Gamma);
end;

Here's the calling procedure:

procedure PlotGear;

var
  I: Integer;
  RTooth: Double;
  Theta: Double;
  ThetaTooth: Double;
  Gamma: Double;
  TTT: Double;
  X: Double;
  Y: Double;

begin
    for I := 0 to 2 * _Not * 100 do
      begin
      TTT := I / 100;

      Foo(Frac(TTT), RTooth, ThetaTooth, Gamma);

      if (Odd(Trunc(TTT))) then
        Theta := Trunc(TTT / 2) * Gamma - ThetaTooth
      else
        Theta := Trunc(TTT / 2) * Gamma + ThetaTooth;

      X := XCenter + RTooth * _Cos(Theta);
      Y := YCenter + RTooth * _Sin(Theta);

      if (Frac(TTT) = 0) then
        Plotter.MoveTo(X, Y)
      else
        Plotter.LineTo(X, Y);
      end;
end;


Here, Frac(TTT) returns the decimal portion of TTT, while Trunc(TTT)
returns the whole number portion.

I is the step number; the multiplication and division by 100 should
give me 100 steps along each side of each tooth.

I think the problem lies in the calling procedure, which doesn't know
when to use R = RBase.  Also, the separation between teeth seems to be
hosed.

Any ideas for addressing that problem?

Thanks for your time...

Clarification of Answer by calebu2-ga on 21 Jul 2002 13:50 PDT
gw,

Sorry for the delay getting back to you - Just to let you know I am
working on the correct location of the individual curves - the teeth
profiles seem to be correct in your diagram, just the location of the
teeth isn't correct. I think it is something to do with the
translation between degrees and radians, and an incorrect value for
gamma (which is the angle between teeth).

I'll let you know when I have a reply, but wanted you to know that I
am working on it.

calebu2

Clarification of Answer by calebu2-ga on 22 Jul 2002 11:41 PDT
gw,

I've been taking another look at those equations from the website and
have come to a couple of conclusions.

1) I should have told you to add (n * 360/not) to theta rather than n
* gamma). This would ensure that the teeth are equally spaced around
the circle and solve 1 part the problem in your diagram.

2) The formulae for theta and rtooth do not take into account the
number of teeth used. Surely the more teeth there are, the narrower
the angle that is subtended by a tooth (theta(1) - theta(0)).

3) I get the impression that if you cut off the teeth where they cross
over, you get the desired effect.

Here's my updated program, written in S-Plus :

teeth <- 46
pangle <- pi*(20/180)
m <- 3
x <- 0.55
od <- 146.7
rd <- 133.8

pcd <- teeth*m
bcd <- pcd*cos(pangle)
rbase <- bcd/2
tt <- ((pi*m)/2)+(2*m*x*tan(pangle))
k <- bcd*((tt/pcd)+((tan(pangle)-pangle)))
gamma <- ((bcd*pi) - (teeth*k))/(teeth*bcd)

r <- function(ttt) { rbase/cos(ttt*40*(pi/180)) }
inv <- function(t) { tan(t*pi*(40/180)) - (t*pi*(40/180)) }
theta <- function(n,t) { inv(t) + (n * 2*pi/teeth)}
theta2 <- function(n,t) { 2*thetamax - inv(t) + (n * 2*pi/teeth) }
theta3 <- function(n,t) { 2*thetamax + 2 * t * (pi/teeth - thetamax) -
(n * 2*pi/teeth) }

maxfun <- function (t) {r(t) -r(0) - (od-rd)/2}
tmax <- uniroot(maxfun, c(0,1))$root
tvals <- seq(0,tmax,,100)

thetamax <- theta(0,tmax)
rvals <- rep(c(r(tvals),r(tvals),rep(r(0),100)), teeth)
thetavalfun <- function(n) { c(theta(n, tvals), theta2(n,tvals),
theta3(n,seq(0,1,,100))) }
thetavals <- c(apply(matrix(1:teeth,teeth,1), 1, thetavalfun))

xvals <- rvals * cos(thetavals)
yvals <- rvals * sin(thetavals)
plot(xvals, yvals, pch=".")

I get the following output : http://www2.bc.edu/~lawrenst/gear.jpg

What I've done is find the value tmax at which the two arcs cross and
told it to stop plotting at that point.

I've also found thetamax, which is the angle subtended by half a
tooth. r = r(0), theta3(0,t) plot out the base circle in between
teeth.

Hope this helps - sorry I couldn't write your answer in pascal.

calebu2-ga

Request for Answer Clarification by gw-ga on 25 Jul 2002 19:55 PDT
I appreciate the effort you put into elaborating on the gear
equations, and I apologize that I haven't had the time to look at them
in detail.

I noticed in your plot, the gear doesn't look like it would mesh
properly with another, identical gear.  Compare this with the three
renderings from the magazine article you cited, which shows the tips
of the gear's teeth as being blunt.

Clarification of Answer by calebu2-ga on 02 Aug 2002 07:31 PDT
Hi gw,

Sorry for taking so long in getting back to you. I've been trying to
clarify with the Google team what the best way to proceed with this
question is.

Here's where we stand :
* I've found some equations that plot out gears and modified them so
that they almost work
* Not every combination of gear radius, tooth density and so on
produces a nice looking gear. i think my equations are fundamentally
correct, however there is a final equation which describes the
relationship between the various inputs to produce nice smooth
intermeshing gears.
* I am not able to figure out what that equation is (I put a fair
amount of time into reading through the texts). It seems that most
engineers are more concerned about creating gears in the following way
: for CAD programs they want an equation that plots out the shape of
half a tooth, they then copy and paste that around in a CAD program
like the PRO/E system mentioned in the article. For actual gear
creation, they are more interested in the equations that describe the
cutting arc used by a mechanical lathe to create said gears.

Anyway, I do not think I can provide a definitive answer to your
question - Google Answers does not provide a way for me to withdraw my
answer or put it as a comment for some other researcher to have a shot
at. I would rather have the opportunity to withdraw gracefully from
this question than to receive a bad rating / question rejection on my
record - so I have spent the time since your last clarification
request trying to find out what options are available. I'm going to
resend the Google team an email today, but I really wanted to give you
a heads up to let you know why I wasn't responding immediately.

Kind Regards

CalebU2-ga

Request for Answer Clarification by gw-ga on 02 Aug 2002 09:09 PDT
I have no intention of leaving negative feedback -- if anything,
you've gone way out of your way to try to answer this.  I'd be
perfectly happy to pay you the $5 and then re-list the question.

Clarification of Answer by calebu2-ga on 02 Aug 2002 10:00 PDT
OK. If you're happy with the answer as far as it goes. If you are
going to relist the question, I would make reference to this question
so that other researchers know what ground has been covered already.
Let me know if there is anything else i can help with.

One thing that could solve your problem is to find the equation that
describes the height of teeth on a rack (flat) gear. I'm pretty sure
that this has to be the case that if you use that as the modulation to
the radius of a gear - and figure out how the angle changes with
relation to the horizontal distance travelled along the rack gear -
you should have the curve you are looking for. Alas, I didn't find
anything along those lines either (must be some kind of giant gear
conspiracy keeping the true equations out of textbooks and websites :)

calebu2-ga

P.S. I was wondering about providing a link to lego.com - their
technic lego gears always mesh perfectly - and they come in all shapes
and sizes :)
gw-ga rated this answer:5 out of 5 stars
Calebu2-ga put a lot of effort into this.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy