X-Git-Url: http://git.hcoop.net/clinton/prusa3.git/blobdiff_plain/1e67bf0e2a2a5a1d4cd7ed57a1159d5963657988..3dded18514e687345d3d2001ccc5fe2887e8bd79:/box_frame/x-end.scad diff --git a/box_frame/x-end.scad b/box_frame/x-end.scad dissimilarity index 96% index 6501dcf..3cf1e9d 100644 --- a/box_frame/x-end.scad +++ b/box_frame/x-end.scad @@ -1,125 +1,138 @@ -// PRUSA iteration3 -// X ends -// GNU GPL v3 -// Josef Průša -// Václav 'ax' Hůla -// http://www.reprap.org/wiki/Prusa_Mendel -// http://github.com/prusajr/PrusaMendel - -include -use -use - -//height and width of the x blocks depend on x smooth rod radius -x_box_height = 52 + 2 * bushing_xy[0]; -x_box_width = (bushing_xy[0] <= 4) ? 17.5 : bushing_xy[0] * 2 + 9.5; - -module x_end_motor(){ - - mirror([0, 1, 0]) { - - x_end_base([3, 3, 0, 0], thru=false); - - - translate([0, -z_delta - 2, 0]) difference(){ - union(){ - translate([-13.75, -14 + z_delta / 2, 30]) cube_fillet([17.5, 14 + z_delta, x_box_height], center = true, vertical=[0, 0, 3, 1.5], top=[0, 3, 6, 3], $fn=16); - translate([-10, -34, 9]) intersection(){ - translate([0, 0, 0]) cube_fillet([10, 37, x_box_height - 42], center = true, vertical=[0, 0, 0, 0], top=[0, 3, 5, 3]); - translate([-10/2, 10, -26]) rotate([45, 0, 0]) cube_fillet([10, 60, 60], radius=2); - translate([0, 0, 21]) cube([10, 60, x_box_height], center = true); - } - translate([-15, -32, 30.25]) rotate([90, 0, 0]) rotate([0, 90, 0]) nema17(places=[1, 0, 1, 1], h=10); - } - - // motor screw holes - translate([21-5, -21-11, 30.25]){ - // belt hole - translate([-30, 11, 0]) cube([10, 36, 20], center = true); - //motor mounting holes - translate([-29, 0, 0]) rotate([0, 0, 0]) rotate([0, 90, 0]) nema17(places=[1, 1, 0, 1], holes=true, shadow=5, $fn=7, h=8); - } - } - //smooth rod caps - translate([-22, -10, 0]) cube([17, 2, 15]); - translate([-22, -10, 45]) cube([17, 2, 10]); - } -} - -module x_end_base(vfillet=[3, 3, 3, 3], thru=true, len=40){ - - difference(){ - union(){ - translate([-10 - bushing_xy[0], -10 + len / 2, 30]) cube_fillet([x_box_width, len, x_box_height], center=true, vertical=vfillet, top=[5, 3, 5, 3]); - - translate([0, 0, 4 - bushing_xy[0]]) { - //rotate([0, 0, 0]) translate([0, -9.5, 0]) - translate([z_delta, 0, 0]) linear(bushing_z, x_box_height); - // Nut trap - //difference(){ - translate([-2, 17, 4]) cube_fillet([20, 16, 8], center = true, vertical=[6, 0, 0, 0], $fn=4); - //bottom hole - //} - } - } - // here are bushings/bearings - translate([z_delta, 0, 4 - bushing_xy[0]]) linear_negative(bushing_z, x_box_height); - - // belt hole - translate([-5.5-10+1.5, 22-9, 30]) cube([idler_width + 1, 55, 27], center = true); - - translate([-10 - bushing_xy[0], 0, 0]) { - if(thru == true){ - translate([0, -11, 6]) rotate([-90, 0, 0]) pushfit_rod(bushing_xy[0] * 2 + 0.2, 50); - translate([0, -11, xaxis_rod_distance+6]) rotate([-90, 0, 0]) pushfit_rod(bushing_xy[0] * 2 + 0.2, 50); - } else { - translate([0, -7, 6]) rotate([-90, 0, 0]) pushfit_rod(bushing_xy[0] * 2 + 0.2, 50); - translate([0, -7, xaxis_rod_distance+6]) rotate([-90, 0, 0]) pushfit_rod(bushing_xy[0] * 2 + 0.2, 50); - } - } - translate([0, 0, 4 - bushing_xy[0]]) { // m5 nut insert - translate([0, 17, -10]) rotate([0,0,45]){ - cylinder(h = 40, r=2.75); - //nut slid in - translate([3, 0, 14]) cube([9.2*2, 9.2*sqrt(3/4)+0.4, 4.1], center = true); - } - } - } - //threaded rod - translate([0, 17, 0]) %cylinder(h = 70, r=2.5+0.2); -} - -module x_end_idler(){ - difference() { - x_end_base(len=45); - // idler hole - translate([-14, 26, 29]) rotate([0, 90, 0]) { - idler_assy(idler_bearing); - translate([0,20,0]) - cube([idler_assy_r_outer(idler_bearing) * 2, 40, idler_width + 1], center=true); - if (idler_bearing[3]) { - %translate([0, 0, -(idler_width / 2)]) bearing_guide_outer(); - %translate([0, 0, idler_width / 2]) mirror([0, 0, 1]) bearing_guide_inner(); - } - } - } -} - -mirror([0, 0, 0]) x_end_idler(thru=true); -// translate([40, 40, 0]) x_end_idler(thru=false); -translate([50, 0, 0]) x_end_motor(); - -module pushfit_rod(diameter, length){ - cylinder(h = length, r=diameter/2, $fn=30); - translate([0, -diameter/4, length/2]) cube([diameter, diameter/2, length], center = true); - - translate([0, -diameter/2-1.2, length/2]) cube([diameter, 1, length], center = true); -} - -if (idler_bearing[3] == 1) { - translate([-25, -20 - idler_bearing[0] / 2, 0]) { - render() bearing_guide_inner(); - translate([idler_bearing[0]+10, 0, 0]) - render()bearing_guide_outer(); - } -} +// PRUSA iteration3 +// X end prototype +// GNU GPL v3 +// Josef Průša and contributors +// http://www.reprap.org/wiki/Prusa_Mendel +// http://prusamendel.org + +// Also includes code from Wilson and Wilson2, (c) Marty Rice +// https://github.com/mjrice/wilson + +// major issues with rev 3 + +// - motor side screw hole conflicts with switch / other rear mount is +// inaccessible without removing the leadscrew from the nut + +use +include + +pushfit_d = bushing_xy[0] * 2 + 0.2; +thinwall = single_wall_width * 6; // 3 perimeters +vertical_bushing_base_size = bushing_z[1]*2 + 2 * thinwall; + +x_box_length = 45; // TODO: auto-adjust based on bearing size? + +// todo: add ghost bearing model to make it easier to spot check if +// everything is aligned +module vertical_bushing_base(){ + translate(v=[-2-vertical_bushing_base_size/4,0,x_box_height/2]) cube(size = [4+vertical_bushing_base_size/2,vertical_bushing_base_size,x_box_height], center = true); + cylinder(h = x_box_height, r=vertical_bushing_base_size/2, $fn = 90); +} + +module vertical_bushing_holes(){ + // FIXME: is extra cut necessary? check conf_bushing + bushing_cut_extra = 0.2; // padding so it's not too tight + translate(v=[0,0,-4]) cylinder(h = x_box_height + 3, r=bushing_z[1] + bushing_cut_extra, $fn = 60); + translate(v=[0,0,x_box_height-4]) cylinder(h=x_box_height,r=bushing_z[1]-1,$fn=60); + // TODO: is slit too wide or too low? Wilson increased width from 1 + // -> 2 mm, slit also might need to end 1-2mm before the base + #rotate(a=[0,0,-50]) translate(v=[thinwall*2 + 1,0,x_box_height/2 - 2]) cube(size = [bushing_z[2]/2, 2 ,x_box_height], center = true); + translate([0,0,-1]) cylinder(h=9,r1=bushing_z[1]+thinwall/2+1,r2=4,$fn=60); +} + +module nut_trap_base () { + // TODO: cube doesn't line up with edge of base, cylinder is slightly asymmetrical + // adapt newer nut trap from prusa i3 mk3 instead of wilson2 + cube(size=[16,21,8],center=true); + translate ([2,0,0]) cylinder(h=8,r=12.5,$fn=50,center=true); +} + +module nut_trap () { + union() { + // center post of brass nut + cylinder(h=12,r=5.45,$fn=50,center=true); + // holes for m3 screws in brass nut + translate(v=[8,0,0]) cylinder(h=12,r=1.8,$fn=20,center=true); + #rotate([0,0,90]) translate(v=[8,0,0]) cylinder(h=12,r=1.8,$fn=20,center=true); + rotate([0,0,180]) translate(v=[8,0,0]) cylinder(h=12,r=1.8,$fn=20,center=true); + #rotate([0,0,270]) translate(v=[8,0,0]) cylinder(h=12,r=1.8,$fn=20,center=true); + } +} + +// x position of edge of main block (facing frame), for attaching objects to it +function x_base_back() = -10 - bushing_xy[0] - x_box_width/2; +// y position of edge of main block facing away from x-axis +function x_base_outside() = vertical_bushing_base_size/2; +// y position of edge of main block facing toward the x-axis +function x_base_inside() = -x_box_length/2 - vertical_bushing_base_size/2; + +module x_end_base(){ +// Main block +translate(v=[-10 - bushing_xy[0], -x_box_length/2 + vertical_bushing_base_size/2,x_box_height/2]) cube(size = [x_box_width,x_box_length,x_box_height], center = true); +// Bearing holder + vertical_bushing_base(); +//Nut trap + translate(v=[-4+zmotor_delta_x,-17-zmotor_delta_y,4]) nut_trap_base (); +} + +// TODO: x translation of belt and smooth rods needs to adapt to +// x_end_width and motor/idler pulley position. + +module x_end_holes(){ + vertical_bushing_holes(); + // Belt hole + translate(v=[-1,0,0]){ + // Stress relief + translate(v=[-5.5-10+1.5,-bushing_z[1]-4,30]) cube(size = [20,1,28], center = true); + // Cut out for belt (this is NOT centered because the motor isn't centered) + x_box_offset = -x_box_length/2 + vertical_bushing_base_size/2; + difference(){ + translate(v=[-5.5-10+1.5, x_box_offset ,30]) cube(size = [10, x_box_length + 1,28], center = true); + + // Nice edges + translate(v=[-5.5-10+1.5,x_box_offset,30+23]) rotate([0,45,0]) cube(size = [10,x_box_length + 1,28], center = true); + translate(v=[-5.5-10+1.5,x_box_offset,30+23]) rotate([0,-45,0]) cube(size = [10,x_box_length + 1,28], center = true); + translate(v=[-5.5-10+1.5,x_box_offset,30-23]) rotate([0,45,0]) cube(size = [10,x_box_length + 1,28], center = true); + translate(v=[-5.5-10+1.5,x_box_offset,30-23]) rotate([0,-45,0]) cube(size = [10,x_box_length + 1,28], center = true); + + } +} + + + // FIXME: confirm length of smooth rod doesn't change when x_box_length or bearing size changes + // should also make sure this is long enough if x-ends somehow end up larger than 50mm + // TODO: needs to shift top rod as diameter increases, wall is very + // thing for 10mm, and fails entirely for 12mm + translate([-10 - bushing_xy[0], 0, 0]) { + // Top pushfit rod + translate([0, -7, 6]) rotate([-90, 0, 0]) pushfit_rod(pushfit_d, 50); + // Bottom pushfit rod + translate([0, -7, xaxis_rod_distance+6]) rotate([-90, 0, 0]) pushfit_rod(pushfit_d, 50); + } + +// Nut trap + translate(v=[zmotor_delta_x,-17-zmotor_delta_y,3]) rotate ([0, 0, 45]) nut_trap (); +} + + +// Final prototype +module x_end_plain(){ + difference(){ + x_end_base(); + x_end_holes(); + } +} + +x_end_plain(); + + +module pushfit_rod(diameter,length){ + translate([0,-0.3,0]) cylinder(h = length, r=diameter/2, $fn=30); + translate([0,0.3,0]) cylinder(h = length, r=diameter/2, $fn=30); + // TODO: reintroduce teardrop holes? +// difference(){ +// translate(v=[0,-diameter/2.85,length/2]) rotate([0,0,45]) cube(size = [diameter/2,diameter/2,length], center = true); +// translate(v=[0,-diameter/4-diameter/2-0.4,length/2]) rotate([0,0,0]) cube(size = [diameter,diameter/2,length], center = true); +// } + +}