x-end: position idler bearing in relation to motor pulley
authorClinton Ebadi <clinton@unknownlamer.org>
Thu, 12 Aug 2021 04:36:34 +0000 (00:36 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Thu, 12 Aug 2021 04:41:11 +0000 (00:41 -0400)
Ensure the bottom of each is aligned for a straight beltline.

box_frame/x-end-idler.scad
box_frame/x-end-motor.scad
box_frame/x-end.scad

index 38d4c66..7bcff04 100644 (file)
@@ -13,8 +13,33 @@ use <y-drivetrain.scad>
 
 // todo:
 
-//  - restore y and z offsets. shift y with bearing_z, z with
-//    idler_bearing diameter to maintain a straight belt line
+// Bearing is being moved back into mount and separate tensioner
+// removed, need to ensure the width of the slot is wide enough to fix
+// the bearing plus 1-2mm clearance. Can calculate along with
+// x_box_width in settings.scad. Unlikely there's any reason to
+// complicate x_box_width by checking if bearing exceeds the width
+// calculated based rod diameter.
+
+// radius of screw hole for pulley (todo: ideally would adjust to
+// closest screw diameter to idler_bearing inner diameter)
+pulley_mount_radius = m4_diameter/2;
+// Y position of the pulley mount, adjusted to clear z bearing
+// fixme: not sure about z_delta/2 anymore
+pulley_mount_y = x_base_inside()
+     // ensuring entire bearing fits inside idler
+     + idler_bearing[0]
+     // including flange (even if not using bearing guide since
+     // bearings without will have their own flanges and the size of
+     // those is not configurable)
+     + (idler_assy_r_outer(idler_bearing) - idler_assy_r_inner(idler_bearing))
+     // and recess by 2mm
+     + 2
+     - z_delta / 2;
+// Z position of pulley mount, adjusted so bottom of idler aligns with
+// bottom of motor pulley (note: in the x-carriage currently generated
+// this is backward since the belt runs above the carriage mounting
+// points)
+pulley_mount_z = x_motor_shaft_z () + (motor_pulley[0]/2 - idler_bearing[0]/2);
 
 module x_end_idler_base(){
  x_end_base();
@@ -24,17 +49,10 @@ module x_end_idler_holes(){
  x_end_holes();
 
  // tensioner mount
- translate([-20, -15 - z_delta / 2, 30]) {
-      rotate([0, 90, 0]) cylinder(r=m4_diameter / 2, h=33, center=true, $fn=small_hole_segments);
+ translate([-20, pulley_mount_y, pulley_mount_z]) {
+      #rotate([0, 90, 0]) cylinder(r=pulley_mount_radius, h=33, center=true, $fn=small_hole_segments);
       translate([15 - 2 * single_wall_width, 0, 0]) rotate([90, 0, 90]) cylinder(r=m4_nut_diameter_horizontal / 2, h=3, $fn=6);
  }
- // create a notch for the X tensioner, to improve the length of
- // travel available
- // todo: doesn't scale with size of idler bearing correctly
- translate (v=[x_base_back() + x_box_width/2,(-sqrt(2)*22)/2 + x_base_inside() + idler_bearing[0],x_box_height/2]) difference()  {
-      rotate(a=[45,0,0])  cube(size=[x_box_width*2,22,22],center=true);
-      translate(v=[0,14,0]) cube(size=[x_box_width*2,4,8],center=true);
- }
 }
 
 // Final part
@@ -44,7 +62,7 @@ module x_end_idler(){
   x_end_idler_holes();
  }
 
- %translate([-14 - xy_delta / 2, 25, 30.5 - (max(idler_width, 16) / 2)]) x_tensioner();
+ %translate([-14 - xy_delta / 2, 25, pulley_mount_z - (max(idler_width, 16) / 2)]) x_tensioner();
 }
 
 module x_tensioner(len=50, idler_height=max(idler_bearing[0], 16)) {
index 2a0b003..0b8d8e6 100644 (file)
@@ -17,7 +17,6 @@ adj_block_z = 32;
 // 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() {
@@ -85,7 +84,7 @@ module x_end_motor_sr() {
 module x_end_motor_base(){
  x_end_base();
  // motor arm
- 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);
+ translate(v=[x_base_back() + x_box_width/2,x_base_outside() + (44 + motor_y_offset)/2,26.5]) cube(size = [x_box_width,44+motor_y_offset*2,53], center = true);
  // z stop adjuster
  adjustomatic();
  // x endstop holder
@@ -97,7 +96,7 @@ screw_head_r = 3.5;
 module x_end_motor_holes(){
      x_end_holes();
      // Position to place
-     translate(v=[-1,x_base_outside() + 44/2,30.25+motor_offs_z]){
+     translate(v=[-1,x_base_outside() + 44/2,x_motor_shaft_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
index 77ff3b1..7e08920 100644 (file)
@@ -21,6 +21,8 @@ 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?
+// z position of rotor shaft
+motor_shaft_z = 30.25;
 
 // todo: add ghost bearing model to make it easier to spot check if
 // everything is aligned
@@ -65,6 +67,8 @@ function x_base_back() = -10 - bushing_xy[0] - x_box_width/2;
 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;
+// z position of motor shaft (for aligning idler pulley)
+function x_motor_shaft_z() = motor_shaft_z; // TODO: if it's straightforward, return vector [x,y,z]. x = x_base_inside()
 
 module x_end_base(){
 // Main block