Cut your own gears with profile shift - OpenSCAD library

Cut your own gears with profile shift - OpenSCAD library

thingiverse

last update 2016-06-18 uses new features of OpenSCAD-2015.03 and renders much faster help() echos module prototypes fixed: helix angle is now height independent added torsen differential as programming example Background With this ongoing project I want to present an unusual approach for gear calculation in library form. It is meant for scholars, students and tinkerers, who have started to program with OpenSCAD. Offering many useful, well defaulted parameters, it also addresses most of the needs of professional and semi-professional programmers, who will not only find a large scope of functionality, but also an inspiring self explaining library design. Usual code for drawing gears uses the involute function in a constructive way. There are some nice projects in this forum showing that path. It was also my first approach some years ago. But somehow I never really found out how to do proper profile shifting within that approach. And it seems to me, others also didn't. OK, there is not much explicit code published about gears and also math is not everybody’s darling. To do the really nasty tricks with gears it is essential to have profile shifting. So my idea was to use a cycling tool and cut gears out from a circle, just the way they are crafted in industry. Easy principle, easy and amazingly powerful solution. It's 'subtractiveness' also nicely fits to the declarative paradigm of OpenSCAD. How I Designed This I think, my little concept video explains the principle better, than I could do it with words. The principle The code uses a description of the tool (a toothed rack) and a blank (a simple circle in this case). And it lets the tool eat up the blank. In OpenSCAD this is expressed with a difference() operation that covers each phase of the crafting process. To simulate the movement of the tool OpenSCAD's translate() and rotate() operators are engaged. With parameters m denoting the modulus, z denoting the number of teeth, x denoting the profile shift (see below), w denoting the pressure angle (tooth gradient) of the rack, clearance denoting a 'free space' factor better distancing. iterations globally setting the desired angle resolution for the 'crafting', the central piece code to do this in 2D is quite simple: module gear2D(m = 1, z = 10, x = 0, w = 20, clearance = 0.1) { r_pitch = m*z/2 + x; Dia = m*z*PI; dy = m; r_fkc = r_pitch + dy *(1-clearance/2); s = 360/iterations; difference() { circle(r_fkc, $fn=300); // workpiece for(i=[0:s:360]) rotate([0, 0, -i]) translate([-i/360*Dia, 0, 0]) Rack(m, z, x, w, clearance); // Tool } } The modulus m of a gear may be viewed as a scale factor. With m=1, a gear with z=10 teeth will have a pitch diameter d of 10 mm, and a gear with z=12 teeth will have a d of 12 mm. Doubling the modulus will double the pitch diameter, increasing 'z' will also increase it. The larger the modulus, the more teeth, the larger the gear. It is as simple as this. You can specify any reasonable positive decimal value as modulus. Profile shifting To cut a gear with profile shift x the tool is moved at a radius slightly distanced (by x) to the normal pitch radius defined by the modulus m. Using appropriate positive and negative shift values you can account for a given axes distance, give more "flesh" to strengthen a gear with a low number of teeth, and even craft gears with different number of teeth while using the same pitch radius and vice versa. The following concept video shows how profile shifting works. Gear types As a matter of mathematics, involute gears with any number of teeth may be combined together, provided they are crafted with the same modulus. The rack being used as tool to craft the gears may also be viewed as an involute gear - the one with infinite diameter. By specifying a modulus m, a teeth number z and a profile shift x which is common to all involute gear types 2D gears can be crafted. With a little bit extra information like a height h and some angles you can also craft more sophisticated types. The library covers spur gears, helix gears, herringbone gears, and bevel gears each type with inner and outer spline. All this is done by use of OpenSCAD's linear_extrude(). Have a look what this means. The library What's in the library? As promised, the library provides modules that craft all the gear types shown in the animation. It uses the naming convention that outer spline gear types are named with gear, and inner spline gear types with Gear, followed by the specialized gear type. The modules use the same core set parameters with the same meaning. For inner spline gears you will want to additionally specify a reasonable outer ring diameter D. The code generates one, but better check, if this fits to your needs. For helix and herringbone gears you will want to define the helix angle or an absolute twist angle For a bevel gear you will want to specify a bevel angle plus a helix or an absolute twist. But you don't have to remember how to use all this. It is enough to remember that the library has a help() module, that will prompt you all information about the modules in the library as console output. Spelling, parameters (and their sequence) and default values. This is what you get: iterations=150; verbose=true; help(); gear(m=1, z=10, x=0, h=4, w=20, clearance=0.1, center=true); gear_helix(m=1, z=10, x=0, h=4, w=20, w_helix=45, w_abs=0, clearance=0.1, center=true, verbose=true); gear_herringbone(m=1, z=10, x=0, h=4, w=20, w_helix=45, w_abs=0, clearance=0.1, center=true); gear_bevel(m=1, z=10, x=0, h=4, w=20, w_bevel=45, w_helix=45, w_abs=0, clearance=0.1, center=true); gear_info(m=1, z=10, x=0, h=0, w=20, w_bevel=0, w_helix=0, w_abs=0, clearance=0.1, center=true); Gear(m=1, z=10, x=0, h=4, w=20, D=0, clearance=-.1, center=true); Gear_herringbone(m=1, z=10, x=0, h=4, w=20, w_helix=45, w_abs=0, D=0, clearance=-.1, center=true); Gear_helix(m=1, z=10, x=0, h=4, w=20, w_helix=45, w_abs=0, D=0, clearance=-.1, center=true); Gear_bevel(m=1, z=10, x=0, h=4, w=20, w_bevel=45, w_helix=0, w_abs=0, D=0, clearance=-0.1, center=true); gear2D(m=1, z=10, x=0, w=20, clearance=0.1); Rack(m=1, z=10, x=0, w=20, clearance=0); Additionally each gear that you craft will prompt its characteristic data to console. ECHO: "modulus = 1" ECHO: "Z = 10" ECHO: "profile angle = 20°" ECHO: "d = 10" ECHO: "d_outer = 12mm" ECHO: "d_inner = 8mm" ECHO: "height = 4mm" ECHO: "clearance factor = 0.1" ECHO: "d_outer_cleared = 11.9mm" ECHO: "d_inner_cleared = 7.9mm" ECHO: "helix angle = 0°" ECHO: "bevel angle = 0°" This will provide you the necessary information for sizing and spacing. To switch that output off, just set verbose = false; in your code. Usage I've crafted the code into a modularized library for private use, study and further discussion but not for commercial use. This means, the code should stay together in a separate file and must be published with the same or an even stronger license. At best you reference it using a link to this post and let people download it themselves from there. Since I am maintaining the library off and on, they'll always get the latest update. To explore the library, just open the file gears.scad in OpenSCAD and best start with uncommenting one or another of the many usage examples I provided for demonstration (and testing). Then press F5 to render and see what happens. There are examples for each module. Remember to comment everything again, if you make changes and want to save them. Also note that I have appended some STLs containing the gear types grouped into outer splines and inner splines. Try to find and render the corresponding example code with F6 to get an impression of how much time rendering will take. It can take a pretty while and depends on the gear type you are using (helix and herringbone have significantly more points to be calculated), the number of teeth, the height and of course of the value of the global variable iterations. For using the library as production code for your own projects, you copy gears.scad into your OpenSCAD library folder (for possible use in all projects) or into your current project folder (for using it only in this specific project). To finally include the library into your scad file you write: include Now you can use all modules defined in the library. Just write gear(z=6, m=3, x=1); and F5 presents you a lovely gear with six teeth, some profile shift and the default height of 4 mm. Look into the console window to find all parameters echoed there. Parameters As you will expect, you can customize your gears with any height any number of teeth z (integer > 2) any modulus m (real > 0) any profile shift x, (roughly -2

Download Model from thingiverse

With this file you will be able to print Cut your own gears with profile shift - OpenSCAD library with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Cut your own gears with profile shift - OpenSCAD library.