177 lines
6.6 KiB
OpenSCAD
177 lines
6.6 KiB
OpenSCAD
// A small collection of parts for the 28BYJ-48 stepper motor:
|
|
// - A housing for the stepper motor
|
|
// - A coupler to combine the axle of the stepper with an ft clip axle
|
|
/* [Stepper options] */
|
|
// Type
|
|
type = 0; // [0 : no output, 1:Stepper housing, 2:Shaft coupler, 3:Gear coupler, 4:Bevel gears coupler]
|
|
|
|
/* [Hidden] */
|
|
|
|
// **********************
|
|
// ** Static Settings: **
|
|
// **********************
|
|
include<ft_util.scad>
|
|
use<ft_gears.scad>
|
|
|
|
shaft_diameter = 5.1;
|
|
shaft_thickness = 3.1;
|
|
|
|
// --------------------------------------------------------------------
|
|
// A coupler to combine the axle of the stepper with an ft clip axle
|
|
// --------------------------------------------------------------------
|
|
module shaft_coupler() {
|
|
// All dimensions are defined here, no parameters for the shaft
|
|
// coupler module. Depending on the printer's tolerance, the values
|
|
// might need some correction.
|
|
length = BASIC_BLOCK_SIZE;
|
|
diameter = 8.0;
|
|
ft_axis_diameter = 4.25;
|
|
ft_axis_thickness = 2.75;
|
|
|
|
difference() {
|
|
cylinder(d = diameter, h = length, center = true);
|
|
union() {
|
|
// cut out the motor axle hole
|
|
translate([0,0,length / 4 + MANIFOLD_CORRECTION / 2])
|
|
clip_axle_hole(length / 2, diameter = shaft_diameter, thickness = shaft_thickness);
|
|
// cut out the clip axle hole
|
|
translate([0,0,-length / 4 - MANIFOLD_CORRECTION / 2])
|
|
clip_axle_hole(length / 2, diameter = ft_axis_diameter, thickness = ft_axis_thickness, hor_cutout = diameter + MANIFOLD_CORRECTION);
|
|
// cut out the horizontal hole of the axle coupler
|
|
//cube([diameter + MANIFOLD_CORRECTION, ft_axis_thickness, ft_axis_diameter], center = true);
|
|
}
|
|
}
|
|
}
|
|
|
|
// --------------------------------------------------------------------
|
|
// A gear for the stepper
|
|
// --------------------------------------------------------------------
|
|
module gear_wheel() {
|
|
difference() {
|
|
union() {
|
|
translate([0,0,-4])
|
|
cylinder(h = 4, d = 8, center = true);
|
|
normalgear (modulus=1.5, teeth=15, height=5, hole=0.0, clipaxle=false, optimize=false);
|
|
}
|
|
translate([0,0,-3])
|
|
clip_axle_hole(diameter = shaft_diameter, thickness = shaft_thickness);
|
|
}
|
|
}
|
|
|
|
// --------------------------------------------------------------------
|
|
// Build a pair of bevel gears.
|
|
// Both gears have the same size. The hole in one gear is for the
|
|
// stepper and the other hole is for a clip axle.
|
|
// --------------------------------------------------------------------
|
|
module bevelgears(modulus=1.5, teeth=15, hole=4.2) {
|
|
shaft_diameter = 5.1;
|
|
shaft_thickness = 3.1;
|
|
ft_axis_diameter = 4.25;
|
|
ft_axis_thickness = 2.75;
|
|
shaft_length = 7.5;
|
|
diameter = 8.0;
|
|
|
|
// Calculation for the distance of the bevel gears taken from gears.scad,
|
|
// eleminated the intermediate steps. Simplify more?
|
|
rkf = (modulus*teeth/2)/sin(45)*sin(((PI*((modulus*teeth/2)/sin(45))*45/90 - 2 * (modulus + modulus / 6)) / 2)/(PI*((modulus*teeth/2)/sin(45))) * 180);
|
|
|
|
difference() {
|
|
union() {
|
|
translate([0,0,-shaft_length/2+MANIFOLD_CORRECTION])
|
|
cylinder(h = shaft_length, d = diameter, center = true);
|
|
translate([rkf*3+modulus,0,-shaft_length/2+MANIFOLD_CORRECTION])
|
|
cylinder(h = shaft_length, d = diameter, center = true);
|
|
|
|
bevel_gear_pair(modul = modulus,
|
|
gear_teeth = teeth, pinion_teeth = teeth,
|
|
axis_angle=90, tooth_width = 5,
|
|
gear_bore = 0, pinion_bore = 0,
|
|
pressure_angle=20, helix_angle=0,
|
|
together_built=false);
|
|
}
|
|
translate([0,0,-shaft_length/2])
|
|
#clip_axle_hole(shaft_length+MANIFOLD_CORRECTION, diameter = shaft_diameter, thickness = shaft_thickness);
|
|
|
|
translate([rkf*3+modulus,0,-shaft_length/2])
|
|
#clip_axle_hole(shaft_length+MANIFOLD_CORRECTION, diameter = ft_axis_diameter, thickness = ft_axis_thickness, hor_cutout = diameter + MANIFOLD_CORRECTION);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
// A housing for the 28BYJ-48. No back becuse the stepper gets quite
|
|
// warm and the heat has to go somewhere ...
|
|
// --------------------------------------------------------------------
|
|
module stepper_housing(width = 60, length = 45, height = 30) {
|
|
wallthickness = 4;
|
|
frontthickness = 4;
|
|
screwdistance = 35;
|
|
shaftdistance = 8;
|
|
|
|
difference() {
|
|
// The housing
|
|
cube([width, length, height], center = true);
|
|
// minus the inner cut out
|
|
translate([0, 0, frontthickness])
|
|
cube([width - 2 * wallthickness, length - 2 * wallthickness, height], center = true);
|
|
// and the grooves
|
|
grooves(width, length, height);
|
|
|
|
// remove the cut outs for the screws and the axle
|
|
translate([-(screwdistance / 2),0, -(height / 2 + 0.1)])
|
|
cylinder(d = 3, h = 10);
|
|
translate([-(screwdistance / 2),0, -(height / 2 + 0.1)])
|
|
cylinder(d = 5.75, h = 2.5);
|
|
|
|
translate([(screwdistance / 2),0, -(height / 2 + 0.1)])
|
|
cylinder(d = 3, h = 10);
|
|
translate([(screwdistance / 2),0, -(height / 2 + 0.1)])
|
|
cylinder(d = 5.75, h = 2.5);
|
|
|
|
translate([0,shaftdistance, -(height / 2 + 0.1)])
|
|
cylinder(d = 9.5, h = 10);
|
|
}
|
|
}
|
|
|
|
// --------------------------------------------------------------------
|
|
// The grooves around the housing for the cut out
|
|
// --------------------------------------------------------------------
|
|
module grooves(width = 60, length = 45, height = 30) {
|
|
for(i = [0, 180]) {
|
|
rotate([0,0,i])
|
|
for (j = [0 : BASIC_BLOCK_SIZE : (width / BASIC_BLOCK_SIZE - 1) * BASIC_BLOCK_SIZE])
|
|
translate([j - (width / 2) + BASIC_BLOCK_HALF, -(length / 2), 0])
|
|
flat_groove(len = height);
|
|
}
|
|
for(i = [90, 270]) {
|
|
rotate([0,0,i])
|
|
for (j = [0 : 15 : (length / BASIC_BLOCK_SIZE - 1) * BASIC_BLOCK_SIZE])
|
|
translate([j - (length / 2) + BASIC_BLOCK_HALF, -(width / 2), 0])
|
|
flat_groove(len = height);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ********************
|
|
// ** Build section: **
|
|
// ********************
|
|
module main() {
|
|
if (type == 1) {
|
|
stepper_housing();
|
|
}
|
|
else if (type == 2) {
|
|
shaft_coupler();
|
|
}
|
|
else if (type == 3) {
|
|
gear_wheel();
|
|
}
|
|
else if (type == 4) {
|
|
bevelgears(teeth=10);
|
|
}
|
|
}
|
|
|
|
main();
|