diff --git a/involute_gears.scad b/involute_gears.scad index 21cf88b..701e7f2 100644 --- a/involute_gears.scad +++ b/involute_gears.scad @@ -2,15 +2,15 @@ // Public Domain Parametric Involute Spur Gear (and involute helical gear and involute rack) // version 1.1 // by Leemon Baird, 2011, Leemon@Leemon.com -// Corrected and tweaked by Revar Desmera, 2017, revarbat@gmail.com -//http://www.thingiverse.com/thing:5505 +// http://www.thingiverse.com/thing:5505 +// Tweaked, and improved by Revar Desmera, 2017-2019, revarbat@gmail.com // // This file is public domain. Use it for any purpose, including commercial // applications. Attribution would be nice, but is not required. There is // no warranty of any kind, including its correctness, usefulness, or safety. -// +// // This is parameterized involute spur (or helical) gear. It is much simpler and less powerful than -// others on Thingiverse. But it is public domain. I implemented it from scratch from the +// others on Thingiverse. But it is public domain. I implemented it from scratch from the // descriptions and equations on Wikipedia and the web, using Mathematica for calculations and testing, // and I now release it into the public domain. // @@ -27,36 +27,113 @@ // measurements for the gear. The most important is pitch_radius, which tells how far apart to space // gears that are meshing, and adendum_radius, which gives the size of the region filled by the gear. // A gear has a "pitch circle", which is an invisible circle that cuts through the middle of each -// tooth (though not the exact center). In order for two gears to mesh, their pitch circles should -// just touch. So the distance between their centers should be pitch_radius() for one, plus pitch_radius() +// tooth (though not the exact center). In order for two gears to mesh, their pitch circles should +// just touch. So the distance between their centers should be pitch_radius() for one, plus pitch_radius() // for the other, which gives the radii of their pitch circles. // -// In order for two gears to mesh, they must have the same mm_per_tooth and pressure_angle parameters. +// In order for two gears to mesh, they must have the same mm_per_tooth and pressure_angle parameters. // mm_per_tooth gives the number of millimeters of arc around the pitch circle covered by one tooth and one // space between teeth. The pitch angle controls how flat or bulged the sides of the teeth are. Common // values include 14.5 degrees and 20 degrees, and occasionally 25. Though I've seen 28 recommended for // plastic gears. Larger numbers bulge out more, giving stronger teeth, so 28 degrees is the default here. // -// The ratio of number_of_teeth for two meshing gears gives how many times one will make a full -// revolution when the the other makes one full revolution. If the two numbers are coprime (i.e. +// The ratio of number_of_teeth for two meshing gears gives how many times one will make a full +// revolution when the the other makes one full revolution. If the two numbers are coprime (i.e. // are not both divisible by the same number greater than 1), then every tooth on one gear // will meet every tooth on the other, for more even wear. So coprime numbers of teeth are good. // // The module rack() gives a rack, which is a bar with teeth. A rack can mesh with any // gear that has the same mm_per_tooth and pressure_angle. // -// Some terminology: +// Some terminology: // The outline of a gear is a smooth circle (the "pitch circle") which has mountains and valleys -// added so it is toothed. So there is an inner circle (the "root circle") that touches the +// added so it is toothed. So there is an inner circle (the "root circle") that touches the // base of all the teeth, an outer circle that touches the tips of all the teeth, // and the invisible pitch circle in between them. There is also a "base circle", which can be smaller than -// all three of the others, which controls the shape of the teeth. The side of each tooth lies on the path -// that the end of a string would follow if it were wrapped tightly around the base circle, then slowly unwound. +// all three of the others, which controls the shape of the teeth. The side of each tooth lies on the path +// that the end of a string would follow if it were wrapped tightly around the base circle, then slowly unwound. // That shape is an "involute", which gives this type of gear its name. // ////////////////////////////////////////////////////////////////////////////////////////////// +//gear_tooth_profile(mm_per_tooth=5, number_of_teeth=20, pressure_angle=20); +module gear_tooth_profile( + mm_per_tooth = 3, //this is the "circular pitch", the circumference of the pitch circle divided by the number of teeth + number_of_teeth = 11, //total number of teeth around the entire perimeter + pressure_angle = 28, //Controls how straight or bulged the tooth sides are. In degrees. + clearance = 0.0, //gap between top of a tooth on one gear and bottom of valley on a meshing gear (in millimeters) + backlash = 0.0, //gap between two meshing teeth, in the direction along the circumference of the pitch circle + bevelang = 0.0 +) { + p = mm_per_tooth * number_of_teeth / PI / 2; //radius of pitch circle + c = p + mm_per_tooth / PI - clearance; //radius of outer circle + b = p*cos(pressure_angle); //radius of base circle + r = p-(c-p)-clearance; //radius of root circle + t = mm_per_tooth/2-backlash/2; //tooth thickness at pitch circle + k = -iang(b, p) - t/2/p/PI*180; //angle to where involute meets base circle on each side of tooth + scale([1, 1/cos(bevelang), 1]) + translate([0,-r,0]) + polygon( + points=[ + polar(r-1, -181/number_of_teeth), + polar(r, -181/number_of_teeth), + polar(r, r 0) { + cylinder(h=2*thickness+1, r=hole_diameter/2, center=true); + } + if (bevelang != 0) { + h = (c-r)*sin(bevelang); + translate([0,0,-thickness/2]) { + difference() { + cube([2*c/cos(bevelang),2*c/cos(bevelang),2*h], center=true); + cylinder(h=h, r1=r, r2=c, center=false); + } + } + } } -}; +} + + //these 4 functions are used by gear -function polar(r,theta) = r*[sin(theta), cos(theta)]; //convert polar to cartesian coordinates -function iang(r1,r2) = sqrt((r2/r1)*(r2/r1) - 1)/PI*180 - acos(r1/r2); //unwind a string this many degrees to go from radius r1 to radius r2 -function q7(f,r,b,r2,t,s) = q6(b,s,t,(1-f)*max(b,r)+f*r2); //radius a fraction f up the curved side of the tooth -function q6(b,s,t,d) = polar(d,s*(iang(b,d)+t)); //point at radius d on the involute curve +function polar(r,theta) = r*[sin(theta), cos(theta)]; //convert polar to cartesian coordinates +function iang(r1,r2) = sqrt((r2/r1)*(r2/r1) - 1)/PI*180 - acos(r1/r2); //unwind a string this many degrees to go from radius r1 to radius r2 +function q7(f,r,b,r2,t,s) = q6(b,s,t,(1-f)*max(b,r)+f*r2); //radius a fraction f up the curved side of the tooth +function q6(b,s,t,d) = polar(d,s*(iang(b,d)+t)); //point at radius d on the involute curve + // Creates a rack, which is a straight line with teeth. // The same as a segment of teeth from an infinite diameter gear. @@ -154,7 +243,8 @@ module rack ( ], paths=[[0,1,2,3,4,5,6,7]] ); -}; +} + //These 5 functions let the user find the derived dimensions of the gear. //A gear fits within a circle of radius outer_radius, and two gears should have @@ -166,10 +256,11 @@ function dedendum (mm_per_tooth=5) = 1.25 * module_value(mm_per_tooth); function module_value (mm_per_tooth=5) = mm_per_tooth / PI; //tooth density expressed as "module" or "modulus" in millimeters function pitch_radius (mm_per_tooth=5,number_of_teeth=11) = mm_per_tooth * number_of_teeth / PI / 2; function outer_radius (mm_per_tooth=5,number_of_teeth=11,clearance=0.1) //The gear fits entirely within a cylinder of this radius. - = mm_per_tooth*(1+number_of_teeth/2)/PI - clearance; + = mm_per_tooth*(1+number_of_teeth/2)/PI - clearance; + ////////////////////////////////////////////////////////////////////////////////////////////// -//example gear train. +//example gear train. //Try it with OpenSCAD View/Animate command with 20 steps and 24 FPS. //The gears will continue to be rotated to mesh correctly if you change the number of teeth.