Skip to content

Commit

Permalink
threading doc tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianVmariano committed Jul 26, 2023
1 parent 262ad3e commit 7709ca5
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 12 deletions.
71 changes: 70 additions & 1 deletion gears.scad
Original file line number Diff line number Diff line change
Expand Up @@ -2747,7 +2747,8 @@ function worm_gear_thickness(circ_pitch, teeth, worm_diam, worm_arc=60, crowning
// dist = gear_dist(pitch, teeth1, teeth2, [helical=], [profile_shift=], [pressure_angle=]);
// dist = gear_dist(mod=, teeth=, [helical=], [profile_shift=], [pressure_angle=]);
// Description:
// Calculate the distance between the centers of two gears.
// Calculate the distance between the centers of two gears with parallel axes, taking into account
// profile shifting and helical angles.
// Arguments:
// pitch = The circular pitch, or distance between teeth around the pitch circle, in mm. Default: 5
// teeth1 = Total number of teeth in the first gear. If given 0, we assume this is a rack or worm.
Expand Down Expand Up @@ -2813,6 +2814,74 @@ function _working_pressure_angle(teeth1,profile_shift1, teeth2, profile_shift2,
pa_eff;


// Function: gear_dist_skew()
// Usage:
// d = gear_dist_skew(circ_pitch, teeth1, profile_shift1, h
// Description:
// Calculate the distance between two helical gears that mesh with non-parallel axes, taking into account
// profile shift and the helical angles.
function gear_dist_skew(mod,teeth1,profile_shift1=0, helical1, teeth2, profile_shift2=0, helical2, pressure_angle=20) =
let(
pa_normal_eff = _working_normal_pressure_angle_skew(teeth1,profile_shift1,helical1,teeth2,profile_shift2,helical2,pressure_angle),
dist_adj = 0.5*(teeth1/cos(helical1)^3+teeth2/cos(helical2)^3)*(cos(pressure_angle)/cos(pa_normal_eff)-1),
ff=echo(y=dist_adj,pa_normal_eff)
)
mod*(teeth1/2/cos(helical1)+teeth2/2/cos(helical2)+dist_adj);


function _working_normal_pressure_angle_skew(teeth1,profile_shift1,helical1, teeth2, profile_shift2, helical2, pressure_angle) =
let(
rhs = 2*(profile_shift1+profile_shift2)/(teeth1/cos(helical1)^3+teeth2/cos(helical2)^3)*tan(pressure_angle) + inv(pressure_angle),
fdaseee= echo(rhs=rhs),
pa_eff_normal = root_find(function (x) inv(x)-rhs, 5, 75)
)
pa_eff_normal;


// Function: gear_skew_angle()
// Usage:
// ang = gear_skew_angle(....
// Description:
// Compute the correct skew angle between the axes of two helical gears.
function gear_skew_angle(mod,teeth1,profile_shift1,helical1,teeth2, profile_shift2,helical2,pressure_angle=20)=
// profile_shift1==0 && profile_shift2==0 ? helical1+helical2
// :
let(
//mod = circular_pitch(pitch, mod, circ_pitch, diam_pitch)/PI,
a = gear_dist_skew(mod,teeth1,profile_shift1,helical1,teeth2, profile_shift2,helical2,pressure_angle),
d1 = 2*pitch_radius(mod=mod,teeth=teeth1,helical=helical1),
d2 = 2*pitch_radius(mod=mod,teeth=teeth2,helical=helical2),
dw1 = 2*a*d1/(d1+d2),
dw2 = 2*a*d2/(d1+d2),
beta1 = atan(dw1/d1*tan(helical1)),
beta2 = atan(dw2/d2*tan(helical2))
)
beta1+beta2;




// Function: get_profile_shift()
// Usage:
// total_shift = get_profile_shift(desired,....)
// Description:
// Compute the total profile shift, split between two gears, needed to place those gears with a specified separation.
// If the requested separation is impossible, returns nan. Note that the profile shift returned may also be impractically
// large.
// Arguments:
// circ_pitch = circular pitch of gear teeth
// teeth1 = number of teeth on first gear
// teeth2 = number of teeth on second gear
// pressure_angle = normal pressure angle of gear teeth. Default: 20
// mod = gear module, an alternative to circ_pitch for giving gear size
// diam_pitch = specify dimetral pitch
function get_profile_shift(desired,circ_pitch,teeth1,teeth2,pressure_angle=20,mod,diam_pitch,pitch) =
let(
mod = circular_pitch(pitch, mod, circ_pitch, diam_pitch)/PI,
pa_eff = acos(mod*(teeth1+teeth2)*cos(pressure_angle)/2/desired)
)
(_invol(pa_eff)-_invol(pressure_angle))/2/tan(pressure_angle) * (teeth1+teeth2);


// Function: auto_profile_shift()
// Synopsis: Returns the recommended profile shift for a gear.
Expand Down
24 changes: 13 additions & 11 deletions threading.scad
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@
// threaded_rod(d, l|length, pitch, [internal=], ...) [ATTACHMENTS];
// Description:
// Constructs a standard ISO (metric) or UTS (English) threaded rod. These threads are close to triangular,
// with a 60 degree thread angle. You can give the outer diameter and get the "basic form" or you can
// with a 60 degree thread angle. You can give diameter value which specifies the outer diameter and will produce
// the "basic form" or you can
// set d to a triplet [d_min, d_pitch, d_major] where are parameters determined by the ISO and UTS specifications
// that define clearance sizing for the threading. See screws.scad for how to make screws
// using the specification parameters.
Expand Down Expand Up @@ -278,10 +279,11 @@ module threaded_rod(
// Usage:
// threaded_nut(nutwidth, id, h|height|thickness, pitch,...) [ATTACHMENTS];
// Description:
// Constructs a hex nut or square nut for an ISO (metric) or UTS (English) threaded rod.
// Constructs a hex nut or square nut for an ISO (metric) or UTS (English) threaded rod.
// The inner diameter is measured from the bottom of the threads.
// Arguments:
// nutwidth = flat to flat width of nut
// id = diameter of threaded rod to screw onto.
// id = inner diameter of threaded hole, measured from bottom of threads
// h / height / l / length / thickness = height/thickness of nut.
// pitch = Distance between threads, or zero for no threads.
// ---
Expand Down Expand Up @@ -584,7 +586,7 @@ module trapezoidal_threaded_rod(
// acme_threaded_nut().
// Arguments:
// nutwidth = flat to flat width of nut
// id = diameter of threaded rod to screw onto.
// id = inner diameter of threaded hole, measured from bottom of threads
// h / height / l / length / thickness = height/thickness of nut.
// pitch = Thread spacing.
// ---
Expand Down Expand Up @@ -805,8 +807,8 @@ module acme_threaded_rod(
// Description:
// Constructs a hexagonal or square nut for an ACME threaded screw rod.
// Arguments:
// nutwidth = flat to flat width of nut.
// id = diameter of threaded rod to screw onto.
// nutwidth = flat to flat width of nut.
// id = inner diameter of threaded hole, measured from bottom of threads
// h / height / l / length / thickness = height/thickness of nut.
// tpi = threads per inch
// ---
Expand Down Expand Up @@ -1135,7 +1137,7 @@ module buttress_threaded_rod(
// Constructs a hexagonal or square nut for a simple buttress threaded screw rod.
// Arguments:
// nutwidth = diameter of the nut.
// id = diameter of threaded rod to screw onto.
// id = inner diameter of threaded hole, measured from bottom of threads
// h / height / l / length / thickness = height/thickness of nut.
// pitch = Thread spacing.
// ---
Expand Down Expand Up @@ -1331,7 +1333,7 @@ module square_threaded_rod(
// Constructs a hexagonal or square nut for a square profile threaded screw rod.
// Arguments:
// nutwidth = diameter of the nut.
// id = diameter of threaded rod to screw onto.
// id = inner diameter of threaded hole, measured from bottom of threads
// h / height / l / length / thickness = height/thickness of nut.
// pitch = Length between threads.
// ---
Expand Down Expand Up @@ -1864,8 +1866,8 @@ module generic_threaded_rod(
// Constructs a hexagonal or square nut for an generic threaded rod using a user-supplied thread profile.
// See {{generic_threaded_rod()}} for details on the profile specification.
// Arguments:
// nutwidth = outer dimension of nut from flat to flat.
// id = diameter of threaded rod to screw onto.
// nutwidth = outer dimension of nut from flat to flat.
// id = inner diameter of threaded hole, measured from bottom of threads
// h / height / thickness = height/thickness of nut.
// pitch = Thread spacing.
// profile = Thread profile.
Expand Down Expand Up @@ -2086,7 +2088,7 @@ module _nutshape(nutwidth, h, shape, bevel1, bevel2)
// back(3)text("angle",size=4,halign="center");
// }
// Arguments:
// d = Inside base diameter of threads. Default: 10
// d = Base diameter of threads. Default: 10
// pitch = Distance between threads. Default: 2
// ---
// thread_depth = Depth of threads from top to bottom.
Expand Down

0 comments on commit 7709ca5

Please sign in to comment.