From b238c607e1413face60bff67e2d92c3d5c0da3aa Mon Sep 17 00:00:00 2001 From: Clinton Ebadi Date: Sat, 18 May 2019 18:28:47 -0400 Subject: [PATCH] x-end/motor: position and size motor arm correctly * Adapt position and size of motor arm based on size of x-end. * Ensure motor mounting screw head recess adjusts as x_box_width does. * Automatically adjust position of zip tie points as x-end size changes. --- box_frame/x-end-motor.scad | 93 +++++++++++++++++++++----------------- box_frame/x-end.scad | 6 ++- 2 files changed, 57 insertions(+), 42 deletions(-) diff --git a/box_frame/x-end-motor.scad b/box_frame/x-end-motor.scad index 645fd2b..d30e847 100644 --- a/box_frame/x-end-motor.scad +++ b/box_frame/x-end-motor.scad @@ -9,15 +9,16 @@ include use -offs_adjuster_y = 5.5; // fixme: if we keep this, needs to adjust - // based on size of bushing_z to clear the side - // of the plate adj_block_x = 9; adj_block_y = 10; adj_block_z = 32; -motor_offs_z = 0; -motor_y_offset = 7; +// fixme: if we keep this, needs to adjust based on size of bushing_z +// to clear the side of the plate +offs_adjuster_y = x_base_outside() - adj_block_y/2; + +motor_offs_z = 0; // todo: broken, not sure if useful -- adjust based on bearing size to keep straight belt line? +motor_y_offset = 0; // todo: use z_delta for y offset, module adjustomatic() { difference() { @@ -69,14 +70,14 @@ module pocket_endstop() // endstop holder grafted onto the side toward the rods module x_end_motor_sr() { sr_box_height = 12; - translate([x_base_back(),9,x_box_height - sr_box_height]) { + translate([x_base_back(), x_base_outside(),x_box_height - sr_box_height]) { difference() { - cube(size=[8,14+motor_y_offset,sr_box_height]); - translate([4,13.5+motor_y_offset,sr_box_height-1]) rotate([0,90,0]) difference() { + cube(size=[8,13+motor_y_offset,sr_box_height]); + translate([4,12.5+motor_y_offset,sr_box_height-1]) rotate([0,90,0]) difference() { cylinder(r=4.5,h=4,$fn=16,center=true); translate([0,0,-1]) cylinder(r=2.5,h=7,$fn=16,center=true); } - translate([9,12.6+motor_y_offset,sr_box_height]) rotate([0,45,90]) cube(size=[2,11,2]); + translate([9,11.6+motor_y_offset,sr_box_height]) rotate([0,45,90]) cube(size=[2,11,2]); } } } @@ -84,7 +85,7 @@ module x_end_motor_sr() { module x_end_motor_base(){ x_end_base(); // motor arm - translate(v=[-15,31,26.5+motor_offs_z]) cube(size = [17,44+motor_y_offset*2,53], center = true); + translate(v=[x_base_back() + x_box_width/2,x_base_outside() + (44 + motor_y_offset)/2,26.5+motor_offs_z]) cube(size = [x_box_width,44+motor_y_offset*2,53], center = true); // z stop adjuster adjustomatic(); // x endstop holder @@ -94,44 +95,54 @@ module x_end_motor_base(){ screw_head_r = 3.5; module x_end_motor_holes(){ - x_end_holes(); - // Position to place - translate(v=[-1,32,30.25+motor_offs_z]){ - // Belt hole - translate(v=[-14,1,0]) cube(size = [10,46,22], center = true); - translate ([0, motor_y_offset, 0]) { - // Motor mounting holes - translate(v=[20,-15.5,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 70, r=1.8, $fn=30); - translate(v=[1,-15.5,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 12, r=screw_head_r, $fn=30); - + x_end_holes(); + // Position to place + translate(v=[-1,x_base_outside() + 44/2,30.25+motor_offs_z]){ + // Belt hole + translate(v=[-14,1,0]) cube(size = [10,46,44/2], center = true); + // TODO: use built-in nema17 library to create holes + // FIXME: ensure these maintain bolt length as x_box_width + // increases (screw head holes need to be cut deeper) - translate(v=[20,-15.5,15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 70, r=1.8, $fn=30); - translate(v=[1,-15.5,15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 12, r=screw_head_r, $fn=30); + translate ([0, motor_y_offset, 0]) { + // Motor mounting holes + // based on wilson x-ends, the intention here is to + // leave a 11.5mm shaft for the screw + motor_screwhead_depth = -x_base_back() - 11.5; + #translate(v=[20,-15.5,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 70, r=1.8, $fn=30); + #translate(v=[1,-15.5,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = motor_screwhead_depth, r=screw_head_r, $fn=30); - translate(v=[20,15.5,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 70, r=1.8, $fn=30); - translate(v=[1,15.5,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 12, r=screw_head_r, $fn=30); + translate(v=[20,-15.5,15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 70, r=1.8, $fn=30); + translate(v=[1,-15.5,15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = motor_screwhead_depth, r=screw_head_r, $fn=30); - translate(v=[20,15.5,15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 70, r=1.8, $fn=30); - translate(v=[1,15.5,15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 12, r=screw_head_r, $fn=30); + translate(v=[20,15.5,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 70, r=1.8, $fn=30); + translate(v=[1,15.5,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = motor_screwhead_depth, r=screw_head_r, $fn=30); - // Material saving cutout - translate(v=[-10,12,10]) cube(size = [60,42,42], center = true); - // Material saving cutout - translate(v=[-10,40,-30]) rotate(a=[45,0,0]) cube(size = [60,42,42], center = true); - // Motor shaft cutout - translate(v=[0,0,0]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 70, r=17, $fn=6); -} - // zip tie retainer for securing end stop wiring - #translate([-5,-63,14]) difference() { cylinder(r=4.5,h=4,$fn=16); - translate([0,0,-1]) cylinder(r=2.5,h=7,$fn=16); - } - #translate([-5,-48,x_box_height-30.5]) rotate([90,0,0]) difference() { cylinder(r=4.5,h=4,$fn=16,center=true); - translate([0,0,-1]) cylinder(r=2.5,h=7,$fn=16,center=true); - } - } + translate(v=[20,15.5,15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 70, r=1.8, $fn=30); + translate(v=[1,15.5,15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = motor_screwhead_depth, r=screw_head_r, $fn=30); + + // Material saving cutout + translate(v=[-10,12+motor_y_offset/2,10]) cube(size = [60,42 + motor_y_offset,42], center = true); + + // Material saving cutout + // todo (maybe...): if motor_y_offset is above 10 edge + // becomes very sharp, but this is a pretty unrealistic + // situation so might not be worth caring about. + translate(v=[-10,40,-30]) rotate(a=[45,0,0]) cube(size = [60,43,42], center = true); + // Motor shaft cutout + translate(v=[0,0,0]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h = 70, r=17, $fn=6); + } + } + // zip tie retainer for securing end stop wiring + #translate([x_base_back() + x_box_width,x_base_inside() + 4.5/2,x_box_height - 8 - bushing_xy[0]*2]) difference() { cylinder(r=4.5,h=4,$fn=16); + translate([0,0,-1]) cylinder(r=2.5,h=7,$fn=16); + } + #translate([x_base_back() + x_box_width,-bushing_z[2]/2 - 1,x_box_height]) rotate([90,0,0]) difference() { cylinder(r=4.5,h=4,$fn=16,center=true); + translate([0,0,-1]) cylinder(r=2.5,h=7,$fn=16,center=true); + } } // Final part diff --git a/box_frame/x-end.scad b/box_frame/x-end.scad index 56e1561..d89a11b 100644 --- a/box_frame/x-end.scad +++ b/box_frame/x-end.scad @@ -67,8 +67,12 @@ module nut_trap () { } } -// x position of edge of main block, for attaching objects to it +// 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 -- 2.20.1