Loading
3dexplorer

Public Domain Involute Parameterized Gears

by 3dexplorer Jan 9, 2011
Download All Files

Thing Apps Enabled

Please Login to Comment

Great work!
But it that possible that you add the code to create inner gear as well?
I guess you tried to create all the cases possible in the code, but you forgot this one, I suppose.
Thank for your work.

Great work! I think I'll use this when I finally get around to building a star tracker.

I noticed that the twist function doesn't allow gears to mesh. One of each meshed pair of gears will need to be mirrored to get the twist going in the right direction when calling the gear module:
mirror(v=[0, 0, 1]) gear(mm_per_tooth,n1,thickness,hole);

Also, the twist seems to be a function of the gears' diameter. A larger diameter gear will generate a greater tooth slope preventing gears of differing diameters from meshing properly.
Dividing the twist by the number of teeth is one way to fix it:
linear_extrude(height = thickness, center = true, convexity = 10, twist = twist / number_of_teeth)

You could also include a multiplier to allow the twist variable to stay small:
linear_extrude(height = thickness, center = true, convexity = 10, twist = twist / number_of_teeth*10)

A rotation offset could also be applied to to keep things lined up in the display pane.

Jeremy

I made the twist modifications and replaced "pi = 3.1415926" with the native "PI" function, and removed the calls to the assign() function as it is depreciated. I also moved all of the gear variables to the example section at the bottom of the script. Hopefully everything makes sense.

Jeremy

Comments deleted.

fantastic. no way. thanks

Thanks a lot! Exactly what I need.

This is brilliant! Thankyou!

Thanks for this - I've found a couple of issues with the "rack" gear calculations. I think these were spotted earlier, but I've got (I think) the correct fixes. The first issue is with the tooth shape on the rack itself. The pressure calculation angle is wrong - it should be "tan" not "cos" with no constant offset. The second issue is with the rack position on the example view - it should be scaled by the mm_per_tooth rather than the fixed value of 9 (which only works with the example value).

The patch is:

