was used for 5010 servo i removed the old gearbox because a gear was broken
you might need to adjust diameter to fit a motor its just
4:1 gear ratio
its at least 53.1mm wide 22mm tall
include <BOSL2/std.scad>
include <BOSL2/gears.scad>
/ [Carrier Settings] /
carrier_spoke_width = 8.0;
carrier_hub_extension = 3.0;
carrier_plate_thick = 2.5;
overlap_margin = 1.5;
/ [Workflow Control] /
layout = "assembled"; // [assembled, flat]
/ [Visibility Toggles] /
show_sun = true;
show_planets = true;
show_ring = true;
show_carrier = true;
show_pins = true;
show_cup = true;
show_rocker = true;
show_cover = true;
/ [Gear Parameters] /
pitch = 2.932;
sun_t = 15;
planet_t = 15;
ring_t = sun_t + 2 * planet_t;
thick = 6.0;
clear = 0.3;
/ [Hardware & Fit] /
pin_diam = 3.1;
pin_extra = 2.5;
pin_protrusion = 0.5;
pin_hole_clearance = 0.15;
/ [Cup Parameters] /
cup_od = 20.2;
cup_h = 6.1;
cup_recess_depth = 3.5;
cup_recess_id = 17.4;
cup_center_hole = 6.1;
cup_z_push = 0.0;
/ [Cover Control] /
cover_base_thick = 1.6;
pin_h = thick + carrier_plate_thick + pin_extra + pin_protrusion;
fit_clearance = 0.1;
motor_shaft_d = 3.6;
z_offset = 0.0;
// --- MATH ---
pitch_diam_sun = (sun_t pitch) / PI;
pitch_diam_planet = (planet_t pitch) / PI;
center_dist = (pitch_diam_sun + pitch_diam_planet) / 2;
ring_outer_teeth = ring_t + 18;
ring_outer_diam = (ring_outer_teeth pitch) / PI;
ring_inner_diam = (ring_t pitch) / PI;
extension_radius = (ring_inner_diam / 2) + overlap_margin;
$fn = 64;
// --- MAIN EXECUTION ---
if (layout == "flat") {
grid_space = ring_t + 25;
sun_gear_part();
move([grid_space, 0, 0]) planet_gears_part();
move([grid_space2, 0, 0]) ring_gear_part();
move([0, grid_space, 0]) carrier_part();
move([grid_space, grid_space, 0]) cup_part();
move([grid_space2, grid_space, 0]) rocker_part();
move([grid_space3, 0, 0]) cover_part();
move([grid_space3, grid_space, 0]) pins_part();
} else {
sun_gear_part();
planet_gears_part();
ring_gear_part();
carrier_part();
pins_part();
cup_part();
rocker_part();
cover_part();
}
// --- PART MODULES ---
module pins_part() {
// Note: We render all 3 pins in assembled mode so the cover can use them to cut holes
if (show_pins || $parent_geom) {
pin_z_start = (layout == "flat") ? 0 : -carrier_plate_thick - pin_protrusion;
color("silver") {
if (layout == "flat") {
cyl(h=pin_h, d=pin_diam, anchor=BOTTOM);
} else {
for(a = [0, 120, 240]) {
rotate([0, 0, a]) move([center_dist, 0, pin_z_start])
cyl(h=pin_h, d=pin_diam, anchor=BOTTOM);
}
}
}
}
}
module cover_part() {
if (show_cover) {
z_pos = (layout == "flat") ? 0 : thick;
move([0, 0, z_pos]) {
color("lightgray", 0.8)
diff() {
union() {
// Plate Base
cyl(h=cover_base_thick, d=cup_od + carrier_hub_extension, anchor=BOTTOM);
for(a = [0, 120, 240]) {
rotate([0, 0, a]) {
move([extension_radius/2, 0, cover_base_thick/2])
cube([extension_radius, carrier_spoke_width, cover_base_thick], anchor=CENTER);
move([extension_radius, 0, 0])
cyl(h=cover_base_thick, d=carrier_spoke_width, anchor=BOTTOM);
// Support area for pins
move([center_dist, 0, 0])
cyl(h=cover_base_thick, d=carrier_spoke_width + 1.5, anchor=BOTTOM);
}
}
}
tag("remove") {
// 1. Center Hole
cyl(h=100, d=motor_shaft_d + 1, anchor=CENTER);
}
// Remaining modules (carrier, gears, cup, rocker) remain unchanged...
module carrier_part() {
if (show_carrier) {
z_pos = (layout == "flat") ? carrier_plate_thick : 0;
r_v = (layout == "flat") ? [180, 0, 0] : [0, 0, 0];
inner_hub_d = cup_od + carrier_hub_extension;
color("slategray") rotate(r_v) up(z_pos)
diff() {
union() {
cyl(h=carrier_plate_thick, d=inner_hub_d, anchor=TOP);
for(a = [0, 120, 240]) {
rotate([0, 0, a]) {
move([extension_radius/2, 0, -carrier_plate_thick/2])
cube([extension_radius, carrier_spoke_width, carrier_plate_thick], anchor=CENTER);
move([center_dist, 0, 0])
cyl(h=carrier_plate_thick, d=carrier_spoke_width + 1.5, anchor=TOP);
move([extension_radius, 0, 0])
cyl(h=carrier_plate_thick, d=carrier_spoke_width, anchor=TOP);
}
}
}
tag("remove") {
cyl(h=carrier_plate_thick + 2, d=cup_od + fit_clearance, anchor=CENTER);
for(a = [0, 120, 240]) {
rotate([0, 0, a]) move([center_dist, 0, 0])
cyl(h=carrier_plate_thick + 5, d=pin_diam + pin_hole_clearance, anchor=CENTER);
}
cyl(h=100, d=cup_center_hole, anchor=CENTER);
}
}
}
}
module ring_gear_part() {
if (show_ring) {
color("white", 0.3) up(z_offset)
diff() {
spur_gear(circ_pitch=pitch, teeth=ring_outer_teeth, thickness=thick, anchor=BOTTOM);
tag("remove") {
spur_gear(circ_pitch=pitch, teeth=ring_t, thickness=thick+0.1, internal=true, clearance=clear, anchor=BOTTOM);
}
}
}
}
module sun_gear_part() {
if (show_sun) {
color("orange") up(z_offset)
spur_gear(circ_pitch=pitch, teeth=sun_t, thickness=thick, shaft_diam=motor_shaft_d, anchor=BOTTOM);
}
}
module planet_gears_part() {
if (show_planets) {
for(a = [0, 120, 240]) {
d_val = (layout == "flat") ? (planet_t 2.5) : center_dist;
rotate([0, 0, (layout == "flat") ? 0 : a])
move([(layout == "flat") ? (a/120 d_val) : d_val, 0, z_offset])
color("skyblue")
spur_gear(circ_pitch=pitch, teeth=planet_t, thickness=thick, shaft_diam=pin_diam + fit_clearance, clearance=clear, anchor=BOTTOM);
}
}
}
module cup_part() {
if (show_cup) {
p_z = (layout == "flat") ? 0 : (-carrier_plate_thick + cup_z_push);
r_c = (layout == "flat") ? [180, 0, 0] : [0,0,0];
color("lime") rotate(r_c) move([0,0,p_z])
diff()
cyl(h = cup_h, d = cup_od, anchor = TOP) {
tag("remove") {
down(cup_h)
cyl(h = cup_recess_depth, d = cup_recess_id, anchor = BOTTOM);
cyl(h = cup_h + 10, d = cup_center_hole, anchor = CENTER);
}
}
}
}
module rocker_part() {
if (show_rocker) {
r_dist = (ring_outer_diam + (12 * pitch / PI))/2;
m_v = (layout == "flat") ? [0, 0, 0] : [r_dist, 0, z_offset];
move(m_v) color("red")
spur_gear(circ_pitch=pitch, teeth=12, thickness=thick, shaft_diam=4.2, anchor=BOTTOM);
}
}
标签
模型来源
