From ae61080e3b733c6173e71975a9b6896406f7cd57 Mon Sep 17 00:00:00 2001 From: Ben Howes Date: Tue, 9 Oct 2012 16:09:56 +0100 Subject: [PATCH 1/4] added an epsilon to the inside diameter of the rings to prevent bolts through holes resulting in 'WARNING: CSG normalisation resulted in empty tree' --- bearing.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bearing.scad b/bearing.scad index 2efea7ec..5f8dd17d 100644 --- a/bearing.scad +++ b/bearing.scad @@ -84,7 +84,7 @@ module bearing(pos=[0,0,0], angle=[0,0,0], model=SkateBearing, outline=false, cylinder(r=od/2, h=h, $fs = 0.01); color(holeMaterial) translate([0,0,-10*epsilon]) - cylinder(r=id/2, h=h+20*epsilon, $fs = 0.01); + cylinder(r=(id/2)+epsilon, h=h+20*epsilon, $fs = 0.01); } } } From 16128b6bd0cea0fe79eda5e751d7c2f78cc87410 Mon Sep 17 00:00:00 2001 From: Ben Howes Date: Wed, 10 Oct 2012 12:57:55 +0100 Subject: [PATCH 2/4] switched to using cubes for hexagons --- nuts_and_bolts.scad | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/nuts_and_bolts.scad b/nuts_and_bolts.scad index 8cb2a87e..011eab68 100644 --- a/nuts_and_bolts.scad +++ b/nuts_and_bolts.scad @@ -1,4 +1,7 @@ +include // Copyright 2010 D1plo1d +// modified by Ben Howes 2012 +// uses hexagon module from https://github.com/josefprusa/PrusaMendel // This library is dual licensed under the GPL 3.0 and the GNU Lesser General Public License as per http://creativecommons.org/licenses/LGPL/2.1/ . @@ -137,14 +140,23 @@ COURSE_METRIC_BOLT_MAJOR_THREAD_DIAMETERS = 35.940//m36 ]; +module hexagon(height, depth) { + boxWidth=height/1.75; + union(){ + cube([boxWidth, height, depth], true); + rotate([0,0,60]) cube([boxWidth, height, depth], true); + rotate([0,0,-60]) cube([boxWidth, height, depth], true); + } +} + module nutHole(size, units=MM, tolerance = +0.0001, proj = -1) { //takes a metric screw/nut size and looksup nut dimensions - radius = METRIC_NUT_AC_WIDTHS[size]/2+tolerance; - height = METRIC_NUT_THICKNESS[size]+tolerance; + radius = METRIC_NUT_AC_WIDTHS[size]+2*tolerance; + height = METRIC_NUT_THICKNESS[size]+tolerance*2; if (proj == -1) { - cylinder(r= radius, h=height, $fn = 6, center=[0,0]); + translate([0,0,(height/2)-tolerance]) hexagon(height=radius, depth=height); } if (proj == 1) { @@ -166,8 +178,8 @@ module boltHole(size, units=MM, length, tolerance = +0.0001, proj = -1) if (proj == -1) { - translate([0, 0, -capHeight]) - cylinder(r= capRadius, h=capHeight); + translate([0, 0, -capHeight-epsilon]) + cylinder(r= capRadius, h=capHeight+2*epsilon); cylinder(r = radius, h = length); } if (proj == 1) From 48c511d2a12cba9895d1eeeaade0022be18280a7 Mon Sep 17 00:00:00 2001 From: Ben Howes Date: Fri, 3 Jan 2014 15:23:07 +0000 Subject: [PATCH 3/4] added 626 bearing size --- bearing.scad | 1 + 1 file changed, 1 insertion(+) diff --git a/bearing.scad b/bearing.scad index 2efea7ec..0e272255 100644 --- a/bearing.scad +++ b/bearing.scad @@ -38,6 +38,7 @@ function bearingDimensions(model) = model == 608 ? [8*mm, 22*mm, 7*mm]: model == 623 ? [3*mm, 10*mm, 4*mm]: model == 624 ? [4*mm, 13*mm, 5*mm]: + model == 626 ? [6*mm, 19*mm, 6*mm]: model == 627 ? [7*mm, 22*mm, 7*mm]: model == 688 ? [8*mm, 16*mm, 4*mm]: model == 698 ? [8*mm, 19*mm, 6*mm]: From c5007f431aaf87997bf808818aa8f2245c2fdbdd Mon Sep 17 00:00:00 2001 From: Ben Howes Date: Fri, 3 Jan 2014 17:46:03 +0000 Subject: [PATCH 4/4] use a numeric nema code for the motor number - could not get lookup to work though --- stepper.scad | 81 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 24 deletions(-) diff --git a/stepper.scad b/stepper.scad index c19d4afc..c41747df 100644 --- a/stepper.scad +++ b/stepper.scad @@ -135,7 +135,7 @@ Nema17 = [ [NemaRoundExtrusionDiameter, 22*mm], [NemaRoundExtrusionHeight, 1.9*mm], [NemaAxleDiameter, 5*mm], - [NemaFrontAxleLength, 18*mm], + [NemaFrontAxleLength, 21*mm], [NemaBackAxleLength, 15*mm], [NemaAxleFlatDepth, 0.5*mm], [NemaAxleFlatLengthFront, 15*mm], @@ -186,6 +186,43 @@ Nema34 = [ [NemaAxleFlatLengthBack, 25*mm] ]; +NemaDefinitions = [ + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + Nema08, + -1, + -1, + Nema11, + -1, + -1, + Nema14, + -1, + -1, + Nema17, + -1, + -1, + -1, + -1, + -1, + Nema23, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + Nema34 +]; function motorWidth(model=Nema23) = lookup(NemaSideSize, model); @@ -194,36 +231,38 @@ function motorLength(model=Nema23, size=NemaMedium) = lookup(size, model); module motor(model=Nema23, size=NemaMedium, dualAxis=false, pos=[0,0,0], orientation = [0,0,0]) { - length = lookup(size, model); + motorDef = NemaDefinitions[model]; + echo(NemaDefinitions[14]); + length = lookup(size, motorDef); - echo(str(" Motor: Nema",lookup(NemaModel, model),", length= ",length,"mm, dual axis=",dualAxis)); + echo(str(" Motor: Nema",lookup(NemaModel, motorDef),", length= ",length,"mm, dual axis=",dualAxis)); stepperBlack = BlackPaint; stepperAluminum = Aluminum; - side = lookup(NemaSideSize, model); + side = lookup(NemaSideSize, motorDef); - cutR = lookup(NemaMountingHoleCutoutRadius, model); - lip = lookup(NemaMountingHoleLip, model); - holeDepth = lookup(NemaMountingHoleDepth, model); + cutR = lookup(NemaMountingHoleCutoutRadius, motorDef); + lip = lookup(NemaMountingHoleLip, motorDef); + holeDepth = lookup(NemaMountingHoleDepth, motorDef); - axleLengthFront = lookup(NemaFrontAxleLength, model); - axleLengthBack = lookup(NemaBackAxleLength, model); - axleRadius = lookup(NemaAxleDiameter, model) * 0.5; + axleLengthFront = lookup(NemaFrontAxleLength, motorDef); + axleLengthBack = lookup(NemaBackAxleLength, motorDef); + axleRadius = lookup(NemaAxleDiameter, motorDef) * 0.5; - extrSize = lookup(NemaRoundExtrusionHeight, model); - extrRad = lookup(NemaRoundExtrusionDiameter, model) * 0.5; + extrSize = lookup(NemaRoundExtrusionHeight, motorDef); + extrRad = lookup(NemaRoundExtrusionDiameter, motorDef) * 0.5; - holeDist = lookup(NemaDistanceBetweenMountingHoles, model) * 0.5; - holeRadius = lookup(NemaMountingHoleDiameter, model) * 0.5; + holeDist = lookup(NemaDistanceBetweenMountingHoles, motorDef) * 0.5; + holeRadius = lookup(NemaMountingHoleDiameter, motorDef) * 0.5; mid = side / 2; - roundR = lookup(NemaEdgeRoundingRadius, model); + roundR = lookup(NemaEdgeRoundingRadius, motorDef); - axleFlatDepth = lookup(NemaAxleFlatDepth, model); - axleFlatLengthFront = lookup(NemaAxleFlatLengthFront, model); - axleFlatLengthBack = lookup(NemaAxleFlatLengthBack, model); + axleFlatDepth = lookup(NemaAxleFlatDepth, motorDef); + axleFlatLengthFront = lookup(NemaAxleFlatLengthFront, motorDef); + axleFlatLengthBack = lookup(NemaAxleFlatLengthBack, motorDef); color(stepperBlack){ translate(pos) rotate(orientation) { @@ -305,9 +344,3 @@ module motor(model=Nema23, size=NemaMedium, dualAxis=false, pos=[0,0,0], orienta } } } - -module roundedBox(size, edgeRadius) { - cube(size); - -} -