x-end: refine integration with MK3 idler tensioner
[clinton/prusa3.git] / box_frame / x-end-motor.scad
index 2a0b003..db273e7 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() {
@@ -82,10 +81,38 @@ module x_end_motor_sr() {
      }
 }
 
+// tensioner todo:
+// - end of screw slot does not align properly with motor holes
+// - start of screw slot material inside of belt slot does not go to edge of x-end
+// - tensioner body interferes with end stop adjuster
+module x_end_belt_tensioner_base () {
+     rotate(a=[90,30,0]) cylinder(h=27, r=4, $fn=6);
+     difference()
+     {
+         translate([-6,-27,0])    rotate(a=[0,45,0]) cube([11,27,11]);
+         translate([-13.465,-28,-10.25]) cube([10,30,21]);
+         translate([-5,-28,4.75])     cube([10,30,21]);
+         translate([4,-28,-10.25])     cube([25,30,21]);
+     }
+     difference()
+     {
+         translate([0,-27,0]) rotate(a=[90,0,0]) cylinder(h=10.5, r=5, $fn=30); // too short
+         translate([-19.5,-27,-10]) rotate(a=[90,0,0]) cube([20,20,20]);
+     }
+}
+
+module x_end_belt_tensioner_holes () {
+     translate ([0, 5, 0]) {
+         translate([0,0,0]) rotate(a=[90,0,0]) cylinder(h=35, r=1.6, $fn=30);
+         translate([0,-32,0]) rotate(a=[90,0,0]) cylinder(h=30 + motor_y_offset, r=3.2, $fn=30);
+         translate([0-10+2.8,-11,0-2.8]) cube([10,2.1,5.6]);
+     }
+}
+
 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 +124,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
@@ -109,20 +136,20 @@ module x_end_motor_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 = 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 = motor_screwhead_depth, r=screw_head_r, $fn=30);
+              for (x =[-1:0.25:1]) {
+                   translate(v=[0,-15.5+x,15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h=30, r=1.55, $fn=60);
+                   translate(v=[0,-15.5+x,15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h=18, r2=1.55, r1=1.7, $fn=60);
+                   translate(v=[1,-15.5+x,15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h=10, r=3.05, $fn=60);
 
+                   translate(v=[20,-15.5+x,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h=70, r=1.6, $fn=30);
+                   translate(v=[0,-15.5+x,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h=18, r2=1.55, r1=1.7, $fn=60);
+                   translate(v=[1,-15.5+x,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h=10, r=3.1, $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+x,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h=70, r=1.6, $fn=30);
+                   translate(v=[0,15.5+x,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h=18, r2=1.55, r1=1.7, $fn=60);
+                   translate(v=[1,15.5+x,-15.5]) rotate(a=[0,-90,0]) rotate(a=[0,0,90]) cylinder(h=10, r=3.1, $fn=30);
+              }
 
               // Material saving cutout
               translate(v=[-10,12+motor_y_offset/2,10]) cube(size = [60,42 + motor_y_offset,42], center = true);
@@ -145,14 +172,39 @@ module x_end_motor_holes(){
      }
 }
 
+module x_end_motor_pulley () {
+     // todo: y alignment uses magic expression "x_base_outside() + 44/2 + motor_y_offset" copies from motor mount translate
+     // todo: x alignment uses magic expression "(x_box_width-10)/2"
+     //       to move past back wall of x-end, will need to be
+     //       adjusted if slot width is made to dynamically adjust or
+     //       is changed in size
+     translate ([x_base_back() + motor_pulley[1]/2 + (x_box_width-10)/2, x_base_outside() + 44/2 + motor_y_offset, x_motor_shaft_z ()]) {
+         rotate ([0, 90, 0]) {
+              difference () {
+                   cylinder (d=motor_pulley[0], h=motor_pulley[1], center=true);
+              translate ([0, 0, -0.01]) cylinder (d=motor_pulley[2], h=motor_pulley[1]+0.03, center=true);
+              }
+         }
+     }
+}
+
 // Final part
 module x_end_motor(){
- difference(){
-  x_end_motor_base();
-  x_end_motor_holes();
- }
- // strain relief (zip tie point) below the motor
- x_end_motor_sr();
+     // 9 is specific to current model, might be better to have that translate in x_belt_tensioner modules?
+     belt_tensioner_offset = [x_base_back (), 9 + motor_y_offset, x_motor_shaft_z ()];
+     difference () {
+         union () {
+              difference() {
+                   x_end_motor_base ();
+                   x_end_motor_holes ();
+              }
+              translate (belt_tensioner_offset) x_end_belt_tensioner_base ();
+         }
+         translate (belt_tensioner_offset) x_end_belt_tensioner_holes ();
+     }
+     // strain relief (zip tie point) below the motor
+     x_end_motor_sr ();
+     %x_end_motor_pulley ();
 }
 
 //rotate([0,0,180])