z-axis: make zmotor_delta_{x,y} use local coordinate system
authorClinton Ebadi <clinton@unknownlamer.org>
Sat, 9 Dec 2017 21:39:44 +0000 (16:39 -0500)
committerClinton Ebadi <clinton@unknownlamer.org>
Sat, 9 Dec 2017 21:39:44 +0000 (16:39 -0500)
values were set from wilson x-end, which is using a difference
orientation. This switches x/y and inverts x, i.e.

    x = -wilson_y
    y = wilson_x

Not sure this was the correct choice, will revisit after integrating
wilson x-end changes into this

box_frame/inc/settings.scad
box_frame/z-axis.scad

index 3fa92aa..02ed98d 100644 (file)
@@ -19,10 +19,13 @@ m3_nut_diameter_bigger = ((m3_nut_diameter / 2) / cos (180 / 6)) * 2;
 // deprecated
 i_am_box = (frame_type == frame_box);
 
-// shift smooth rod and leadscrew mounts together
+// shift smooth rod and leadscrew mounts simultaneously
 zaxis_delta_x = (frame_type == frame_alu) ? 5 : 0;
-zaxis_delta_y = (frame_type == frame_alu) ? 5 : 0;
+zaxis_delta_y = (frame_type == frame_alu) ? -5 : 0;
 
 // shift motor/leadscrew mount to clear bearings and x-rods
