// Orbit: a planetary gear demonstrator. A crank turns the sun gear in the // middle; three planets roll around it inside a fixed 72-tooth ring and carry // the carrier arms with them. The carrier turns once for every four turns of // the crank, in the same direction, while the planets spin the other way. /* [Gearing] */ // Teeth on each planet; the ring has 24 + 2 x this many planet_teeth = 24; // [24, 30, 36] // Tooth size: pitch diameter = teeth x module gear_module = 3; // [2.5:0.1:3] // Total play between two meshing gears, at the pitch circle backlash = 0.3; // [0.2:0.05:0.5] /* [Assembly] */ // Crank angle in the assembled view; the carrier turns a quarter as far crank_angle = 0; // [0:5:1440] /* [Output] */ // All parts, or one group at a time output = "all"; // [all:All parts, gears:Gears, frame:Base standoffs and feet, carrier:Carrier, hub:Hub sleeves, crank:Crank and handle, coupon:Fit test, timing:Timing card] /* [Material] */ // Sheet thickness $thickness = 3; // [2.8:0.1:3.2] // Added to the 6 mm shaft holes and the 22 mm hub hole bearing_clearance = 0.3; // [0.2:0.05:0.4] // Beam width $kerf = 0.15; // [0:0.01:0.25] /* [Hidden] */ $material = "plywood"; $sheet = [600, 400]; $gap = 5; $fn = 160; t = $thickness; ns = 24; np = planet_teeth; nr = ns + 2 * np; m = gear_module; rs = ns * m / 2; rp = np * m / 2; rr = nr * m / 2; // Distance from the centre to each planet orbit = rs + rp; outer = rr + 22; mounting = rr + 13; hub = 22; ratio = 1 + nr / ns; assert(contains([24, 30, 36], np), "Planet teeth: 24, 30 or 36"); assert(m >= 2.5 && m <= 3, "Module: 2.5 to 3 mm"); assert(backlash >= 0.2 && backlash <= 0.5, "Backlash: 0.2 to 0.5 mm"); assert(bearing_clearance >= 0.2 && bearing_clearance <= 0.4, "Bearing clearance: 0.2 to 0.4 mm"); assert(t >= 2.8 && t <= 3.2, "Thickness: 2.8 to 3.2 mm"); assert($kerf >= 0 && $kerf <= 0.25, "Kerf: 0 to 0.25 mm"); assert(crank_angle >= 0 && crank_angle <= 1440, "Crank angle: 0 to 1440 degrees"); assert(contains(["all", "gears", "frame", "carrier", "hub", "crank", "coupon", "timing"], output), "Unknown output"); function polar(r, a) = [r * cos(a), r * sin(a)]; module mounting_holes() { for (a = [30, 150, 270]) translate(polar(mounting, a)) circle(d = 4.5); } // n scored tally marks, to number the laminates module tally(n, p) { score() for (j = [0:n - 1]) translate(p + [2 * j, 0]) rect([0.3, 4]); } // Involute teeth with a 20 degree pressure angle. backlash is shared between // the two gears of a mesh: every tooth is thinned, and every ring space // widened, by backlash / 2. The roots get a plain radial relief. function gear_inv(a) = tan(a) * 180 / PI - a; function gear_polar(r, a) = [r * cos(a), r * sin(a)]; // Half the angular width of a tooth (or of a ring space) at radius r function gear_half(z, m, r, backlash, internal = false) = let (rp = m * z / 2, rb = rp * cos(20), ar = acos(min(1, rb / r))) 90 / z + gear_inv(20) - gear_inv(ar) + (internal ? 1 : -1) * backlash / (4 * rp) * 180 / PI; function gear_outline(z, m, backlash, internal = false, steps = 24) = let (rp = m * z / 2, rb = rp * cos(20), lo = rp - (internal ? 1 : 1.25) * m, hi = rp + (internal ? 1.25 : 1) * m, start = max(lo, rb), hs = gear_half(z, m, start, backlash, internal), ht = gear_half(z, m, hi, backlash, internal)) [for (k = [0:z - 1]) each concat( [gear_polar(lo, 360 * k / z - hs)], [for (j = [(start > lo ? 0 : 1):steps]) let (r = start + (hi - start) * j / steps) gear_polar(r, 360 * k / z - gear_half(z, m, r, backlash, internal))], [for (j = [1:8]) gear_polar(hi, 360 * k / z - ht + 2 * ht * j / 8)], [for (j = [steps - 1:-1:0]) let (r = start + (hi - start) * j / steps) gear_polar(r, 360 * k / z + gear_half(z, m, r, backlash, internal))], [if (start > lo) gear_polar(lo, 360 * k / z + hs)], [for (j = [1:7]) gear_polar(lo, 360 * k / z + hs + (360 / z - 2 * hs) * j / 8)] )]; module externalgear(z, m, backlash) { polygon(gear_outline(z, m, backlash, false)); } module internalhole(z, m, backlash) { polygon(gear_outline(z, m, backlash, true)); } // Timing, with the crank at 0: the sun has a tooth centred on +X and the ring // hole is turned half a tooth. Planet k sits at beta = 120 k degrees, turned // by (1 + 24 / planet_teeth) beta + 180 - 180 / planet_teeth. module sun() { difference() { externalgear(ns, m, backlash); circle(d = 6 + bearing_clearance); } score() line([12, 0], [rs - 5, 0]); } module planet() { difference() { externalgear(np, m, backlash); circle(d = 6 + bearing_clearance); } score() line([9, 0], [rp - 5, 0]); } module ring() { difference() { circle(r = outer); rotate(180 / nr) internalhole(nr, m, backlash); mounting_holes(); } score() line([rr + 5, 0], [outer - 4, 0]); } module carrier() { difference() { union() { circle(r = 18); for (a = [0, 120, 240]) hull() { circle(r = 12); translate(polar(orbit, a)) circle(r = 11); } } circle(d = hub + bearing_clearance); for (a = [0, 120, 240]) translate(polar(orbit, a)) circle(d = 4.4); } for (i = [0:2]) tally(i + 1, polar(orbit - 18, 120 * i)); } module base() { difference() { circle(r = outer); circle(d = 6.2); mounting_holes(); } score() outline() circle(r = orbit); for (a = [0, 120, 240]) score() line(polar(orbit - 4, a), polar(orbit + 4, a)); } module ring_spacer() { difference() { circle(d = 18); circle(d = 4.5); } } module foot() { difference() { circle(d = 18); circle(d = 12); } } module hub_ring() { difference() { circle(d = hub); circle(d = 6 + bearing_clearance); } } module crank() { difference() { hull() { circle(r = 18); translate([0, 44]) circle(r = 11); } circle(d = 6 + bearing_clearance); translate([0, 44]) circle(d = 4.5); } score() line([0, 10], [0, 36]); } module handle() { difference() { circle(d = 20); circle(d = 6 + bearing_clearance); } } // The assembled view, base bottom at z = 0. The crank turns the sun; the // carrier follows at 1 / ratio, and each planet spins as it rolls round // inside the ring. a = crank_angle; carrier_turn = a / ratio; crank_turn = a - 125; function at(p, z) = concat(p, [z]); function layers(z, n) = [for (k = [0:n - 1]) [0, 0, z + k * t]]; function planet_spin(beta) = (1 + ns / np) * beta - ns / np * a + 180 - 180 / np; // Each planet is two layers, one planet after another planets = [for (j = [0:2], k = [0:1]) [carrier_turn + 120 * j, k]]; // The assembly steps in build order, named first so they number that way build_steps = [ "Glue the pedestal and the feet under the base", "Put the hub sleeves and the sun gear on the spindle", "Bolt the ring gear on its standoffs", "Set each planet by the timing card and lower the carrier into mesh", "Add the carrier spacer, then the crank and its handle" ]; if (output == "all") for (k = build_steps) step(k) {} if (output == "all" || output == "gears") { step(build_steps[1]) part("Sun gear", qty = 2, at = layers(6 * t + 0.5, 2), rotate = [0, 0, a]) sun(); step(build_steps[3]) part("Planet gear", qty = 6, at = [for (q = planets) at(polar(orbit, q[0]), 6 * t + 0.5 + q[1] * t)], rotate = [for (q = planets) [0, 0, planet_spin(q[0])]]) planet(); step(build_steps[2]) part("Ring gear", qty = 3, at = layers(6 * t + 0.5, 3)) ring(); } if (output == "all" || output == "frame") { step(build_steps[0]) part("Base", qty = 2, at = layers(0, 2)) base(); step(build_steps[0]) part("Spindle pedestal", qty = 2, at = [[0, 0, -t], [0, 0, -2 * t]]) difference() { circle(d = 34); circle(d = 6.1); } // A stack of four under each mounting hole, and a foot of seven below it step(build_steps[2]) part("Ring standoff", qty = 12, at = [for (j = [0:2], k = [0:3]) at(polar(mounting, 30 + 120 * j), 2 * t + k * t)]) ring_spacer(); step(build_steps[0]) part("Foot", qty = 21, at = [for (j = [0:2], k = [0:6]) at(polar(mounting, 30 + 120 * j), -7 * t + k * t)]) foot(); } if (output == "all" || output == "carrier") step(build_steps[3]) part("Carrier", qty = 2, at = layers(8 * t + 1.2, 2), rotate = [0, 0, carrier_turn]) carrier(); if (output == "all" || output == "hub") { // Four below the sun and four above it step(build_steps[1]) part("Hub sleeve", qty = 8, at = concat(layers(2 * t + 0.5, 4), layers(8 * t + 0.5, 4))) hub_ring(); step(build_steps[4]) part("Carrier spacer", at = [0, 0, 10 * t + 1.2]) difference() { circle(d = 32); circle(d = hub + bearing_clearance); } } if (output == "all" || output == "crank") { step(build_steps[4]) part("Crank", qty = 2, at = layers(12 * t + 0.5, 2), rotate = [0, 0, crank_turn]) crank(); step(build_steps[4]) part("Handle", qty = 6, at = [for (k = [0:5]) at(polar(44, 90 + crank_turn), 14 * t + 1 + k * t)], rotate = [0, 0, crank_turn]) handle(); } // The fit test and the timing card lie on the table beside the model if (output == "all" || output == "coupon") part("Fit test", at = [outer + 20, -outer, -7 * t]) { difference() { rect([110, 48], r = 3); for (i = [0:3]) translate([15 + 25 * i, 16]) circle(d = 6.1 + i * 0.1); translate([28, 35]) circle(d = hub + bearing_clearance); translate([70, 35]) circle(d = 4.4); } for (i = [0:3]) tally(i + 1, [12 + 25 * i, 4]); } // One dial per planet: the long line points to the planet, the short one shows how far to turn it if (output == "all" || output == "timing") part("Timing card", at = [outer + 20, -outer + 60, -7 * t]) { rect([190, 80], r = 3); for (i = [0:2]) { p = [35 + 60 * i, 40]; a = 120 * i; phi = (1 + ns / np) * a + 180 - 180 / np; score() translate(p) outline() circle(r = 24); score() line(p, p + polar(22, phi)); score() line(p, p + polar(24, a)); tally(i + 1, p + [-7, -32]); } } echo(str("Orbit: ", ns, " / ", np, " / ", nr, " teeth, ", ratio, " crank turns per carrier turn, ", 2 * outer, " mm across")); // Assembly, with base bottom at z = 0 and t the sheet thickness: glue the // laminates first (base, pedestal, ring, sun, each planet, carrier, crank, // three standoffs of 4 discs, three feet of 7, a handle of 6). Glue the // pedestal under the base and fix a 6 mm steel spindle through both, and the // feet under the mounting holes. On the spindle: a 0.5 mm washer, 4 hub // sleeves, the sun, 4 more hub sleeves, all glued to the sun only. Bolt the // ring on its standoffs (6t to 9t), score line to +X like the sun's. Planets // turn on brass bushes bolted to the carrier (8t to 10t); set each planet by // the timing card and lower the carrier into mesh. Add the carrier spacer and // shims, glue the crank on top of the upper hub, then the handle on its bush.