--- publicDomainGearV1.1.scad   2017-04-18 13:49:27.501990000 +0100
+++ publicDomainGearV1.1-changes.scad   2017-04-19 19:17:33.465643092 +0100
@@ -115,7 +115,7 @@
 ) {
    assign(pi = 3.1415926)
    assign(a = mm_per_tooth / pi) //addendum
-   assign(t = a*cos(pressure_angle)-1)         //tooth side is tilted so top/bottom corners move this amount
+   assign(t = a*tan(pressure_angle))         //tooth side is tilted so top/bottom corners move this amount
        for (i = [0:number_of_teeth-1] )
            translate([i*mm_per_tooth,0,0])
                linear_extrude(height = thickness, center = true, convexity = 10)
@@ -169,6 +169,6 @@
 translate([ d13,  0, 0]) rotate([0,0,-($t-n3/4+n1/4+1/2)*360/n3]) color([0.75,0.75,1.00]) gear(mm_per_tooth,n3,thickness,hole);
 translate([ d13,  0, 0]) rotate([0,0,-($t-n3/4+n1/4+1/2)*360/n3]) color([0.75,0.75,1.00]) gear(mm_per_tooth,n3,thickness,hole);
 translate([-d14,  0, 0]) rotate([0,0,-($t-n4/4-n1/4+1/2-floor(n4/4)-3)*360/n4]) color([1.00,0.75,0.50]) gear(mm_per_tooth,n4,thickness,hole,0,n4-3);
-translate([(-floor(n5/2)-floor(n1/2)+$t+n1/2-1/2)*9, -d1+0.0, 0]) rotate([0,0,0]) color([0.75,0.75,0.75]) rack(mm_per_tooth,n5,thickness,height);
+translate([mm_per_tooth*(-floor(n5/2)-floor(n1/2)+$t+n1/2-1/2), -d1+0.0, 0]) rotate([0,0,0]) color([0.75,0.75,0.75]) rack(mm_per_tooth,n5,thickness,height);

I believe the rack module ist still brocken. I changed it in the following way and added some more parameters. Now it works for me.

////////////////////////////////////////////////////////////////////////////////////////////////
// The module InvoluteGear_rack() gives a involute gear rack, which is a bar with teeth.
// A rack can mesh with any gear that has the same mm_per_tooth and pressure_angle.
// The "pitch circle" is a line along the X axis.
//
// mm_per_tooth     this is the "circular pitch", the circumference of the pitch circle
//                  divided by the number of teeth
//
// number_of_teeth  total number of teeth along the rack
//
// thickness        thickness of rack in mm
//
// height           height of rack in mm, from tooth top to far side of rack
//
// pressure_angle   controls how straight or bulged the tooth sides are, in degrees
//
// clearance        gap between top of a tooth on one gear and bottom of valley
//                  on a meshing gear, in millimeters
//
// backlash         gap between two meshing teeth, in the direction along the circumference
//                  of the pitch circle
////////////////////////////////////////////////////////////////////////////////////////////////

module InvoluteGear_rack (
    mm_per_tooth    = 3,
    number_of_teeth = 11,
    thickness       = 6,
    height          = 4,
    pressure_angle  = 28,
    clearance       = 0.0,
    backlash        = 0.0
)

{
    // addendum - tooth height above pitch line
    assign(addendum =        InvoluteGear_module_value(mm_per_tooth) - clearance)

    // dedendum - tooth height below pitch line
    assign(dedendum = 1.25 * InvoluteGear_module_value(mm_per_tooth)            )

    for (i = [0:number_of_teeth-1] )
        translate([(i+0.5)*mm_per_tooth,height-addendum,0])
            linear_extrude(height = thickness, center = true, convexity = 10)
                polygon(
                    points=[
                        [-1/2 * mm_per_tooth,                                              addendum-height],
                        [-1/2 * mm_per_tooth,                                             -dedendum],
                        [-1/4 * mm_per_tooth + backlash - dedendum * tan(pressure_angle), -dedendum],
                        [-1/4 * mm_per_tooth + backlash + addendum * tan(pressure_angle),  addendum],
                        [ 1/4 * mm_per_tooth - backlash - addendum * tan(pressure_angle),  addendum],
                        [ 1/4 * mm_per_tooth - backlash + dedendum * tan(pressure_angle), -dedendum],
                        [ 1/2 * mm_per_tooth,                                             -dedendum],
                        [ 1/2 * mm_per_tooth,                                              addendum-height],
                    ],
                    paths=[[0,1,2,3,4,5,6,7]]
                );
}

I ran this code verbatim on my MacBook Air running OpenSCAD 2013.06 and got square teeth on all gears. How to I get the involute shape on the teeth?

I tried creating a rack with mm_per_tooth=3 and I get a weird looking teeth. In fact if I change your example with mm_per_tooth=3, and I also divide the other length type variable by 3, I get the same weird result.

I think it's down to line 118:

assign(t = a*cos(pressure_angle)-1)

the -1 is outside the multiplication. I don't really know what this all means, I just tried to change it to:

assign(t = a*(cos(pressure_angle)-1))

but that only made it bad for all mm_per_tooth. Since I don't know what this all means, I don't know how to fix it.
Can you help?

I noticed the rendering of the example gear set was kind of time-consuming on my machine, so I made the following patch to speed it up.

Compiling and rendering the example gear set took somewhere around 3:40 on my 6-Core AMD machine under OpenSCAD 2013.06 . I moved the order in which the linear extrusion occurred in this script, and it dropped compile and render time down to less than a second.

Here's a patch for anyone who might find it useful:

81c81
< for (i = [0:number_of_teeth-teeth_to_hide-1] )

> linear_extrude(height = thickness, center = true, convexity = 10, twist = twist) for (i = [0:number_of_teeth-teeth_to_hide-1] )
83d82
< linear_extrude(height = thickness, center = true, convexity = 10, twist = twist)
119c118
< for (i = [0:number_of_teeth-1] )

> linear_extrude(height = thickness, center = true, convexity = 10) for (i = [0:number_of_teeth-1] )
121d119
< linear_extrude(height = thickness, center = true, convexity = 10)

It seems like line 118 should be:
        assign(t = a/2*cos(pressure_angle))         //tooth side is tilted so top/bottom corners move this amount

Rather than what it is.

You're right. I'll fix that, and give an attribution in the comments.

It would be great if there were a function to create a outer ring gear, ie the barrell of a epicyclic gearbox. I'm no coder, any thoughts and i'd be very greatful.

This is trivial to do with openscad! Make a cylinder that's the right size and thickness for the gear you want, then subtract a gear from it:

difference() {
  cylinder(r=1,h=1);
  gear(0.9*3.14159/20,20,1,0);
}

that would give you a gear with 20 teeth, 1.8cm inner-diameter, and a wall thickness of about 1mm, 1cm high. Modify as you please.

I think I'll probably add an internal gear ring in the future, so it can do planetary gears. But I think it will have to be slightly more complicated than the above code. It looks to me like there are at least 3 things that need to change if we want to create an internal gear as the difference of a disk and gear: swap the addendum and dedendum, negate the backlash, and change the fillet on the subtracted gear (so it's a removal from the tooth tip, rather than an addition to the tooth base). I'll have to think about whether there are any other changes, or if those 3 are enough.

