/* Complex test file Written by Nate Graham, 2013 License: MIT */ // Dimensions // ========== m3r=3.7/2; m3nr=6.3/2; m3nh=3; m6r=6.7/2; // Fasteners // ========= module bolt(diameter=6, length=12, pan_head=true, washer=true){ color([0.5,0.5,0.5]) union(){ if (pan_head){ translate([0,0,-1]) difference(){ // Pan head sphere(r=diameter, $fn=22); translate([0,0,-8]) cube([20,20,20], center=true); translate([0,0,7]) cube([20,20,5], center=true); // Hex hole translate([0,0,2.1]) cylinder(r=diameter/2,h=diameter+2,$fn=6); } } else { difference(){ // Cylindrical head cylinder(r=diameter-0.5,h=diameter-0.5); // Hex hole translate([0,0,diameter/2]) cylinder(r=diameter/2,h=diameter+2,$fn=6); } } // Washer cylinder(r=diameter*1.15,h=1); // Threaded rod part translate([0,0,-length]) cylinder(r=diameter/2,h=length); } } // bolt(diameter=4, length=12, pan_head=false); // Igus DryLin linear rails // ======================== module igus_rail(length=80, bolts=false) { number_of_holes = ceil(length/120); echo(number_of_holes); color([0.7,0.7,0.7]) difference(){ union() { // Bottom flat plate translate([-20,0,0]) cube([40,length,5]); // Rounded rails translate([-20,0,9]) rotate([-90,0,0]) cylinder(r=5, h=length, $fn=32); translate([20,0,9]) rotate([-90,0,0]) cylinder(r=5, h=length, $fn=32); // rail braces translate([-19.5,0,4]) rotate([0,30,0]) cube([6,length,4]); translate([14.5,0,1]) rotate([0,-30,0]) cube([6,length,4]); } // Subtract screw holes for(i = [0:number_of_holes-1] ){ // hole_pos = (length/2 - (120*floor(number_of_holes/2)) + i*120); translate([0,(length/2 - (120*floor(number_of_holes/2)) + i*120),-1]) cylinder(r=m6r, h=7); // if(bolts){ // translate([0,(length/2 - (120*floor(number_of_holes/2)) + i*120),-1]) bolt(diameter=6, length=12, pan_head=true); // } } } // Add bolts, if specified if(bolts){ for(i = [0:number_of_holes-1] ){ translate([0,(length/2 - (120*floor(number_of_holes/2)) + i*120),5]) bolt(); } } } module igus_pillow_block(bolts=false, bolt_protrusion=12) { color([0.7,0.7,0.7]) difference() { // Main block cube([26,29,16]); // Corner cut translate([15,-0.5,-0.5]) cube([15,30,7]); // Circular hole for rail guide translate([16.5,-0.5,8]) rotate([-90,0,0]) cylinder(r=5.2, h=30, $fn=32); // M6 screw holes translate([6.5,6.5,-0.5]) cylinder(r=m6r, h=17); translate([6.5,22.5,-0.5]) cylinder(r=m6r, h=17); } if(bolts){ translate([6.5,6.5,17+bolt_protrusion]) bolt(length=12+bolt_protrusion); translate([6.,22.5,17+bolt_protrusion]) bolt(length=12+bolt_protrusion); } } module igus_carriage(length=60, bolts=false, bolt_protrusion=4) { // Pillow blocks translate([-36.5,0,1]) igus_pillow_block(bolts=bolts, bolt_protrusion=bolt_protrusion); translate([36.5,29,1]) rotate([0,0,180]) igus_pillow_block(bolts=bolts, bolt_protrusion=bolt_protrusion); translate([-36.5,length-29,1]) igus_pillow_block(bolts=bolts, bolt_protrusion=bolt_protrusion); translate([36.5,length,1]) rotate([0,0,180]) igus_pillow_block(bolts=bolts, bolt_protrusion=bolt_protrusion); carriage_plate(length=length); } module carriage_plate(length=60){ difference(){ // Base plate translate([-36.5,0,17]) cube([73,length,4]); // M6 holes for(i=[-29.95,29.95]){ for (j=[6.5,22.5,length-22.5,length-6.5]){ translate([i,j,16]) cylinder(r=m6r, h=6, $fn=16); } } } } // igus_rail(length=270, bolts=true); // translate([0,0,00]) igus_carriage(length=62, bolts=false, bolt_protrusion=4); // translate([0,0,20]) igus_pillow_block(bolts=false, bolt_protrusion=0); // translate([0,0,-17]) carriage_plate(length=62); // POM ACME leadscrew nut // ====================== module POM_nut(){ cylinder(r=25.4/2,h=3.81, $fn=32); cylinder(r=12.07/2,h=19.05, $fn=32); } // Rubber foot // =========== module rubber_foot(){ color([0.3,0.2,0.2]) difference(){ // Base part cube([20,20,rubber_foot_height], center=true); // Side angle cuts translate([0,10,0]) rotate([-10,0,0]) cube([21,3,15], center=true); translate([0,-10,0]) rotate([10,0,0]) cube([21,3,15], center=true); translate([-10,0,0]) rotate([0,-10,0]) cube([3,21,15], center=true); translate([10,0,0]) rotate([0,10,0]) cube([3,21,15], center=true); } } // 20-tooth GT2 pulley // =================== module GT2_pulley(){ // 20-tooth GT2 pulley color([0.7,0.7,0.7]) difference(){ union(){ // Toothy part cylinder(r=6,h=8); // Rims translate([0,0,0]) cylinder(r=7.5,h=1); translate([0,0,7]) cylinder(r=7.5,h=1); // Top part where the set screws go translate([0,0,8]) cylinder(r=4.5,h=9); } // Hole for motor shaft translate([0,0,-1]) cylinder(r=2.5,h=21); } } // GT2 belt // ======== module GT2_belt(length=200, pulley_diameter=14, bend_position=0, bend_offset=0){ color([0.1,0.1,0.1]) difference(){ // Belt base union(){ translate([0,-pulley_diameter/2-1,0]) cube([length,pulley_diameter+2,6]); translate([length,0,0]) cylinder(r=pulley_diameter/2+1,h=6); translate([0,0,0]) cylinder(r=pulley_diameter/2+1,h=6); if(bend_position > 0){ // Make a belt with a "T" shape to accomodate a motor and two idlers translate([bend_position-(pulley_diameter/2)-1,0,0]) cube([pulley_diameter+2,bend_offset,6]); translate([bend_position,bend_offset,0]) cylinder(r=pulley_diameter/2+1,h=6); } } // Get rid of the interior to make it look like a belt :) union(){ translate([0,-pulley_diameter/2,-0.5]) cube([length,pulley_diameter,7]); translate([length,0,-0.5]) cylinder(r=pulley_diameter/2,h=7); translate([0,0,-0.5]) cylinder(r=pulley_diameter/2,h=7); if(bend_position > 0){ // Cutouts for the extra part translate([bend_position-(pulley_diameter/2),0,-0.5]) cube([pulley_diameter,bend_offset,7]); translate([bend_position,bend_offset,-0.5]) cylinder(r=pulley_diameter/2,h=7); } } } } // 623 bearing // =========== module 623_bearing(){ color([0.5,0.5,0.5]) difference(){ cylinder(r=5,h=4,center=true); cylinder(r=1.5,h=6,$fn=16,center=true); } } // 608 bearing // =========== module 608_bearing(){ color([0.5,0.5,0.5]) difference(){ cylinder(r=11,h=7,center=true); cylinder(r=4,h=8,$fn=16,center=true); } } // Hobbed gear // ========== module hobbed_gear(){ // Hobbed gear color([0.5,0.5,0.5]) difference(){ cylinder(r=13/2, h=11, $fn=32); translate([0,0,3]) rotate_extrude(convexity=10, $fn=32) translate([7.5, 0, 0]) circle(r=2, $fn=16); } } // Stepper motor // ============= module NEMA_17_motor(motor_length=60, shaft_length=25, shaft_diameter=5){ difference(){ color([0.1,0.1,0.1]) // Main body rotate([0,180,270]) cube([42,42,length]); // Screw holes translate([5.5,5.5,-9]) cylinder(r=1.5,h=10,$fn=8); translate([36.5,5.5,-9]) cylinder(r=1.5,h=10,$fn=8); translate([5.5,36.5,-9]) cylinder(r=1.5,h=10,$fn=8); translate([36.5,36.5,-9]) cylinder(r=1.5,h=10,$fn=8); // Corner bevels translate([0,0,-length/2]) rotate([0,0,45]) cube([7,7,length+2], center=true); translate([42,0,-length/2]) rotate([0,0,45]) cube([7,7,length+2], center=true); translate([0,42,-length/2]) rotate([0,0,45]) cube([7,7,length+2], center=true); translate([42,42,-length/2]) rotate([0,0,45]) cube([7,7,length+2], center=true); } // Top round bit difference(){ color([0.1,0.1,0.1]) translate([21,21,0]) cylinder(r=11,h=2, $fn=32); translate([21,21,0]) cylinder(r=5,h=4, $fn=32); } // Shaft color([0.5,0.5,0.5]) translate([21,21,0]) cylinder(r=shaft_diameter/2,h=shaft_length, $fn=16); } module x_carriagestruder(visualizations=false){ if (visualizations){ // Motor translate([0,21,27]) rotate([180,-0,0]) NEMA_17_motor(length=60, shaft_diameter=5); // Hobbed gear translate([21,0,17.75]) rotate([0,180,0]) hobbed_gear(); // Idler in extruder translate([36.5,-15.5,10.5]) idler(); // M3x40 screw to retain and tension the idler color([0.5,0.5,0.5]) translate([1,15,16.5]) rotate([90,0,0]) union(){ cylinder(r=1.5, h=45, $fn=16); translate([0,0,45]) cylinder(r=2.5, h=3, $fn=16); } // Idler screw/spring retainer translate([-5,-20.2,16.5]) rotate([-80,270,0]) spring_retainer(); // Right belt clamp translate([-1.5,0,9]) belt_clamp(length=5.5, grooves=false); // Left belt clamp translate([58.5,0,20]) rotate([0,180,0]) belt_clamp(length=7, grooves=true); // Ram translate([54,-3.25,13]) rotate([-90,0,90]) ram(); // Groovemount plate for fastening the hot end translate([-1,21,25]) rotate([-90,0,0]) groovemount_plate(); } difference(){ union(){ difference(){ union(){ // Carriage plate translate([0,0,-17]) rotate([0,0,-90]) carriage_plate(length=62); // Main extruder body translate([0,-21,4]) cube([42,42,23]); // Idler tensioner nut trap protrusion translate([1,21,16.5]) rotate([90,0,0]) cylinder(r=4, h=12.1, $fn=16); // Cable strain relief bracket translate([46,17,0]) cube([4,4,27]); translate([40,17,23]) cube([10,4,4]); translate([40,17,13]) cube([10,4,2]); } // M3 screw holes for motor for(i=[ [5.5,15.5,-1], [36.5,-15.5,-1], [36.5,15.5,-1] ]){ // Screw hole translate(i) cylinder(r=m3r, h=30, $fn=12); // Hole for recessed screw head, so that a 25mm screw will be long enough translate(i) cylinder(r=3.1, h=6.5, $fn=12); } // Cutout for motor's round protrusion translate([21,0,24.5]) cylinder(r=12, h=3); // Cutouts for quadrant where idler goes translate([-1,-22,4]) cube([26.5,27,24]); translate([-1,-3.1,4]) cube([22,10,24]); // small cutout for screw head for right side belt clamp translate([-0.5,5,8]) cylinder(r=4, h=21, $fn=16); // Cutout for idler hinge pocket translate([25.8,-22,9.5]) cube([14,10,12]); translate([36.5,-15.5,9.5]) cylinder(r=4.9, h=11, $fn=32); // Hole for idler tensioner nut trap translate([-5,12,13.5]) cube([10,4,m3nr*2]); translate([-1,6,14.75]) cube([4,16,m3r*2]); translate([-1,6,14.75]) rotate([0,0,-10]) cube([4,16,m3r*2]); // hole for motor shaft and hobbed gear translate([21,0,-1]) cylinder(r=7, h=32, $fn=32); // Hole for 3mm filament translate([14.25,22,14.75]) rotate([90,0,0]) cylinder(r=3.9/2, h=44, $fn=12); // Hole for groovemount hot end translate([14.25,29,14.75]) rotate([90,0,0]) cylinder(r=8.4, h=13, $fn=14); // Holes for hot end retainer plate (self-tapping) translate([3.5,29,11.5]) rotate([90,0,0]) cylinder(r=1.5, h=13, $fn=14); translate([24.5,29,19]) rotate([90,0,0]) cylinder(r=1.5, h=13, $fn=14); } // Left side belt holder & tensioner tower difference(){ translate([55,-7.5,4]) cube([7,15,13]); // Hole for belt to pass through translate([54,-3.5,7]) cube([9,7,3]); // Channel for belt tensioner screw translate([50,0,13]) rotate([0,90,0]) cylinder(r=m3r, h=20, $fn=12); // Nut trap for belt tensioner screw translate([54.5,0,13]) rotate([30,0,0]) rotate([0,90,0]) cylinder(r=m3nr, h=3, $fn=6); } // Left side belt tensioner tower supports for(i=[1,-1]){ translate([41,5.5*i-2,13.5]) cube([15,4,3.5]); } // Right side belt holder grooved bottom difference(){ translate([-4.25,-8,0]) cube([5.5,16,8]); // Grooves for teeth for(i=[1,3,5]){ translate([-4.5+i,-3.5,7]) cube([1,7,2.5]); } } } // Right belt clamp screw holes (undersized; self-tapping) for(i=[1,-1]){ translate([-1.5,5*i,-1]) cylinder(r=1.57, h=15, $fn=8); } // Left belt clamp screw holes (undersized; self-tapping) for(i=[1,-1]){ // screw holes through bottom plate; self-tapping translate([58.5,-5*i,-1]) cylinder(r=1.57, h=25, $fn=8); } } } module idler(){ difference(){ union(){ // Point of rotation cylinder(r=4.5, h=10, $fn=32); // Horizontal arm translate([-28,-4.5,0]) cube([28,7,10]); // Elbow translate([-28,-1.5,0]) cylinder(r=3, h=10, $fn=32); // Vertical arm translate([-31,-1.5,0]) cube([7,15.5,10]); // Rounded end translate([-27.5,14,0]) cylinder(r=3.5, h=10, $fn=32); // Tensioner screw protrusion difference(){ translate([-39,-1,0]) cube([11,9,11]); // Circular cutout translate([-39,8,-1]) scale([1,0.7,1]) cylinder(r=8, h=13, $fn=32); // Channel for the screw translate([-38.8,-2,4.25]) cube([6,10,3.5]); // Diagonal cutout to help retain screw head translate([-38,-10,-1]) rotate([0,0,10]) cube([14,9,13]); } } // Hole for point of rotation translate([0,0,-1]) cylinder(r=m3r, h=13, $fn=12); // Lower bearing axle hole translate([-27.5,14,-1]) cylinder(r=1.55, h=4, $fn=8); // Upper bearing axle hole translate([-27.5,14,7]) cylinder(r=m3r, h=4, $fn=12); // Room for the bearing translate([-33,8.5,2.25]) cube([10,5.5,4.5]); // Thin rounded wall for built-in support translate([-27.5,14,2.25]) cylinder(r=3.3, h=4.5, $fn=32); // Room for the filament translate([-24,-6,2.5]) cube([4.5,11,4]); // Shorten the top bearing holder protrusion // so it will accept an M3x8 screw translate([-33,9.5,8.25]) cube([10,10,4.5]); } // %translate([-28,14,6.5]) 623_bearing(); } module belt_clamp(length=5.5, grooves=false){ difference(){ translate([-length/2,-8,0]) cube([length,16,2.5]); // M3 screw holes for(i=[1,-1]){ translate([0,5*i,-2]) cylinder(r=m3r, h=15, $fn=12); } if(grooves){ for(i=[1,3,5]){ translate([-3.5+i,-3.5,2]) cube([1,7,2.5]); } } } } module ram(){ difference(){ // Half-cylinder rotate([0,90,0]) cylinder(r=4, h=6.5, $fn=32); translate([-0.75,-4,-5]) cube([8,8,5]); // Hole in bottom for M3 screw translate([3.25,0,-0.05]) cylinder(r=1.75, h=3, $fn=12); } } module groovemount_plate(){ difference(){ union(){ // Main body translate([0,0,0]) cube([30,17,4.7]); // Protrusion for fan holder translate([0,-7,0]) cube([30,7,11]); } // Main rounded groovemount cutout translate([9,10,-1]) cube([12,12,7]); translate([15,10,-1]) cylinder(r=6, h=7, $fn=24); // Screw holes (oversized, not self-tapping) translate([4.5,13.5,-1]) cylinder(r=m3r, h=8, $fn=12); translate([25.5,6,-1]) cylinder(r=m3r, h=8, $fn=12); // Rounded cutout for 30mm fan translate([15,1,19]) rotate([90,0,0]) cylinder(r=14, h=9, $fn=24); // 30mm fan screw holes (self-tapping) for(i=[3,27]){ translate([i,1,8]) rotate([90,0,0]) cylinder(r=1.5, h=9, $fn=14); } } } module spring_retainer(){ difference(){ // Main body union(){ cylinder(r=5, h=3, $fn=16); translate([-5,0,0]) cube([10,10,3]); } // Hole for screw translate([0,6,-1]) rotate([-10,0,0]) cylinder(r=m3r, h=6, $fn=16); // Round off one of the edges translate([0,10,3]) rotate([45,0,0]) cube([12,2,2], center=true); } } // x_carriagestruder(visualizations=false); // translate([-25,-4,0]) rotate([0,0,-90]) idler(); // translate([-9,10,0]) belt_clamp(length=5.5, grooves=false); // translate([-9,-7,0]) belt_clamp(length=7, grooves=true); // translate([-20,10,0]) ram(); translate([-35,-35,0]) groovemount_plate(fan=true); // translate([-20,-25,0]) spring_retainer(); // Hot end // translate([0,-19,0]) union(){ // translate([14.25,55,14.75]) rotate([90,0,0]) cylinder(r=8, h=10, $fn=14); // translate([14.25,40,14.75]) rotate([90,0,0]) cylinder(r=8, h=5, $fn=14); // translate([14.25,45,14.75]) rotate([90,0,0]) cylinder(r=6, h=10, $fn=14); // }