z-axis: misc changes
[clinton/prusa3.git] / box_frame / z-axis.scad
index e39f9ee..a77534b 100644 (file)
  * @name Z Axis Motor Holder
  * @category Printed
  */
+
 /**
  * @id zRodHolder
  * @name Z Axis Rod Holder
  * @category Printed
  */
+
+// todo
+
+//  - fix motor holder wall removal so it is sensible and actually
+//    removes the right thing
+// - fix changing board_thickness, add way to specify # of bolts in
+//   side of frame (assume even spacing for now)
+
 include <configuration.scad>
 
 module zmotorholder(thickness=(frame_type == frame_single ? 38 : 23), bottom_thickness=5){
@@ -39,6 +46,9 @@ module zmotorholder(thickness=(frame_type == frame_single ? 38 : 23), bottom_thi
                     cube([43 + zmotor_delta_x + zaxis_delta_x,43,42], center = true);
                }
 
+               // motor rotor clearance
+               translate([position_x, position_y, 0]) {
+                    cylinder(r=11,h=20, center = true);
                }
 
                 // motor screw holes
@@ -50,7 +60,7 @@ module zmotorholder(thickness=(frame_type == frame_single ? 38 : 23), bottom_thi
                // not use this to offset the leadscrew hole either.
                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);
+                        #nema17(places=[1, 1, 1, 1], holes=true, h=bottom_thickness + 1, $fn=small_hole_segments);
                         //shadow=-6 + layer_height);
                 }
             }
@@ -71,12 +81,14 @@ module zrodholder(thickness=(frame_type == frame_single ? 14 : 15), bottom_thick
                     cube_fillet([bottom_x, ylen, bottom_thickness], vertical=[8, 3, 0, 0]);
                    if (frame_type == frame_alu) {
                         top_radius = am_top ? thickness : thickness / 3;
-                        cube_fillet([5, ylen, thickness], vertical=[3, 3, 0, 0], top = [top_radius, 0, 0, 5]);
+                        cube_fillet([5, ylen, thickness], vertical=[0, 0, 0, 0], top = [top_radius, 0, 0, 0]);
 
-                        if (am_top) {
+                        // FIXME: make rear/top bit optional, but don't remove entirely
+                        //        (printer seems to make less noise with the rear bit)
+                        %if (am_top) {
                              // rear bracket
                              translate ([-board_thickness - 5, 0, 0])
-                                  cube_fillet([5, ylen, thickness], vertical=[3, 3, 0, 0], top = [top_radius, 5, 0, 0]);
+                                  cube_fillet([5, ylen, thickness], vertical=[0, 0, 0, 0], top = [top_radius, 0, 0, 0]);
                              translate ([-board_thickness, 5, 0])
                                   cube ([board_thickness, ylen - 6, bottom_thickness/2]);
                         }
@@ -117,12 +129,23 @@ module zrodholder(thickness=(frame_type == frame_single ? 14 : 15), bottom_thick
                         translate([-board_thickness, 0, 0])
                              cube_fillet([board_thickness + board_to_xz_distance + bushing_z[0], 5, thickness], radius=2, top = [0, 0, 0, thickness], $fn=99);
                    } else if (frame_type == frame_alu) {
-                        // split piece in front of and behind into separate pieces
-                        translate([-board_thickness, 0, 0]) {
-                             cube_fillet([board_thickness, 5.0, thickness], vertical = [0, 0, 0, 0], top = [0, 0, 0, 0]);
-                        }
+                        side_thickness = 5.0;// - zaxis_delta_y;
 
-                        cube_fillet([am_top ? board_to_xz_distance + zaxis_delta_y - smooth_rod_insert_radius : xlen + zaxis_delta_y , 5.0, thickness], vertical = [2, 0, 0, 0], top = [0, 0, 0, thickness]);
+                        translate ([0, 0 /* zaxis_delta_y */, 0]) {
+                             // back
+                             translate([-board_thickness, 0, 0]) {
+                                  cube_fillet([board_thickness, side_thickness, thickness], vertical = [0, 0, 0, 0], top = [0, 0, 0, 0]);
+                             }
+
+                             // front
+                             //cube_fillet([am_top ? board_to_xz_distance + zaxis_delta_x - smooth_rod_insert_radius : xlen + zaxis_delta_x , side_thickness, thickness], vertical = [2, 0, 0, 0], top = [0, 0, 0, thickness]);
+                             cube_fillet([am_top ? board_to_xz_distance + zaxis_delta_x - smooth_rod_insert_radius : xlen , side_thickness, thickness / (am_top ? 1 : 1.5)], vertical = [2, 0, 0, 0], top = [0, 0, 0, thickness]);
+
+                             // extra support for motor
+                             if (!am_top) {
+                                  translate ([0, ylen - side_thickness, 0]) cube_fillet([xlen/* board_to_xz_distance + zaxis_delta_x - smooth_rod_insert_radius */ , side_thickness, thickness/1.5], vertical = [2, 0, 0, 0], top = [0, 0, 0, thickness]);
+                             }
+                        }
 
                         // extra support along edge of smooth rod hole
                         radius_diff = smooth_rod_insert_radius - bushing_z[0];
@@ -162,7 +185,7 @@ module zrodholder(thickness=(frame_type == frame_single ? 14 : 15), bottom_thick
                                    translate ([0, 0, 1]) cylinder (d = 10.8, h = bearing_608[2]*2);
                                    translate ([0, 0, -1]) cylinder (d = 23, h = bearing_608[2]+1);
                               }
-                              #translate ([0, 0, bearing_608[2]-layer_height]) cylinder (d = 23, h = layer_height);
+                              translate ([0, 0, bearing_608[2]-layer_height*2]) cylinder (d = 23 - single_wall_width/2, h = layer_height);
                          }
                     }
                }