WOW, amazing stuff. Thank you.

This is very good!! I do love the faceting of the teeth, almost even. Thanks a lot!

I just enclosed between comments the last lines of the script (to disable the example) and then played a little some code like:

include
&
lt;publicDomainGearV1.1.0.scad
&
gt;

PI=3.141592;

pitch_d=0; // Pitch diameter for the 1st gear
// set as zero and will be computed from "circular_p" parameter.
circular_p=4; // Circular pitch for the 1st gear
n1 = 17; // 1st gear number of teeth
n2 = 9; // 2nd gear number of teeth

mm_per_tooth=pitch_d != 0 ? pitch_d*PI/n1 : circular_p;

pressure_angle=28;
thickness = 5;
hole = 3.5;
clearance = 0.0;
backslash = 0.0;

d12=pitch_radius(mm_per_tooth,n1) + pitch_radius(mm_per_tooth,n2);

echo("Distance between gears axes:", d12);

rotate([0,0,-($t+n1/2)*360/n

1])
translate([0,0,thickness/2])
gear(mm_per_tooth=mm_per_tooth,
number_of_teeth=n1,
thickness=thickness,
clearance=clearance,
pressure_angle=pressure_angle,
hole_diameter=hole,
backlash=backslash);

translate([0,d12,thickness/2])

rotate([0,0,($t+n2/2)*360/n2])
gear(mm_per_tooth=mm_per_tooth,
number_of_teeth=n2,
thickness=thickness,
clearance=clearance,
pressure_angle=pressure_angle,
hole_diameter=hole,
backlash=backslash);

Try to run the animation (i.e. FPS
&
amp; Steps set to 25)

Thanks a lot for sharing !!

here is an unfinished project that incorporates a modified version of your code:

http://www.thingiverse.com/thing:8598http://www.thingiverse.com/thi...

thanks for making it public domain!

alpha parts of three speed bicycle hub
by donb

There are other gear libraries, but I really like this because you've made it public domain. I, or anyone, might like to just take a snippet from here and there, and this will accelerate innovation.

I've been considering making some of my own wandering designs public domain for similar reasons. So, this is very inspirational.

Double involute worm gearing?

I probably won't add more to it, now that it does everything the Rhombot needs. But if you'd like to use it to make a script with more features, that would be great.

OK, thanks very much for this. Haven't actually started working with OpenSCAD yet though so likely nothing in the near future, but... :) You wouldn't happen to have the mathematical description of a proper worm-gear interface kicking around as a starting point would you?

That's awesome! I was wondering where this thing went to. (Thanks for the rack!)

No problem. I hope you find it useful.