mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-14 19:33:57 +02:00
Added involute_worm_profile() and involute_rack_tooth_profile() functions.
This commit is contained in:
@@ -5229,6 +5229,7 @@ Rounded fillet for adding to corners.
|
|||||||
Utilities for making involute gears.
|
Utilities for making involute gears.
|
||||||
|
|
||||||
Formulas from <https://khkgears.net/new/gear_knowledge/gear_technical_reference/involute_gear_profile.html>
|
Formulas from <https://khkgears.net/new/gear_knowledge/gear_technical_reference/involute_gear_profile.html>
|
||||||
|
<https://khkgears.net/new/gear_knowledge/gear_technical_reference/calculation_gear_dimensions.html>
|
||||||
and <https://www.tec-science.com/mechanical-power-transmission/involute-gear/calculation-of-involute-gears/>
|
and <https://www.tec-science.com/mechanical-power-transmission/involute-gear/calculation-of-involute-gears/>
|
||||||
|
|
||||||
```involute_gear_profile()``` returns a polygon that can have the bore and spokes, etc, subtracted from it before linear extruding it to 3D.
|
```involute_gear_profile()``` returns a polygon that can have the bore and spokes, etc, subtracted from it before linear extruding it to 3D.
|
||||||
@@ -5241,6 +5242,8 @@ The clearance between tip and root defaults to module / 6, but can be overridden
|
|||||||
|
|
||||||
The origin of the rack is the left end of the pitch line and its width is below the pitch line. I.e. it does not include the addendum.
|
The origin of the rack is the left end of the pitch line and its width is below the pitch line. I.e. it does not include the addendum.
|
||||||
|
|
||||||
|
```involute_worm_profile()``` returns a tooth profile that can be passed to ```thread()``` to make worms.
|
||||||
|
|
||||||
|
|
||||||
[utils/gears.scad](utils/gears.scad) Implementation.
|
[utils/gears.scad](utils/gears.scad) Implementation.
|
||||||
|
|
||||||
@@ -5249,8 +5252,10 @@ The origin of the rack is the left end of the pitch line and its width is below
|
|||||||
### Functions
|
### Functions
|
||||||
| Function | Description |
|
| Function | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| ```centre_distance(m, z1, z2, pa)``` | Calculate distance between centres taking profile shift into account |
|
| ```centre_distance(m, z1, z2, pa = 20)``` | Calculate distance between centres taking profile shift into account |
|
||||||
| ```involute(r, u)``` | Involute of circle radius r at angle u in radians |
|
| ```involute(r, u)``` | Involute of circle radius r at angle u in radians |
|
||||||
|
| ```involute_rack_tooth_profile(m, pa = 20, clearance = undef)``` | Calculate rack tooth profile given module and pressure angle |
|
||||||
|
| ```involute_worm_profile(m, pa = 20, clearance = undef)``` | Calculate worm profile suitable for passing to thread() |
|
||||||
| ```profile_shift(z, pa)``` | Calculate profile shift for small gears |
|
| ```profile_shift(z, pa)``` | Calculate profile shift for small gears |
|
||||||
|
|
||||||
### Modules
|
### Modules
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
//! Utilities for making involute gears.
|
//! Utilities for making involute gears.
|
||||||
//!
|
//!
|
||||||
//! Formulas from <https://khkgears.net/new/gear_knowledge/gear_technical_reference/involute_gear_profile.html>
|
//! Formulas from <https://khkgears.net/new/gear_knowledge/gear_technical_reference/involute_gear_profile.html>
|
||||||
|
//! <https://khkgears.net/new/gear_knowledge/gear_technical_reference/calculation_gear_dimensions.html>
|
||||||
//! and <https://www.tec-science.com/mechanical-power-transmission/involute-gear/calculation-of-involute-gears/>
|
//! and <https://www.tec-science.com/mechanical-power-transmission/involute-gear/calculation-of-involute-gears/>
|
||||||
//!
|
//!
|
||||||
//! ```involute_gear_profile()``` returns a polygon that can have the bore and spokes, etc, subtracted from it before linear extruding it to 3D.
|
//! ```involute_gear_profile()``` returns a polygon that can have the bore and spokes, etc, subtracted from it before linear extruding it to 3D.
|
||||||
@@ -32,6 +33,8 @@
|
|||||||
//! The clearance between tip and root defaults to module / 6, but can be overridden by setting the ```clearance``` parameter.
|
//! The clearance between tip and root defaults to module / 6, but can be overridden by setting the ```clearance``` parameter.
|
||||||
//!
|
//!
|
||||||
//! The origin of the rack is the left end of the pitch line and its width is below the pitch line. I.e. it does not include the addendum.
|
//! The origin of the rack is the left end of the pitch line and its width is below the pitch line. I.e. it does not include the addendum.
|
||||||
|
//!
|
||||||
|
//! ```involute_worm_profile()``` returns a tooth profile that can be passed to ```thread()``` to make worms.
|
||||||
//
|
//
|
||||||
include <core/core.scad>
|
include <core/core.scad>
|
||||||
use <maths.scad>
|
use <maths.scad>
|
||||||
@@ -40,7 +43,7 @@ function involute(r, u) = let(a = degrees(u), c = cos(a), s = sin(a)) r * [c + u
|
|||||||
|
|
||||||
function profile_shift(z, pa) = z ? max(1 - z * sqr(sin(pa)) / 2, 0) : 0; //! Calculate profile shift for small gears
|
function profile_shift(z, pa) = z ? max(1 - z * sqr(sin(pa)) / 2, 0) : 0; //! Calculate profile shift for small gears
|
||||||
|
|
||||||
function centre_distance(m, z1, z2, pa) = //! Calculate distance between centres taking profile shift into account
|
function centre_distance(m, z1, z2, pa = 20) = //! Calculate distance between centres taking profile shift into account
|
||||||
let(x1 = profile_shift(z1, pa), x2 = profile_shift(z2, pa)) m * (z1/2 + z2/2 + x1 + x2);
|
let(x1 = profile_shift(z1, pa), x2 = profile_shift(z2, pa)) m * (z1/2 + z2/2 + x1 + x2);
|
||||||
|
|
||||||
module involute_gear_profile(m, z, pa = 20, clearance = undef, steps = 20) { //! Calculate gear profile given module, number of teeth and pressure angle
|
module involute_gear_profile(m, z, pa = 20, clearance = undef, steps = 20) { //! Calculate gear profile given module, number of teeth and pressure angle
|
||||||
@@ -97,35 +100,36 @@ module involute_gear_profile(m, z, pa = 20, clearance = undef, steps = 20) { //!
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function involute_rack_tooth_profile(m, pa = 20, clearance = undef) = //! Calculate rack tooth profile given module and pressure angle
|
||||||
|
let(p = PI * m, // Pitch
|
||||||
|
ha = m, // Addendum
|
||||||
|
c = is_undef(clearance) ? m / 4 : clearance, // Tip root clearance
|
||||||
|
hf = m + c, // Dedendum
|
||||||
|
hw = 2 * m, // Working depth
|
||||||
|
h = ha + hf, // Tooth depth
|
||||||
|
crest_w = p / 2 - 2 * ha * tan(pa), // Crest width
|
||||||
|
base_w = crest_w + 2 * hw * tan(pa), // Base width
|
||||||
|
root_w = p - base_w, // Root width
|
||||||
|
clearance_w = root_w - 2 * c * tan(pa), // Width of clearance without fillet
|
||||||
|
kx = tan(pa / 2 + 45), // Fillet ratio of radius and xoffset
|
||||||
|
pf = min(0.38 * m, kx * clearance_w / 2), // Dedendum fillet radius
|
||||||
|
x = pf / kx, // Fillet centre x offset from corner
|
||||||
|
sides = ceil(r2sides(pf) * (90 - pa) / 360), // Fillet facets taking $fa, $fs and $fn into account
|
||||||
|
fillet = [ for(i = [0 : sides - 1], a = i * (90 - pa) / sides + 270) [clearance_w / 2 - x, -hf + pf] + pf * [cos(a), sin(a)] ],
|
||||||
|
reflection = reverse([for(pt = fillet) [p - pt.x, pt.y] ]) // reflect for trailing edge
|
||||||
|
) concat(fillet, [ [root_w / 2, -hw / 2], [p / 2 - crest_w / 2, ha], [p / 2 + crest_w / 2, ha], [p - root_w / 2, -hw / 2] ], reflection);
|
||||||
|
|
||||||
module involute_rack_profile(m, z, w, pa = 20, clearance = undef) { //! Calculate rack profile given module, number of teeth and pressure angle
|
module involute_rack_profile(m, z, w, pa = 20, clearance = undef) { //! Calculate rack profile given module, number of teeth and pressure angle
|
||||||
p = PI * m; // Pitch
|
p = PI * m; // Pitch
|
||||||
ha = m; // Addendum
|
|
||||||
hf = 1.25 * m; // Dedendum
|
hf = 1.25 * m; // Dedendum
|
||||||
hw = 2 * m; // Working depth
|
tooth = involute_rack_tooth_profile(m, pa, clearance);
|
||||||
h = ha + hf; // Tooth depth
|
|
||||||
c = is_undef(clearance) ? m / 4 : clearance; // Tip root clearance
|
|
||||||
crest_w = p / 2 - 2 * ha * tan(pa); // Crest width
|
|
||||||
base_w = crest_w + 2 * hw * tan(pa); // Base width
|
|
||||||
root_w = p - base_w; // Root width
|
|
||||||
clearance_w = root_w - 2 * c * tan(pa); // Width of clearance without fillet
|
|
||||||
kx = tan(pa / 2 + 45); // Fillet ratio of radius and xoffset
|
|
||||||
pf = min(0.38 * m, kx * clearance_w / 2); // Dedendum fillet radius
|
|
||||||
x = pf / kx; // Fillet centre x offset from corner
|
|
||||||
|
|
||||||
tooth = [ [root_w / 2, -hw / 2], [p / 2 - crest_w / 2, ha], [p / 2 + crest_w / 2, ha], [p - root_w / 2, -hw / 2] ];
|
|
||||||
teeth = [for(i = [0 : z - 1], pt = tooth) [pt.x + i * p, pt.y] ];
|
teeth = [for(i = [0 : z - 1], pt = tooth) [pt.x + i * p, pt.y] ];
|
||||||
|
|
||||||
difference() {
|
|
||||||
polygon(concat([[0, -w], [0, -hf]], teeth, [[z * p, -hf ], [z * p, -w]])); // Add the corners
|
polygon(concat([[0, -w], [0, -hf]], teeth, [[z * p, -hf ], [z * p, -w]])); // Add the corners
|
||||||
|
|
||||||
for(i = [0 : z]) // Add fillets
|
|
||||||
hull() {
|
|
||||||
for(side = [-1, 1])
|
|
||||||
translate([i * p + side * (clearance_w / 2 - x), -hf + pf])
|
|
||||||
circle(pf);
|
|
||||||
|
|
||||||
translate([i * p, -hw /2 + eps / 2]) // Need to extend to fillet up to meet the root at high pressure angles
|
|
||||||
square([root_w, eps], center = true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function involute_worm_profile(m, pa = 20, clearance = undef) = //! Calculate worm profile suitable for passing to thread()
|
||||||
|
let(tooth = involute_rack_tooth_profile(m),
|
||||||
|
pitch = PI * m,
|
||||||
|
y_min = min([for(p = tooth) p.y])
|
||||||
|
) [for(p = tooth) [p.x - pitch / 2, p.y - y_min, 0]]; // Offset to be positive in y, centred in x and add 0 z ordintate
|
||||||
|
Reference in New Issue
Block a user