cyclone-pcb-factory/Hardware/CYCLONE_2/Cyclone_X_frames.scad

306 lines
12 KiB
OpenSCAD
Raw Normal View History

// This file is part of Cyclone PCB Factory: an open-source 3D printable CNC machine for PCB manufacture
// http://reprap.org/wiki/Cyclone_PCB_Factory
// Original author: Carlosgs (http://carlosgs.es)
// License: CC BY-SA 4.0 (Attribution-ShareAlike 4.0 International, http://creativecommons.org/licenses/by-sa/4.0/)
// Designed with http://www.openscad.org/
2014-07-18 23:42:06 +07:00
Xmotor_sideLen = 42.20;
2014-07-17 00:37:42 +07:00
axes_XgearSeparation = 37;
axes_XgearRatio = 21/21; // Number of tooth (motor/rod)
2014-08-19 21:57:26 +07:00
axes_XgearThickness = 10;
X_frames_additional_thickness = 5;
2014-07-17 00:37:42 +07:00
module Cyclone_X_rightFrame() {
2014-07-17 00:37:42 +07:00
scale([-1,1,1]) Cyclone_X_leftFrame(isLeft=false);
}
include <MCAD/stepper.scad>
2014-07-17 00:37:42 +07:00
module Cyclone_X_leftFrame(isLeft=true) {
screwSize = 3; // M3, M4, etc (integers only)
motorWallSeparation = 5;
motorRotatedOffset = 10;
gearWallSeparation = 5;
partThickness = X_frames_additional_thickness+screwSize*2;
2014-07-17 00:37:42 +07:00
dimX = partThickness;
2014-07-18 23:42:06 +07:00
dimY = max(-axes_Xreference_posY,axes_Xsmooth_separation+axes_XgearSeparation*cos(motorRotatedOffset)+Xmotor_sideLen/2+2);
2014-07-17 00:37:42 +07:00
dimZ = axes_Yreference_height+axes_Xreference_height+axes_Xsmooth_separation;
footSeparation = screwSize*3;
footThickness = 10;
footWidth = dimX+2*footSeparation;
bearingDepth = 3;
corner_radius = 10;
2014-09-10 22:03:07 +07:00
2014-08-19 21:57:26 +07:00
module Cyclone_XsubPart_gearCover() {
margin = 4;
2014-09-10 22:03:07 +07:00
rodGearAddedMargin = 1;
wallThickness = 0.4*4;
screwHeadSpaceHeight = 4;
screwHeadSpaceDiam = 7;
coverHeight = 16;
coverExtraHeight = 5;
coverExtraRadius = -7;
nema_screw_separation = lookup(NemaDistanceBetweenMountingHoles, Nema17);
motorGearRadius = axes_XgearSeparation/(1+axes_XgearRatio)+margin;
rodGearRadius = axes_XgearSeparation/(1+1/axes_XgearRatio)+margin+rodGearAddedMargin;
difference() {
union() {
// Cover for the rod gear
rotate([0,90,0])
cylinder(r=rodGearRadius+wallThickness, h=coverHeight);
translate([coverHeight,0,0])
rotate([0,90,0])
cylinder(r1=rodGearRadius+wallThickness, r2=rodGearRadius+wallThickness+coverExtraRadius, h=coverExtraHeight+wallThickness);
// Translate to motor position
rotate([motorRotatedOffset,0,0]) {
translate([0,axes_XgearSeparation,0])
rotate([-motorRotatedOffset,0,0]) {
// Cover for the motor gear
rotate([0,90,0]) cylinder(r=motorGearRadius+wallThickness, h=coverHeight);
translate([coverHeight,0,0])
rotate([0,90,0]) cylinder(r1=motorGearRadius+wallThickness, r2=motorGearRadius+wallThickness+coverExtraRadius, h=coverExtraHeight+wallThickness);
// Cylinder for the support screw
translate([0,-nema_screw_separation/2,nema_screw_separation/2])
rotate([0,90,0]) cylinder(r=screwHeadSpaceDiam/2+wallThickness, h=coverHeight);
}
}
}
translate([-0.02,0,0])
union() {
// Hole for the rod gear
rotate([0,90,0])
cylinder(r=rodGearRadius, h=coverHeight);
translate([coverHeight-0.02,0,0])
rotate([0,90,0])
cylinder(r1=rodGearRadius, r2=rodGearRadius+coverExtraRadius, h=coverExtraHeight);
rotate([0,90,0])
cylinder(r=rodGearRadius+coverExtraRadius, h=coverHeight+coverExtraHeight+wallThickness+0.1);
// Translate to motor position
rotate([motorRotatedOffset,0,0]) {
translate([0,axes_XgearSeparation,0])
rotate([-motorRotatedOffset,0,0]) {
difference() {
union() {
// Hole for the motor gear
rotate([0,90,0]) cylinder(r=motorGearRadius, h=coverHeight);
translate([coverHeight-0.02,0,0])
rotate([0,90,0]) cylinder(r1=motorGearRadius, r2=motorGearRadius+coverExtraRadius, h=coverExtraHeight);
rotate([0,90,0]) cylinder(r=motorGearRadius+coverExtraRadius, h=coverHeight+coverExtraHeight+wallThickness+0.1);
// Outer hole for the support screw
translate([0,-nema_screw_separation/2,nema_screw_separation/2])
rotate([0,90,0]) cylinder(r=screwHeadSpaceDiam/2, h=coverHeight+coverExtraHeight);
}
// Support screw holder
translate([0,-nema_screw_separation/2,nema_screw_separation/2])
rotate([0,90,0]) cylinder(r=screwHeadSpaceDiam/2+wallThickness, h=wallThickness);
}
// Inner hole for the support screw
translate([0,-nema_screw_separation/2,nema_screw_separation/2])
rotate([0,90,0]) cylinder(r=(screwSize+1)/2, h=coverHeight+0.1);
// Holes for the other two screws
translate([0,nema_screw_separation/2,-nema_screw_separation/2])
rotate([0,90,0]) cylinder(r=screwHeadSpaceDiam/2, h=screwHeadSpaceHeight);
translate([0,-nema_screw_separation/2,-nema_screw_separation/2])
rotate([0,90,0]) cylinder(r=screwHeadSpaceDiam/2, h=screwHeadSpaceHeight);
}
}
}
}
}
2014-07-17 00:37:42 +07:00
module Cyclone_X_endstopHolder(holes=false) {
// Endstop holder
translate([-partThickness-0.04,19,-5+axes_Xsmooth_separation])
rotate([-60,0,0]) {
rotate([0,0,-90]) mirror([1,0,0]) endstop_holder(holes, shortNuts=true);
if(holes)
cube([partThickness+1,100,50]);
}
}
2014-07-17 00:37:42 +07:00
difference() {
// Main block
union() {
translate([-axes_Xreference_posX-dimX-0.01,axes_Xreference_posY,-axes_Yreference_height]) {
cube([dimX,dimY,dimZ-axes_Xsmooth_separation]);
translate([-footWidth/2+dimX,dimY/2,footThickness/2]) bcube([footWidth,dimY,footThickness], cr=corner_radius, cres=10);
2014-07-17 00:37:42 +07:00
}
rodHolder(rodD=axes_Ysmooth_rodD, screwSize=screwSize, height=axes_Yreference_height, sideLen=-axes_Xreference_posX-1);
// TRANSLATE REFERENCE POSITION to the left frame, X lower smooth rod end
translate([-axes_Xreference_posX,axes_Xreference_posY,axes_Xreference_height]) {
// TRANSLATE REFERENCE POSITION to the threaded rod
translate([-0.01,axes_Xsmooth_separation,0]) {
rotate([0,-90,0]) cylinder(r=axes_Xsmooth_separation,h=partThickness);
if(!isLeft)
Cyclone_X_endstopHolder(holes=false);
2014-07-17 00:37:42 +07:00
}
}
}
// TRANSLATE REFERENCE POSITION to the left frame, X lower smooth rod end
translate([-axes_Xreference_posX,axes_Xreference_posY,axes_Xreference_height]) {
rotate([0,0,90]) standard_rod(diam=axes_Xsmooth_rodD, length=partThickness*4, threaded=false, renderPart=true, center=true);
rotate([0,0,-90])
rotate([0,90,0])
rodHolder(rodD=axes_Xsmooth_rodD, screwSize=screwSize, negative=true);
// TRANSLATE REFERENCE POSITION to the threaded rod
2014-07-22 21:48:58 +07:00
translate([+0.01,axes_Xsmooth_separation,0]) {
// Plastic saving holes
2014-07-17 00:37:42 +07:00
translate([0,-15,-40]) rotate([0,-90,0]) cylinder(r=15,h=partThickness*2);
translate([0,30,-40]) rotate([0,-90,0]) cylinder(r=15,h=partThickness*2);
translate([0,-15,-80]) rotate([0,-90,0]) cylinder(r=15,h=partThickness*2);
rotate([0,-90,0]) bearingHole(depth=bearingDepth, thickness=partThickness);
2014-07-17 00:37:42 +07:00
// Translate to motor position
if(isLeft)
translate([-motorWallSeparation,0,0])
rotate([motorRotatedOffset,0,0])
translate([0,axes_XgearSeparation,0])
rotate([-motorRotatedOffset,0,0])
rotate([0,90,0]) stepperMotor_mount(motorWallSeparation, sideLen=Xmotor_sideLen, slideOut=true);
// Endstop holder
if(!isLeft)
Cyclone_X_endstopHolder(holes=true);
2014-07-17 00:37:42 +07:00
translate([0,0,axes_Xsmooth_separation]) {
rotate([0,0,90]) standard_rod(diam=axes_Xsmooth_rodD, length=partThickness*4, threaded=false, renderPart=true, center=true);
rotate([0,0,-90])
rodHolder(rodD=axes_Xsmooth_rodD, screwSize=screwSize, negative=true);
}
}
}
// Holes for the screws
translate([-axes_Xreference_posX-dimX-footSeparation,axes_Xreference_posY+footSeparation,-axes_Yreference_height+footThickness]) {
rotate([0,90,0])
rotate([0,0,90])
hole_for_screw(size=screwSize,length=footThickness+base_thickness,nutDepth=0,nutAddedLen=0,captiveLen=0, invert=true);
2014-07-18 23:42:06 +07:00
translate([0,dimY/2,0])
2014-07-17 00:37:42 +07:00
rotate([0,90,0])
rotate([0,0,90])
hole_for_screw(size=screwSize,length=footThickness+base_thickness,nutDepth=0,nutAddedLen=0,captiveLen=0, invert=true);
2014-07-17 00:37:42 +07:00
translate([0,dimY-2*footSeparation,0])
rotate([0,90,0])
rotate([0,0,90])
hole_for_screw(size=screwSize,length=footThickness+base_thickness,nutDepth=0,nutAddedLen=0,captiveLen=0, invert=true);
}
2014-07-17 00:37:42 +07:00
}
// Draw rod holders, motor, gears, screws
// TRANSLATE REFERENCE POSITION to the left frame, X lower smooth rod end
translate([-axes_Xreference_posX,axes_Xreference_posY,axes_Xreference_height]) {
if(draw_references) color("red") %frame(20);
rotate([0,0,-90])
rotate([0,90,0])
rodHolder(rodD=axes_Ysmooth_rodD, screwSize=screwSize);
// TRANSLATE REFERENCE POSITION to the threaded rod
translate([0,axes_Xsmooth_separation,0]) {
if(draw_references) color("green") %frame(20);
translate([-bearingDepth,0,0]) rotate([0,90,0])
radialBearing(echoPart=true);
2014-07-17 00:37:42 +07:00
if(isLeft) {
2014-08-19 22:50:51 +07:00
translate([gearWallSeparation,0,0]) rotate([0,90,0])
rodGear(r=axes_XgearSeparation/(1+1/axes_XgearRatio), h=axes_XgearThickness, echoPart=true);
// Translate to motor position
rotate([motorRotatedOffset,0,0]) {
translate([0,axes_XgearSeparation,0])
rotate([-motorRotatedOffset,0,0]) {
translate([-motorWallSeparation,0,0]) rotate([0,90,0]) stepperMotor(screwHeight=motorWallSeparation, echoPart=true);
translate([gearWallSeparation,0,0]) rotate([0,90,0]) motorGear(r=axes_XgearSeparation/(1+axes_XgearRatio), h=axes_XgearThickness, echoPart=true);
}
}
2014-09-10 22:03:07 +07:00
translate([0.1,0,0])
Cyclone_XsubPart_gearCover();
2014-07-17 00:37:42 +07:00
}
translate([0,0,axes_Xsmooth_separation])
rotate([0,0,-90])
rodHolder(rodD=axes_Ysmooth_rodD, screwSize=screwSize);
}
2014-07-17 00:37:42 +07:00
}
translate([-axes_Xreference_posX-dimX-footSeparation,axes_Xreference_posY+footSeparation,-axes_Yreference_height+footThickness]) {
rotate([0,90,0])
rotate([0,0,90])
screw_and_nut(size=screwSize,length=footThickness+base_thickness,nutDepth=0,nutAddedLen=0,captiveLen=0, invert=true, autoNutOffset=true, echoPart=true);
2014-07-18 23:42:06 +07:00
translate([0,dimY/2,0])
2014-07-17 00:37:42 +07:00
rotate([0,90,0])
rotate([0,0,90])
screw_and_nut(size=screwSize,length=footThickness+base_thickness,nutDepth=0,nutAddedLen=0,captiveLen=0, invert=true, autoNutOffset=true, echoPart=true);
2014-07-17 00:37:42 +07:00
translate([0,dimY-2*footSeparation,0])
rotate([0,90,0])
rotate([0,0,90])
screw_and_nut(size=screwSize,length=footThickness+base_thickness,nutDepth=0,nutAddedLen=0,captiveLen=0, invert=true, autoNutOffset=true, echoPart=true);
2014-07-17 00:37:42 +07:00
}
}
2014-07-17 00:37:42 +07:00
module rodHolder(rodD=8.5, screwSize=3, height=0, sideLen=0, thickness=5, space=2, negative=false) {
screwAditionalDistance = rodD/2;
dimX = rodD+4*screwSize+screwAditionalDistance;
dimY = X_frames_additional_thickness+screwSize*2;
2014-07-17 00:37:42 +07:00
dimZ = rodD/2+thickness;
corner_radius = 4;
2014-07-17 00:37:42 +07:00
if(negative) {
translate([screwSize+screwAditionalDistance,-dimY/2,dimZ])
rotate([-90,0,0])
rotate([0,0,180])
hole_for_screw(size=screwSize,length=dimZ+15,nutDepth=5,nutAddedLen=0,captiveLen=10, rot=90);
2014-07-17 00:37:42 +07:00
translate([-screwSize-screwAditionalDistance,-dimY/2,dimZ])
rotate([-90,0,0])
rotate([0,0,180])
hole_for_screw(size=screwSize,length=dimZ+15,nutDepth=5,nutAddedLen=0,captiveLen=10, rot=90);
2014-07-17 00:37:42 +07:00
} else {
difference() {
union() {
translate([0,-dimY/2,dimZ/2+space/4]) bcube([dimX,dimY,dimZ-space/2],cr=corner_radius,cres=10);
2014-07-17 00:37:42 +07:00
if(sideLen>dimX/2)
translate([sideLen/2-dimX/4,-dimY/2,-height/2-space/4]) bcube([dimX/2+sideLen,dimY,height-space/2],cr=corner_radius,cres=10);
2014-07-17 00:37:42 +07:00
else
translate([0,-dimY/2,-height/2-space/4]) bcube([dimX,dimY,height-space/2],cr=corner_radius,cres=10);
2014-07-17 00:37:42 +07:00
}
translate([screwSize+screwAditionalDistance,-dimY/2,dimZ])
rotate([-90,0,0])
rotate([0,0,180])
hole_for_screw(size=screwSize,length=dimZ+15,nutDepth=5,nutAddedLen=0,captiveLen=10, rot=90);
2014-07-17 00:37:42 +07:00
translate([-screwSize-screwAditionalDistance,-dimY/2,dimZ])
rotate([-90,0,0])
rotate([0,0,180])
hole_for_screw(size=screwSize,length=dimZ+15,nutDepth=5,nutAddedLen=0,captiveLen=10, rot=90);
2014-07-17 00:37:42 +07:00
standard_rod(diam=rodD, length=dimY*4, threaded=false, renderPart=true, center=true);
rodHolder(rodD=rodD, screwSize=screwSize, negative=true);
}
// Draw screws
translate([screwSize+screwAditionalDistance,-dimY/2,dimZ+0.01])
rotate([-90,0,0])
rotate([0,0,180])
screw_and_nut(size=screwSize,length=dimZ+15,nutDepth=5,nutAddedLen=0,captiveLen=0, rot=90, echoPart=true);
2014-07-17 00:37:42 +07:00
translate([-screwSize-screwAditionalDistance,-dimY/2,dimZ+0.01])
rotate([-90,0,0])
rotate([0,0,180])
screw_and_nut(size=screwSize,length=dimZ+15,nutDepth=5,nutAddedLen=0,captiveLen=0, rot=90, echoPart=true);
2014-07-17 00:37:42 +07:00
}
}
2014-07-17 00:37:42 +07:00