From ada1a2e3fc71331793d986ed9b72f8e9f8bf0a54 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Tue, 8 Aug 2023 23:05:45 -0400 Subject: [PATCH] add worm_dist --- gears.scad | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/gears.scad b/gears.scad index aef65a6..5f8eaf7 100644 --- a/gears.scad +++ b/gears.scad @@ -2233,6 +2233,7 @@ module worm( assert(is_finite(gear_spin)) assert(is_finite(profile_shift) && abs(profile_shift)<1); helical = asin(starts * circ_pitch / PI / d); +fda= echo(helical=helical); trans_pitch = circ_pitch / cos(helical); vnf = worm( circ_pitch=circ_pitch, @@ -2369,6 +2370,7 @@ function worm_gear( pr = pitch_radius(circ_pitch, teeth,helical), hob_rad = worm_diam / 2 + crowning, thickness = worm_gear_thickness(circ_pitch=circ_pitch, teeth=teeth, worm_diam=worm_diam, worm_arc=worm_arc, crowning=crowning, clearance=clearance), + dfda=echo("------->"), tooth_profile = _gear_tooth_profile( circ_pitch=circ_pitch, teeth=teeth, @@ -2379,6 +2381,7 @@ function worm_gear( profile_shift=profile_shift, center=true ), + feeg=echo("<----------"), tbot = min(column(tooth_profile,1)), arcthick = hob_rad * sin(worm_arc/2) * 2, twist = sin(helical)*arcthick / (2*PI*pr) * 360, @@ -2566,7 +2569,8 @@ function _gear_tooth_profile( prad = pitch_radius(circ_pitch, teeth, helical=helical), brad = _base_radius(circ_pitch, teeth, pressure_angle, helical=helical), rrad = _root_radius(circ_pitch, teeth, clearance, helical=helical, profile_shift=profile_shift, internal=internal), - +fgdg= echo(pitchrad=prad,outerrad=arad,rootrad=rrad), + srad = max(rrad,brad), tthick = circ_pitch/PI / cos(helical) * (PI/2 + 2*profile_shift * tan(pressure_angle)) + (internal?backlash:-backlash), tang = tthick / prad / 2 * 180 / PI, @@ -3153,12 +3157,42 @@ function worm_gear_thickness(circ_pitch, teeth, worm_diam, worm_arc=60, crowning ) thickness; +// Function: worm_dist() +// Synopsis: Returns the distance between a worm and a worm gear +// Topics: Gears, Parts +// See Also: worm(), worm_gear(), pitch_radius(), outer_radius() +// Usage: +// dist = worm_dist(mod=|diam_pitch=|circ_pitch=, d, starts, teeth, [profile_shift], [pressure_angle=]); +// Description: +// Calculate the distance between the centers of a worm and its mating worm gear, taking account +// possible profile shifting of the worm gear. +// Arguments: +// d = diameter of worm +// starts = number of starts of worm +// teeth = number of teeth on worm gear +// profile_shift = profile shift of worm gear +// --- +// mod = The metric module/modulus of the gear, or mm of pitch diameter per tooth. +// diam_pitch = The diametral pitch, or number of teeth per inch of pitch diameter. Note that the diametral pitch is a completely different thing than the pitch diameter. +// circ_pitch = distance between teeth around the pitch circle. +// pressure_angle = The pressure angle of the gear. + +function worm_dist(d,starts,teeth,mod,profile_shift=0,diam_pitch,circ_pitch,pressure_angle=20) = + let( + mod = module_value(mod=mod,diam_pitch=diam_pitch,circ_pitch=circ_pitch), + lead_angle = asin(mod*starts/d), + pitch_diam = mod*teeth/cos(lead_angle) + ) + (d+pitch_diam)/2 + profile_shift*mod; + + + // Function: gear_dist() // Synopsis: Returns the distance between two gear centers for spur gears or parallel axis helical gears. // Topics: Gears, Parts // See Also: worm(), worm_gear(), pitch_radius(), outer_radius() // Usage: -// dist = gear_dist(mod=|diam_pitch=|circ_pitch=, teeth1, teeth2, [helical], [profile_shift1], [profile_shift2], [pressure_angle=]); +// dist = gear_dist(mod=|diam_pitch=|circ_pitch=, teeth1, teeth2, [helical], [profile_shift1], [profile_shift2], [pressure_angle=], [backlash=]); // Description: // Calculate the distance between the centers of two spur gears gears or helical gears with parallel axes, // taking into account profile shifting and helical angle. You can give the helical angle as either positive or negative.