Merge pull request #23 from D-Byte/patch-1

Patch 1
pull/26/merge
Carlos Garcia Saura 2014-11-29 21:58:39 +00:00
commit 2fdaebc1d6
3 changed files with 69 additions and 25 deletions

View File

@ -23,6 +23,7 @@ module Cyclone_YsubPart_nutHolder() {
rodSize = 8; // M3, M4, etc (integers only)
washer_D = 15.8;
washer_thickness = 1.6;
screwSize = 3; // M3, M4, etc (integers only)
difference() {
// Main shape
@ -58,10 +59,10 @@ module Cyclone_YsubPart_nutHolder() {
// Holes for the supporting screws
translate([0,-screwSeparation/2,workbed_separation_from_Y_threaded_rod+workbed_thickness])
rotate([90,0,0])
hole_for_screw(size=3,length=workbed_thickness+footThickness,nutDepth=-dimZ,nutAddedLen=dimZ,captiveLen=0);
hole_for_screw(size=screwSize,length=workbed_thickness+footThickness,nutDepth=-dimZ,nutAddedLen=dimZ,captiveLen=0);
translate([0,+screwSeparation/2,workbed_separation_from_Y_threaded_rod+workbed_thickness])
rotate([90,0,0])
hole_for_screw(size=3,length=workbed_thickness+footThickness,nutDepth=-dimZ,nutAddedLen=dimZ,captiveLen=0);
hole_for_screw(size=screwSize,length=workbed_thickness+footThickness,nutDepth=-dimZ,nutAddedLen=dimZ,captiveLen=0);
}
translate([0,dimY/2+rod_nut_len/2,0])
rotate([0,90,0]) rotate([90,0,0]) nut(size=8, echoPart=true);
@ -150,8 +151,6 @@ module Cyclone_YsubPart_PCBholder() {
PCB_holder_edge_length = 3;
PCB_holder_tolerance = 1;
screwSeparation = 2.5;
holderArmLength = 30;
holderL_thickness = 2;
@ -159,6 +158,9 @@ module Cyclone_YsubPart_PCBholder() {
holderL_width = workbed_size_Y-PCB_dimY-PCB_holder_tolerance*2;
holderL_innerWidth = holderL_width/2;
screwSize = 3; // M3, M4, etc (integers only)
screwSeparation = screwSize*0.84;
// Draw the PCB (transparent)
%translate([0,0,PCBholder_height])
color([0.2,0.6,0, 1]) cube([PCB_dimX+PCB_holder_tolerance*2,PCB_dimY+PCB_holder_tolerance*2,PCB_dimZ], center=true);
@ -183,13 +185,13 @@ module Cyclone_YsubPart_PCBholder() {
// Holes for the screws
for (x = [-1,1], y=[-1,0,1]) {
translate([x*(PCB_dimX/2+screwSeparation),y*PCB_dimY/4,PCBholder_height+2.9])
rotate([0,0,x*-90]) rotate([90,0,0]) hole_for_screw(size=3,length=PCBholder_height+3,nutDepth=4.5,nutAddedLen=0,captiveLen=10, rot=90);
translate([x*(PCB_dimX/2+screwSeparation),y*PCB_dimY/4,PCBholder_height+screwSize])
rotate([0,0,x*-90]) rotate([90,0,0]) hole_for_screw(size=screwSize,length=PCBholder_height+3,nutDepth=4.5,nutAddedLen=0,captiveLen=10, rot=90);
}
translate([PCB_dimX/2-holderArmLength/2,PCB_dimY/2+screwSeparation,PCBholder_height+2.9])
rotate([90,0,0]) hole_for_screw(size=3,length=PCBholder_height+3,nutDepth=4.5,nutAddedLen=0,captiveLen=10, rot=90);
scale([-1,-1,1]) translate([PCB_dimX/2-holderArmLength/2,PCB_dimY/2+screwSeparation,PCBholder_height+2.9])
rotate([90,0,0]) hole_for_screw(size=3,length=PCBholder_height+3,nutDepth=4.5,nutAddedLen=0,captiveLen=10, rot=90);
translate([PCB_dimX/2-holderArmLength/2,PCB_dimY/2+screwSeparation,PCBholder_height+screwSize])
rotate([90,0,0]) hole_for_screw(size=screwSize,length=PCBholder_height+3,nutDepth=4.5,nutAddedLen=0,captiveLen=10, rot=90);
scale([-1,-1,1]) translate([PCB_dimX/2-holderArmLength/2,PCB_dimY/2+screwSeparation,PCBholder_height+screwSize])
rotate([90,0,0]) hole_for_screw(size=screwSize,length=PCBholder_height+3,nutDepth=4.5,nutAddedLen=0,captiveLen=10, rot=90);
}
// Holder top L supports
@ -212,14 +214,14 @@ module Cyclone_YsubPart_PCBholder() {
// Holes for the screws
translate([0,0,holderL_thickness+(holderL_thickness+holderL_thickness_btm)/2]) {
for (x = [-1,1], y=[-1,0,1]) {
translate([x*(PCB_dimX/2+screwSeparation),y*PCB_dimY/4,PCBholder_height+2.9])
rotate([0,0,x*-90]) rotate([90,0,0]) hole_for_screw(size=3,length=PCBholder_height*10,nutDepth=4.5,nutAddedLen=0,captiveLen=10, rot=90);
translate([x*(PCB_dimX/2+screwSeparation),y*PCB_dimY/4,PCBholder_height+screwSize])
rotate([0,0,x*-90]) rotate([90,0,0]) hole_for_screw(size=screwSize,length=PCBholder_height*10,nutDepth=4.5,nutAddedLen=0,captiveLen=10, rot=90);
}
translate([PCB_dimX/2-holderArmLength/2,PCB_dimY/2+screwSeparation,PCBholder_height+2.9])
rotate([90,0,0]) hole_for_screw(size=3,length=PCBholder_height*10,nutDepth=4.5,nutAddedLen=0,captiveLen=10, rot=90);
scale([-1,-1,1]) translate([PCB_dimX/2-holderArmLength/2,PCB_dimY/2+screwSeparation,PCBholder_height+2.9])
rotate([90,0,0]) hole_for_screw(size=3,length=PCBholder_height*10,nutDepth=4.5,nutAddedLen=0,captiveLen=10, rot=90);
translate([PCB_dimX/2-holderArmLength/2,PCB_dimY/2+screwSeparation,PCBholder_height+screwSize])
rotate([90,0,0]) hole_for_screw(size=screwSize,length=PCBholder_height*10,nutDepth=4.5,nutAddedLen=0,captiveLen=10, rot=90);
scale([-1,-1,1]) translate([PCB_dimX/2-holderArmLength/2,PCB_dimY/2+screwSeparation,PCBholder_height+screwSize])
rotate([90,0,0]) hole_for_screw(size=screwSize,length=PCBholder_height*10,nutDepth=4.5,nutAddedLen=0,captiveLen=10, rot=90);
}
}
}

View File

@ -137,6 +137,48 @@ COURSE_METRIC_BOLT_MAJOR_THREAD_DIAMETERS =
35.940//m36
];
//Based on: http://www.roymech.co.uk/Useful_Tables/Screws/cap_screws.htm
METRIC_BOLT_CAP_DIAMETERS =
[
-1, //0 index is not used but reduces computation
-1,
-1,
5.50,//m3
7.00,//m4
8.50,//m5
10.00,//m6
-1,
13.00,//m8
-1,
16.00,//m10
-1,
18.00,//m12
-1,
-1,
-1,
24.00,//m16
-1,
-1,
-1,
30.00//m20
-1,
-1,
-1,
36.00,//m24
-1,
-1,
-1,
-1,
-1,
45.00,//m30
-1,
-1,
-1,
-1,
-1,
54.00//m36
];
module nutHole(size, units=MM, tolerance = +0.0001, proj = -1)
{
//takes a metric screw/nut size and looksup nut dimensions
@ -160,9 +202,8 @@ module nutHole(size, units=MM, tolerance = +0.0001, proj = -1)
module boltHole(size, units=MM, length, tolerance = +0.0001, proj = -1)
{
radius = COURSE_METRIC_BOLT_MAJOR_THREAD_DIAMETERS[size]/2+tolerance;
//TODO: proper screw cap values
capHeight = METRIC_NUT_THICKNESS[size]+tolerance; //METRIC_BOLT_CAP_HEIGHTS[size]+tolerance;
capRadius = METRIC_NUT_AC_WIDTHS[size]/2+tolerance; //METRIC_BOLT_CAP_RADIUS[size]+tolerance;
capHeight = size+tolerance;
capRadius = METRIC_BOLT_CAP_DIAMETERS[size]/2+tolerance;
if (proj == -1)
{

View File

@ -68,8 +68,7 @@ module beveledBase(size=[100,200,10], radius=10, res=15, renderPart=false, echoP
include <MCAD/nuts_and_bolts.scad>
module hole_for_screw(size=3,length=20,nutDepth=5,nutAddedLen=0,captiveLen=0,tolerance=0.4,rot=0,invert=false, echoPart=false) {
radius = METRIC_NUT_AC_WIDTHS[size]/2+tolerance;
module hole_for_screw(size=3,length=20,nutDepth=5,nutAddedLen=0,captiveLen=0,tolerance=0.02,rot=0,invert=false, echoPart=false) {
height = METRIC_NUT_THICKNESS[size]+tolerance;
rotate([0,0,invert ? 180 : 0])
translate([0,invert ? length/2 : -length/2,0]) {
@ -81,7 +80,7 @@ module hole_for_screw(size=3,length=20,nutDepth=5,nutAddedLen=0,captiveLen=0,tol
translate([0,captiveLen,0])
rotate([0,0,rot]) nutHole(size=size, tolerance=tolerance, proj=-1);
}
translate([0,length/2-height+0.01,0]) //TODO (from MCAD): proper screw cap values: instead of "height" will use METRIC_BOLT_CAP_HEIGHTS[size]+tolerance;
translate([0,length/2-size+tolerance,0])
rotate([90,0,0])
render() boltHole(size=size, length=length-2.6+0.5, tolerance=tolerance, proj=-1);
}
@ -118,8 +117,7 @@ module nut(size=8, chamfer=false, renderPart=false, echoPart=false) {
}
module hole_for_nut(size=3,nutAddedLen=0,captiveLen=0,rot=0,tolerance=0.35) {
radius = METRIC_NUT_AC_WIDTHS[size]/2+tolerance;
module hole_for_nut(size=3,nutAddedLen=0,captiveLen=0,rot=0,tolerance=0.035) {
height = METRIC_NUT_THICKNESS[size]+tolerance;
scale([1,(height+nutAddedLen)/height,1])
rotate([90,0,0])
@ -137,7 +135,7 @@ module screw_single(size=3,length=10,tolerance=0, renderPart=false, echoPart=fal
renderStandardPart(renderPart)
difference() {
translate([0,-length/2,0]) {
translate([0,length/2-height+0.01,0]) //TODO (from MCAD): proper screw cap values: instead of "height" will use METRIC_BOLT_CAP_HEIGHTS[size]+tolerance;
translate([0,length/2-size+tolerance,0])
rotate([90,0,0])
boltHole(size=size, length=length-2.6+0.5, tolerance=tolerance, proj=-1);
}
@ -162,6 +160,9 @@ module stepperMotor_mount(height, tolerance=0.15, slide_distance=6, sideLen=42.2
else
translate([0,0,-25]) bcube([sideLen+2*tolerance,sideLen+slide_distance+2*tolerance,50],cr=3,cres=10);
}
scale([1,1,height]) {
stepper_motor_mount(nema_standard=17, slide_distance=slide_distance, mochup=false);
}
}
module stepperMotor(screwHeight=10, renderPart=false, echoPart=false) {