Online Involute Spur Gear Builder v2

Version 2.0 of my online involute spur builder is available now: Online Involute Spur Gear Builder v2. It is a complete rewrite of version 1 which was introduced 2014 (part1, part 2).

Version 2 creates higher quality output without ragged edges at higher speed. Like before, undercuts as needed for small tooth counts are correctly handled; clearance, backlash, and profile shift are fully supported.

As an extreme case the image on the left shows a 12 tooth gear meshing with a 5 tooth pinion (tool link). Notice the extent of the undercut. The image on the right (tool link) shows the same gears but this time with profile shift applied. The profile shift considerably strengthens the pinion gear teeth.

Without profile shift Involute gears with undercut and profile shift.

The key differences of v2 compared to v1 are:

  • Modern SVG output
  • Higher quality output (no ragged edges) without excessive segment counts. No more need to fiddle with quality parameters.
  • Significantly faster than v1 at any acceptable quality levels
  • Parameters are automatically injected in the URL; i.e., the URL fully specifies the output and can be shared with others.
  • Corrected internal gear generation (e.g., clearance is properly applied)

In case you are interested in how the gear shapes are created, the first post that introduced version 1 is a good start. Then this pdf document provides more detail about how v2 accomplishes the smooth curves that v1 struggled with. Internal gears are particularly challenging in this regard. Here is just a teaser:

Internal Gear Shape Creation

Online Grasshopper Escapement Builder

For the impatient: Just head over to the Online Grasshop Escapement Builder page.

This open source Grasshopper Escapement Builder is based on the description published by Guy D. Aydlett: The Anatomy Of The Grasshopper (the pdf file has been shared by jrbeal on his clock forum). I am aware of shared spreadsheets that implement the equations but as far as I know this is the first online tool that generates Grasshopper escapement drawings.

Here are two sample outputs showing the exit pallet facing left (first drawing) and right (second drawing) based on different values for the pallet span N (5 and 9 for the left and right drawing, respectively).

I am very happy that Claire Huang allowed me to feature her 3d printed escapement which is based on my online escapement builder:

Online Lantern Gear Builder

I implemented an online lantern gear builder to complement my other online gear generators.

The gear meshing with the lantern gear is created by tracking how the lantern gear pins cut into the disk of the matching gear. As an example, the image on the right shows the path of one lantern pin moving clockwise into the 3 o’clock position. The same circles, pinned to the matching gear, create the shape of a half tooth as the matching gear turns counterclockwise at a speed defined by the gear ratio. (I use the same mechanism for the involute spur gear builder).

The complete list of gear builders is:

Online Involute Spur Gear Builder – Part 2

UPDATE: This post refers to an old version. For information about version 2 see this post.

Before you read on, please make sure that you have seen part 1 which introduces my Online Involute Spur Gear Builder. This second part addresses DXF export and compares the generated tooth profiles with the output from a commonly used OpenScad script.

DXF Export

Unfortunately there are many variants of the DXF format and not every tool is capable of importing the dxf output generated by the tool. Here are a few pointers:

  • Inkscape: Inkscape is a free, open source vector graphics tool that can import the generated dxf output without any issues. Inkscape’s native format is svg but it also supports many other output formats that are useful when dealing with other tools.
  • Illustrator and VectorWorks do not seem to recognize the generated output. Lael and Jeroen Donker reported workarounds (thank you, both!):
    • Lael: Just an update for anyone else trying to use illustrator or having issues importing into drawing programs. I downloaded Dassault draftsight, opened the dxf generated by this generator, then saved it as 2009, 2010 and 2013 dxf. 2009 and 2010 opened fine in illustrator.
    • Jeroen Donker: I found that the dxf output file can be opened in Inkscape (freeware on all platforms) and then saved in any vector format (I use eps) Opening the file in Adobe Illustrator is an easy next step.

Generated Output Comparison