-zmotor_delta_x = ((frame_type == frame_alu) && (bushing_z[1] > 9)) ? 5 : 0;
-zmotor_delta_y = ((frame_type == frame_alu) && (bushing_xy[0] >= 5)) ? -3 : 0;
+// X/Y ARE SWITCHED FROM X-END CONFIGURATION BE WARNED
+// BONUS FUN: X (Y in x-end configuration) IS INVERTED!
+// fixed, but it was all a fucking tautology in the end whoops
+zmotor_delta_x = ((frame_type == frame_alu) && (bushing_z[1] > 9)) ? 3 : 0;
+zmotor_delta_y = ((frame_type == frame_alu) && (bushing_xy[0] >= 5)) ? 5 : 0;
index 45dac09..e39f9ee 100644 (file)
 include <configuration.scad>
 
 module zmotorholder(thickness=(frame_type == frame_single ? 38 : 23), bottom_thickness=5){
-    position_y = board_to_xz_distance + zaxis_delta_y - zmotor_delta_y;
-    position_x = board_to_xz_distance - zaxis_delta_x + zmotor_delta_x;
+    position_y = board_to_xz_distance + zaxis_delta_y + zmotor_delta_y;
+    position_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
     difference(){
         union(){
             // Motor holding part
             difference(){
                 union(){
-                    zrodholder(thickness=thickness, xlen=45 + zmotor_delta_x, ylen=44 - zmotor_delta_y, zdelta=((i_want_to_use_single_plate_dxf_and_make_my_z_weaker == 0) ? 0 : 5), bottom_x = 14 + zaxis_delta_x + zmotor_delta_x, am_top=0);
-                    translate([position_y, position_x, 0]) {
-                        nema17(places=[0, 1, 1, 1], h=bottom_thickness + layer_height, $fn=23, shadow=layer_height + 2);
+                    zrodholder(thickness=thickness, xlen=45 + zmotor_delta_x + zaxis_delta_x, ylen=48 + 5 + zmotor_delta_y + zaxis_delta_y, zdelta=((i_want_to_use_single_plate_dxf_and_make_my_z_weaker == 0) ? 0 : 5), bottom_x = 50 + zaxis_delta_x + zmotor_delta_x, bottom_y = 15 + zmotor_delta_y + zaxis_delta_y, am_top=0, bottom_thickness=bottom_thickness);
+                    translate([position_x, position_y, 0]) {
+                        nema17(places=[1, 1, 1, 1], h=bottom_thickness + layer_height, $fn=23, shadow=layer_height + 2);
                     }
                 }
                // remove any interfering walls
-               translate([position_y, position_x, layer_height + 2 + 21 +3]) {
-                    #cube([43 + zmotor_delta_x + zaxis_delta_x,43,42], center = true);
+               translate([position_x, position_y, layer_height + 2 + 21 +3]) {
+                    cube([43 + zmotor_delta_x + zaxis_delta_x,43,42], center = true);
+               }
+
                }
 
                 // motor screw holes
@@ -46,7 +48,7 @@ module zmotorholder(thickness=(frame_type == frame_single ? 38 : 23), bottom_thi
                // would the motor mount be moved in both directions
                // instead of just away from the frame? X-axis does
                // not use this to offset the leadscrew hole either.
-               translate([position_y, position_x, thickness]) {
+               translate([position_x, position_y, thickness]) {
                     mirror([0, 0, 1]) translate([0, 0, thickness-8])
                         nema17(places=[0, 1, 1, 1], holes=true, h=bottom_thickness + 1, $fn=small_hole_segments);
                         //shadow=-6 + layer_height);
@@ -85,7 +87,7 @@ module zrodholder(thickness=(frame_type == frame_single ? 14 : 15), bottom_thick
 
                    //hole for Z axis is thru this
                     cube_fillet([xlen + zaxis_delta_x, bottom_y, bottom_thickness], vertical=[3, 0, 0, 3]);
-                   if (bottom_x < board_to_xz_distance - z_delta + zaxis_delta_y) {
+                   if (bottom_x < board_to_xz_distance - z_delta + zaxis_delta_x) {
                         translate([bottom_x, bottom_y, 0]) {
                              //large fillet that makes it stiffer by lot. Thanks to Marcus Wolschon
                              difference(){
@@ -106,9 +108,9 @@ module zrodholder(thickness=(frame_type == frame_single ? 14 : 15), bottom_thick
                     }
                    // leadscrew bearing hole is cut from this
                    if (am_top) {
-                        lead_bearing_y = board_to_xz_distance + zaxis_delta_y - zmotor_delta_y;
-                        lead_bearing_x = board_to_xz_distance - zaxis_delta_x + zmotor_delta_x;
-                        translate ([lead_bearing_y, lead_bearing_x, 0]) cylinder (d = bearing_608[0] + 1 + 2, h = bearing_608[2] + layer_height*4);
+                        lead_bearing_y = board_to_xz_distance + zaxis_delta_y + zmotor_delta_y;
+                        lead_bearing_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
+                        translate ([lead_bearing_x, lead_bearing_y, 0]) cylinder (d = bearing_608[0] + 1 + 2, h = bearing_608[2] + layer_height*4);
                    }
                     //piece along cut side of the board
                    if (frame_type == frame_box) {
@@ -125,11 +127,11 @@ module zrodholder(thickness=(frame_type == frame_single ? 14 : 15), bottom_thick
                         // extra support along edge of smooth rod hole
                         radius_diff = smooth_rod_insert_radius - bushing_z[0];
                         hull () {
-                             translate([-board_thickness/3, -zaxis_delta_x/3, 0]) {
-                                  cube_fillet([board_thickness/3 + board_to_xz_distance + zaxis_delta_y - bushing_z[0] , zaxis_delta_x/3 , thickness/2], vertical = [2, 0, 4, 0], top = [0, 0, 4, thickness/2]);
+                             translate([-board_thickness/3, -zaxis_delta_y/3, 0]) {
+                                  cube_fillet([board_thickness/3 + board_to_xz_distance + zaxis_delta_x - bushing_z[0] , -zaxis_delta_y/3 , thickness/2], vertical = [2, 0, 4, 0], top = [0, 0, 4, thickness/2]);
                              }
                              translate([board_to_xz_distance/2, -zaxis_delta_x + radius_diff/6, 0]) {
-                                  cube_fillet([board_to_xz_distance/2 + zaxis_delta_y  + smooth_rod_insert_radius*0.75, radius_diff/3 , bottom_thickness*2], vertical = [2, 0, 4, bushing_z[0] * smooth_rod_insert_radius/bushing_z[0]], top = [0, 0, 2, thickness/4]);
+                                  cube_fillet([board_to_xz_distance/2 + zaxis_delta_x  + smooth_rod_insert_radius*0.75, radius_diff/3 , bottom_thickness*2], vertical = [2, 0, 4, bushing_z[0] * smooth_rod_insert_radius/bushing_z[0]], top = [0, 0, 2, thickness/4]);
                              }
                         }
                     } else {
@@ -137,14 +139,14 @@ module zrodholder(thickness=(frame_type == frame_single ? 14 : 15), bottom_thick
                             cube_fillet([board_thickness/2 + board_to_xz_distance + bushing_z[0], 5, thickness], radius=2, top = [0, 0, 0, thickness], $fn=99);
                     }
                     //smooth rod insert
-                    translate([board_to_xz_distance - z_delta + zaxis_delta_y, 9 - zaxis_delta_x, 0])
+                    translate([board_to_xz_distance - z_delta + zaxis_delta_x, 9 + zaxis_delta_y, 0])
                         cylinder(h=bottom_thickness * (am_top ? 1.75 : 1.75), r=smooth_rod_insert_radius);
                 }
 
                // === difference ===
 
                 //smooth rod hole
-                #translate([board_to_xz_distance - z_delta + zaxis_delta_y, 9 - zaxis_delta_x, -1]) cylinder(h=am_top ? thickness+20 : bottom_thickness, r=bushing_z[0] + single_wall_width / 4);
+                #translate([board_to_xz_distance - z_delta + zaxis_delta_x, 9 + zaxis_delta_y, -1]) cylinder(h=am_top ? thickness+20 : bottom_thickness, r=bushing_z[0] + single_wall_width / 4);
                 //inside rouned corner
                if (frame_type != frame_alu) {
                     translate([0, 5, -1]) cylinder(r=0.8, h=100, $fn=8);
@@ -152,9 +154,9 @@ module zrodholder(thickness=(frame_type == frame_single ? 14 : 15), bottom_thick
 
                // leadscrew hole
                if (am_top) {
-                    lead_bearing_y = board_to_xz_distance + zaxis_delta_y - zmotor_delta_y;
-                    lead_bearing_x = board_to_xz_distance - zaxis_delta_x + zmotor_delta_x;
-                    translate ([lead_bearing_y, lead_bearing_x, 0]) {
+                    lead_bearing_y = board_to_xz_distance + zaxis_delta_y + zmotor_delta_y;
+                    lead_bearing_x = board_to_xz_distance + zaxis_delta_x + zmotor_delta_x;
+                    translate ([lead_bearing_x, lead_bearing_y, 0]) {
                          difference () {
                               union () {
                                    translate ([0, 0, 1]) cylinder (d = 10.8, h = bearing_608[2]*2);