Added a tolerance parameter tor motors.scad, by D1plo1d

This commit is contained in:
Elmom 2011-02-03 11:04:02 +02:00
parent 5c9ef60e04
commit 0cec0328ec

View file

@ -6,8 +6,7 @@ include <math.scad>
//generates a motor mount for the specified nema standard #.
module stepper_motor_mount(nema_standard,slide_distance=0, mochup=true)
{
module stepper_motor_mount(nema_standard,slide_distance=0, mochup=true, tolerance=0) {
//dimensions from:
// http://www.numberfactory.com/NEMA%20Motor%20Dimensions.htm
if (nema_standard == 17)
@ -21,7 +20,8 @@ module stepper_motor_mount(nema_standard,slide_distance=0, mochup=true)
bolt_hole_size = 3.5,
bolt_hole_distance = 1.220*mm_per_inch,
slide_distance = slide_distance,
mochup = mochup);
mochup = mochup,
tolerance=tolerance);
}
if (nema_standard == 23)
{
@ -34,7 +34,8 @@ module stepper_motor_mount(nema_standard,slide_distance=0, mochup=true)
bolt_hole_size = 0.195*mm_per_inch,
bolt_hole_distance = 1.856*mm_per_inch,
slide_distance = slide_distance,
mochup = mochup);
mochup = mochup,
tolerance=tolerance);
}
}
@ -51,16 +52,17 @@ module _stepper_motor_mount(
bolt_hole_distance,
slide_distance = 0,
motor_length = 40, //arbitray - not standardized
mochup
mochup,
tolerance = 0
)
{
union()
{
// == centered mount points ==
//mounting circle inset
translate([0,slide_distance/2,0]) circle(r = pilot_diameter/2);
translate([0,slide_distance/2,0]) circle(r = pilot_diameter/2 + tolerance);
square([pilot_diameter,slide_distance],center=true);
translate([0,-slide_distance/2,0]) circle(r = pilot_diameter/2);
translate([0,-slide_distance/2,0]) circle(r = pilot_diameter/2 + tolerance);
//todo: motor shaft hole
@ -71,9 +73,9 @@ module _stepper_motor_mount(
{
translate([x*bolt_hole_distance/2,y*bolt_hole_distance/2,0])
{
translate([0,slide_distance/2,0]) circle(bolt_hole_size/2);
translate([0,-slide_distance/2,0]) circle(bolt_hole_size/2);
square([bolt_hole_size,slide_distance],center=true);
translate([0,slide_distance/2,0]) circle(bolt_hole_size/2 + tolerance);
translate([0,-slide_distance/2,0]) circle(bolt_hole_size/2 + tolerance);
square([bolt_hole_size+2*tolerance,slide_distance],center=true);
}
}
}