It is interesting to compare the generated output with that of other tools. In particular this makes it quite easy to see when the undercuts become relevant. For the following I used Leemon Baird’s featured Public Domain Involute Parameterized Gears for OpenScad. Upfront I want to clearly state that this comparison by no means is intended to diminish Leemon Baird’s code. Like many other tools it simply does not cater for undercuts which in most real-world scenarios can be ignored. If undercuts are not an issue Leemon Baird’s tool is a perfect choice.

For the comparison I chose a pressure angle of 20°, 8 mm circular pitch, no clearance, and no backlash. For reference here is the scad file with the configuration for the 6 tooth gear and the resulting dxf file generated by Leemon Baird’s script.

The images below (excerpts from the svg file InvoluteGearComparison.svg) show the tooth profiles for tooth count 40, 20, 10, and 6. The thicker black background lines represent the output generated by Leemon Baird’s code. The thinner red lines in the foreground are the tooth profiles generated by my online generator:

ToothCount40ToothCount20ToothCount10ToothCount6

As expected the two profiles match almost exactly for large tooth counts. It is interesting to see that even for a tooth count of 20 there is a slight undercut visible. I expect in real live this would not matter since it is compensated for by a non-zero backlash.

Online Involute Spur Gear Builder

For the impatient: Just head over to the Online Involute Spur Gear Builder page.

UPDATE: This post refers to an old version. For information about version 2 see this post.

Still here and interested in some background? Perfect! Involute gears are by far the most commonly used gears today. An involute curve is fairly easy to calculate and quite a number of freely available tools and scripts exist that use this fact to create involute gear profiles (see e.g., Gear template generator, Parametric Involute Bevel and Spur Gears, OpenJsCad’s gear demo, and many more). However, I have not found a freely available tool that correctly caters for undercuts that occur for smaller tooth counts (around 10 or less):

UnderCutExample

If the undercuts are ignored the resulting gears will jam if machined and assembled precisely. For an elegant description of the issue including a recipe for how to graphically create correct spur gears see Michal Zalewski’s corresponding section in part six of his excellent Guerrilla guide to CNC machining, mold making, and resin casting series.

The code behind the online involute spur gear builder determines the tooth profile by simulating how a gear with infinite radius (aka rack) would cut into a smaller gear as discussed by Michal Zalewki. The advantage of the infinite gear is that it has a very simple trapezoidal tooth form solely defined by the addendum height and the pressure angle. In the figure below the rack is shown at the top. When the rack is moved to the right the gear needs to rotate clockwise so that a point on the pitch circle of the gear moves with the same speed as the rack. The code simulates this movement in steps and then for each step subtracts the shape of the rack from the gear.

InfiniteGearCutter

For illustration purposes the figure below has been calculated based on very coarse steps and only shows two teeth of the rack.

AnnotatedCutoutSteps

In reality the code simulates only one rack tooth and calculates the tooth profile of half a tooth of the matching gear. The complete gear is then assembled by mirroring and rotating the half tooth. All of this is accomplished by leveraging the ‘Constructive Area Construction’ capabilities of the csg.js library which is part of OpenJsCad. Each rack tooth location is calculated and created as a polygon. These polygons are joined together with the union operator to form one complex 2d shape that is then subtracted from a slice of the outer circle of the target gear to form half a tooth. Finally, the complete gear is assembled from rotated and mirrored half teeth:

CAG_AssemblySteps

The graphic above shows rough steps in the final output. This can be somewhat alleviated by using finer steps in the simulation but to really get rid of the steps additional smoothing is required. The step profile occurs in the undercut regions where the backside of the rotated rack tooth profile sticks out as a corner. The smoothing logic is explained in this diagram:

CutoutSmooting

The final result has smooth tooth profiles. As an example below is an image of a calculated gear set (pressure angle 14.5°) consisting of a 30 tooth gear meshing with an 8 tooth gear. Small values for clearance and backlash were used. Head over to the involute spur gear builder page to try it out yourself.

SpurGearExample

UPDATES:

Online Cycloidal Gear Builder

Almost exactly a year ago I published a blog post introducing an open source application for calculating cycloidal gears. The response was very positive but the fact that the tool depends on a specific version of .Net makes access a bit cumbersome.  Also the tool does not immediately show the resulting gears. Instead the user has to save the output as an SVG file and then display it either in a browser or an SVG editor like Inkscape. No instant gratification there.

All these issues are addressed in my new Online Cycloidal Gear Builder. Check it out!

2013-12-29-13_23_35-Cycloidal-Gear-Builder

Cycloidal Gear Builder

Introduction

As part of my research into wooden clock making I learned about cycloidal gears and was surprised that I couldn’t find a free or open source tool for generating templates for this kind of gear. Free options do exist for the more common convolute gears (e.g., http://woodgears.ca/gear_cutting/template.html). I did however find Hugh Sparks’ excellent write-up on cycloidal gears and the associated JavaScript based calculator. The calculations reflect the British Standard 978, Part 2.

New Open Source Gear Builder Utility

UPDATE: The information below is still valid but in the meantime I created an Online Cycloidal Gear Builder which is easier to use and does not have any install requirements. You will probably want to use it instead of the older desktop app. More info here.

Back to the original blog post …

To remedy the lack of free and open source tools for cycloidal gears I created a .Net 3.5 WinForm application that generates SVG (Scalable Vector Graphics) output for meshing gears. Under the hood the application uses the formulas as described by Hugh Sparks. Here is a screenshot of the application:

Application_v1.0_Screenshot

The middle left part is the input section. Based on the inputs a number of output values are calculated and displayed in the left section. For an explanation of the term module and the various output values please see Hugh Sparks’ web page. In order to generate an SVG graphic for the specific gears click on the ‘Generate & save SVG‘ button. By default the output is saved as a file called CycloidalGear.svg in the folder that the program is executed from. Another output file can be specified by clicking on the ‘…’ button. Note that an existing file with the same name will be overwritten! This is on purpose since it makes it fairly simple to use a browser to display the graphical output. The typical usage pattern is as follows:

  • Specify the input parameters
  • Click on the Generate & save SVG button
  • Open the generated svg file in a modern browser that has SVG support (Firefox or Chrome work very well). You should get something like this:
    OutputInFirefox
  • Now you can repeatedly change parameters and regenerate the svg output. Each time after clicking theGenerate & save SVG button, switch to the browser and refresh its output by clicking F5.

The generated output can be further enhanced by using a vector graphics editor that supports SVG. One attractive option is Inkscape, an open source, multi-platform vector graphics editor that directly operates on the SVG file format.

The British Standard 978, Part 2 results in quite a bit of room between the trough of one gear and the apex of the other. It is possible to override the default behavior by checking the box ‘Custom Slop‘ and specifying the desired slop in mm:

CustomSlopDefinition

The figure below shows meshing teeth with default slop (left) and custom 0.3 mm slop (right). Notice that on the right the dedendum circle of one gear almost touches the addendum of the other. The distance is the specified 0.3 mm.

DefaultVsCustomSlop

Install

The application is implemented in C# and requires Windows with .Net 3.5 installed. Most Windows PCs have this version of the .Net framework already installed. If it is missing it can be downloaded from here. To install Gear Builder please follow these steps:

The application is self contained and does not depend on the registry, etc. As a result it can be simply uninstalled by deleting the extracted files.

Source Code

The application is coded in C# using Visual Studio 2010. The source code can be accessed from the associated Google code project site, specifically http://code.google.com/p/drh-horology/source/checkout. For the generation of the svg output I use a slightly enhanced version of Ben Peterson’s SVG framework library.

License

The application itself, as well as the associated source code, are covered by the permissive MIT license. The application leverages Hugh Sparkes’ formulas as well as Ben Peterson’ SVG library. Both do not come with specific licenses.