--- /dev/null
+// PRUSA iteration3
+// X end motor
+// GNU GPL v3
+// Josef Průša <iam@josefprusa.cz> and contributors
+// http://www.reprap.org/wiki/Prusa_Mendel
+// http://prusamendel.org
+// Alterations for reprap Wilson by Martin Rice <mrice411@gmail.com>
+
+include <configuration.scad>
+use <x-end.scad>
+
+offs_adjuster_y = 5.5;
+adj_block_x = 9;
+adj_block_y = 10;
+adj_block_z = 32;
+motor_offs_z = 0;
+
+motor_y_offset = 7;
+
+module adjustomatic() {
+translate ([0, 0, 6.5])
+ difference() {
+ translate(v=[-(15+17/2+adj_block_x/2),offs_adjuster_y,58.5-adj_block_z/2])
+ cube(size=[adj_block_x,adj_block_y,adj_block_z],center=true);
+
+ translate(v=[-(15+17/2+adj_block_x/2)-5,offs_adjuster_y,58-adj_block_z/2-8])
+ rotate([0,-30,0]) cube(size=[adj_block_x,adj_block_y+2,adj_block_z],center=true);
+
+ translate(v=[-(15+17/2+adj_block_x/2-1),offs_adjuster_y,58-adj_block_z/2-3])
+ cube(size=[adj_block_x,adj_block_y-2,adj_block_z-2],center=true);
+
+ translate(v=[-(15+17/2+adj_block_x/2),offs_adjuster_y,58-adj_block_z/2+14])
+ {
+ rotate([0,0,30]) #cylinder(h = 4, r = 7.0/2 , $fn = 6);
+ translate([0,0,-20]) #cylinder(h=30,r=1.6,$fn=16);
+}
+
+ }
+
+}
+
+// the endstop mount will be translated by this much (negative values
+// mean it moves away from the motor and toward the X carriage, giving
+// more room for leads and also extra space for the auto bedleveling
+// servo housing which is on this side of the extruder):
+endstop_sw_offs_adjust = -0;
+
+module pocket_endstop() // endstop holder grafted onto the side toward the rods
+{
+ translate([-7,-45,0])
+ union() {
+ // angled wall that attaches to the endstop holder
+ translate([-1,18,0]) rotate([0,0,-30]) cube(size=[8.5,2,22]);
+ // little bit of extra support at the bottom corner
+ translate([-1.5,15.,2]) rotate([0,90,0]) cube(size=[2,3,10]);
+
+ difference() {
+ translate([-1.5,endstop_sw_offs_adjust,0]) cube(size=[9,20.5,22]);
+
+ translate([-2,endstop_sw_offs_adjust,1]) cube(size=[7,21,22]);
+ translate([0,15.5,8]) cube(size=[10,5,20]);
+
+ // screw holes for endstop switch
+ translate([-2,7+endstop_sw_offs_adjust,1.5+5.5]) rotate([0,90,0]) cylinder(r=1.5,h=15);
+ translate([-2,7+endstop_sw_offs_adjust,1.5+5.5+9.5]) rotate([0,90,0]) cylinder(r=1.5,h=15);
+ }
+ }
+}
+
+module x_end_motor_sr() {
+ // TODO: use x_box_height
+ difference() {
+ cube(size=[8,14+motor_y_offset,12]);
+ #translate([4,13.5+motor_y_offset,11]) 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,12]) rotate([0,45,90]) cube(size=[2,11,2]);
+ }
+}
+
+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);
+ // z stop adjuster
+ adjustomatic();
+ // x endstop holder
+ pocket_endstop();
+}
+
+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);
+
+
+ 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 = 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 = 12, 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);
+ }
+ }
+}
+
+// Final part
+module x_end_motor(){
+ difference(){
+ x_end_motor_base();
+ x_end_motor_holes();
+ }
+ // strain relief (zip tie point) below the motor
+ translate([-23.5,9,53]) x_end_motor_sr();
+}
+
+rotate([0,0,180])
+x_end_motor();
-// PRUSA iteration3
-// X ends
-// GNU GPL v3
-// Josef Průša <josefprusa@me.com>
-// Václav 'ax' Hůla <axtheb@gmail.com>
-// http://www.reprap.org/wiki/Prusa_Mendel
-// http://github.com/josefprusa/Prusa3
-
-// ThingDoc entry
-/**
- * @id xMotorEnd
- * @name X Axis Motor End
- * @category Printed
- */
-
-/**
- * @id xIdlerEnd
- * @name X Axis Idler End
- * @category Printed
- */
-
-include <configuration.scad>
-use <bushing.scad>
-use <inc/bearing-guide.scad>
-use <y-drivetrain.scad>
-
-//height and width of the x blocks depend on x smooth rod radius
-x_box_height = 52 + 2 * bushing_xy[0];
-x_box_width = (bushing_xy[0] <= 4) ? 17.5 : bushing_xy[0] * 2 + 9.5;
-bearing_height = max ((bushing_z[2] > 30 ? x_box_height : (2 * bushing_z[2] + 8)), x_box_height);
-
-module x_end_motor(){
-
- mirror([0, 1, 0]) {
-
- x_end_base([3, 3, min((bushing_xy[0] - 3) * 2, 3), 2], len=42, offset=-5, thru=false);
-
-
- translate([0, -z_delta - 2, 0]) difference(){
- union(){
- intersection() {
- translate([-15, -34, 30]) cube([20, 60, x_box_height], center = true);
- union() {
- translate([-14, -16 + z_delta / 2, 24]) cube_fillet([17.5, 10.5 + z_delta, 55], center = true, vertical=[0, 0, 3, 3], top=[0, 3, 6, 3], $fn=16);
- //lower arm holding outer stepper screw
- translate([-10.25, -34, 9]) intersection(){
- translate([0, 0, -5]) cube_fillet([10, 37, 28], center = true, vertical=[0, 0, 0, 0], top=[0, 3, 5, 3]);
- translate([-10/2, 10, -26]) rotate([45, 0, 0]) cube_fillet([10, 60, 60], radius=2);
- }
- }
- }
- translate([-16, -32, 30.25]) rotate([90, 0, 0]) rotate([0, 90, 0]) nema17(places=[1, 0, 1, 1], h=11);
- }
-
- // motor screw holes
- translate([21-5, -21-11, 30.25]){
- // belt hole
- translate([-30, 11, -0.25]) cube_fillet([11, 36, 22], vertical=0, top=[0, 1, 0, 1], bottom=[0, 1, 0, 1], center = true, $fn=4);
- //motor mounting holes
- translate([-29.5, 0, 0]) rotate([0, 0, 0]) rotate([0, 90, 0]) nema17(places=[1, 1, 0, 1], holes=true, shadow=5.5, $fn=small_hole_segments, h=8);
- }
- }
- //smooth rod caps
- //translate([-22, -10, 0]) cube([17, 2, 15]);
- //translate([-22, -10, 45]) cube([17, 2, 10]);
- }
-}
-
-module x_end_base(vfillet=[3, 3, 3, 3], thru=true, len=40, offset=0){
-
- difference(){
- union(){
- translate([-10 - bushing_xy[0], -10 + len / 2 + offset, 30]) cube_fillet([x_box_width, len, x_box_height], center=true, vertical=vfillet, top=[5, 3, 5, 3]);
-
- translate([0, 0, 4 - bushing_xy[0]]) {
- //rotate([0, 0, 0]) translate([0, -9.5, 0])
- translate([z_delta, 0, 0]) render(convexity = 5) linear(bushing_z, bearing_height);
- // Nut trap
- translate([-2, 18, 5]) cube_fillet([20, 14, 10], center = true, vertical=[8, 0, 0, 5]);
- //}
- }
- }
- // here are bushings/bearings
- translate([z_delta, 0, 4 - bushing_xy[0]]) linear_negative(bushing_z, bearing_height);
-
- // belt hole
- translate([-14 - xy_delta / 2, 22 - 9 + offset, 30]) cube_fillet([max(idler_width + 2, 11), 55, 27], center = true, vertical=0, top=[0, 1, 0, 1], bottom=[0, 1, 0, 1], $fn=4);
-
- //smooth rods
- translate([-10 - bushing_xy[0], offset, 0]) {
- if(thru == true){
- translate([0, -11, 6]) rotate([-90, 0, 0]) pushfit_rod(bushing_xy[0] * 2 + 0.2, 50);
- translate([0, -11, xaxis_rod_distance+6]) rotate([-90, 0, 0]) pushfit_rod(bushing_xy[0] * 2 + 0.2, 50);
- } else {
- translate([0, -7, 6]) rotate([-90, 0, 0]) pushfit_rod(bushing_xy[0] * 2 + 0.2, 50);
- translate([0, -7, xaxis_rod_distance+6]) rotate([-90, 0, 0]) pushfit_rod(bushing_xy[0] * 2 + 0.2, 50);
- }
- }
- translate([0, 0, 5 - bushing_xy[0]]) { // m5 nut insert
- translate([0, 17, 0]) rotate([0, 0, 10]){
- //rod
- translate([0, 0, -1]) cylinder(h=(4.1 / 2 + 5), r=3, $fn=32);
- //nut
- translate([0, 0, 9]) cylinder(r=4.6, h=14.1, center = true, $fn=6);
-
- }
- }
- }
- //threaded rod
- translate([0, 17, 0]) %cylinder(h = 70, r=2.5+0.2);
-}
-
-module x_end_idler(){
- difference() {
- x_end_base(len=48 + z_delta / 3, offset=-10 - z_delta / 3);
- // idler hole
- 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([15 - 2 * single_wall_width, 0, 0]) rotate([90, 0, 90]) cylinder(r=m4_nut_diameter_horizontal / 2, h=3, $fn=6);
-
- }
- translate([-6 - x_box_width, 11, 29.5 - (max(idler_width, 16) / 2)]) cube([x_box_width + 1, 12, 1.5 + max(idler_bearing[0], 16)]);
- }
- %translate([-14 - xy_delta / 2, -9, 30.5 - (max(idler_width, 16) / 2)]) x_tensioner();
-}
-
-module x_tensioner(len=68, idler_height=max(idler_bearing[0], 16)) {
- idlermount(len=len, rod=m4_diameter / 2 + 0.5, idler_height=idler_height, narrow_len=47, narrow_width=idler_width + 2 - single_wall_width);
-}
-
-
-translate([-40, 0, 4 - bushing_xy[0]]) x_tensioner();
-translate([0, -80, 0]) mirror([1, 0, 0]) x_end_idler(thru=true);
-translate([-50, 0, 0]) mirror([1, 0, 0]) translate([-50, 0, 0])
- x_end_motor();
-
-module pushfit_rod(diameter, length){
- cylinder(h = length, r=diameter/2, $fn=30);
- translate([0, -diameter/4, length/2]) cube_fillet([diameter, diameter/2, length], vertical = [0, 0, 1, 1], center = true, $fn=4);
-
- translate([0, -diameter/2-1.2, length/2]) cube([diameter - 1, 1, length], center = true);
-}
-
-
-if (idler_bearing[3] == 1) { // bearing guides
- translate([-39, -60 - idler_bearing[0] / 2, 4 - bushing_xy[0]]) rotate([0, 0, 55]) {
- render() bearing_assy();
- }
-}
+// PRUSA iteration3
+// X end prototype
+// GNU GPL v3
+// Josef Průša <iam@josefprusa.cz> and contributors
+// http://www.reprap.org/wiki/Prusa_Mendel
+// http://prusamendel.org
+
+// Also includes code from Wilson and Wilson2, (c) Marty Rice
+// https://github.com/mjrice/wilson
+
+// todo: make x-end height global and make anything relying implicitly
+// on the height of the x-end use that for positioning.
+
+// bearing height, strain relief (&& maybe make dependent upon the bearing diameter)
+
+// major issues with rev 3
+
+// - motor side screw hole conflicts with switch / other rear mount is
+// inaccessible without removing the leadscrew from the nut
+
+// - New idler anti-pitching ribs are too big (new idler I wasn't
+// using is larger so the existing ones worked fine for that one...)
+// NOTE: new idler is meant for integrated toothed idler...
+
+use <bushing.scad>
+include <configuration.scad>
+
+pushfit_d = bushing_xy[0] * 2 + 0.25; //smooth_rod_d + 0.25;
+rod_distance = 50;
+x_box_height = 5 + rod_distance + bushing_xy[0] * 2 + 0.25;
+hex_nut_r = 4.75;
+thinwall = 3;
+
+module vertical_bushing_base(bushing){
+ bushing_size = bushing[1]*2 + 2 * thinwall;
+ translate(v=[-2-bushing_size/4,0,x_box_height/2]) cube(size = [4+bushing_size/2,bushing_size,x_box_height], center = true);
+ cylinder(h = x_box_height, r=bushing_size/2, $fn = 90);
+}
+
+module vertical_bushing_holes(bushing){
+ bushing_cut_extra = 0.2; // padding so it's not too tight
+ translate(v=[0,0,-4]) cylinder(h = x_box_height + 3, r=bushing[1] + bushing_cut_extra, $fn = 60);
+ translate(v=[0,0,x_box_height-4]) cylinder(h=x_box_height,r=bushing[1]-1,$fn=60);
+ // TODO: make translate(z) use x_box_height to correctly position slit
+ #rotate(a=[0,0,-50]) translate(v=[8,0,24/*was 31.5 mjr*/]) cube(size = [10,2 /*was 1 mjr*/ ,x_box_height+13], center = true);
+ translate([0,0,-1]) cylinder(h=9,r1=bushing[1]+thinwall/2+1,r2=4,$fn=60);
+ //#translate([0,0,49]) cylinder(h=9,r2=bushing[1]+thinwall/2,r1=4,$fn=60);
+}
+
+
+module nut_trap_base () {
+ cube(size=[16,21,8],center=true);
+ translate ([2,0,0]) cylinder(h=8,r=12.5,$fn=50,center=true);
+}
+
+module nut_trap () {
+ union() {
+ // center post of brass nut
+ cylinder(h=12,r=5.45,$fn=50,center=true);
+ // holes for m3 screws in brass nut
+ translate(v=[8,0,0]) cylinder(h=12,r=1.8,$fn=20,center=true);
+ #rotate([0,0,90]) translate(v=[8,0,0]) cylinder(h=12,r=1.8,$fn=20,center=true);
+ rotate([0,0,180]) translate(v=[8,0,0]) cylinder(h=12,r=1.8,$fn=20,center=true);
+ #rotate([0,0,270]) translate(v=[8,0,0]) cylinder(h=12,r=1.8,$fn=20,center=true);
+ }
+}
+
+module x_end_base(){
+// Main block
+height = x_box_height;
+// TODO: calculate correct translate(y) + cube(y) using size of bearing
+translate(v=[-15,-10,height/2]) cube(size = [17,45,height], center = true);
+// Bearing holder
+ vertical_bushing_base(bushing_z);
+//Nut trap
+ translate(v=[-4-zmotor_delta_y,-17-zmotor_delta_x,4]) nut_trap_base ();
+ // Cube
+// #translate(v=[-2-2,-17,4]) cube(size = [8,16,8], center = true);
+ // Hexagon
+// #translate(v=[0,-17,0]) rotate([0,0,30]) cylinder(h = 8, r=8, $fn = 6);
+}
+
+module x_end_holes(){
+ vertical_bushing_holes(bushing_z);
+ // Belt hole
+ translate(v=[-1,0,0]){
+ // Stress relief
+ translate(v=[-5.5-10+1.5,-bushing_z[1]-4,30]) cube(size = [20,1,28], center = true);
+ // Cut out for belt (this is NOT centered because the motor isn't centered)
+ difference(){
+ translate(v=[-5.5-10+1.5,-10,30]) cube(size = [10,46,28], center = true);
+
+ // Nice edges
+ translate(v=[-5.5-10+1.5,-10,30+23]) rotate([0,45,0]) cube(size = [10,46,28], center = true);
+ translate(v=[-5.5-10+1.5,-10,30+23]) rotate([0,-45,0]) cube(size = [10,46,28], center = true);
+ translate(v=[-5.5-10+1.5,-10,30-23]) rotate([0,45,0]) cube(size = [10,46,28], center = true);
+ translate(v=[-5.5-10+1.5,-10,30-23]) rotate([0,-45,0]) cube(size = [10,46,28], center = true);
+
+}
+}
+
+
+ pushrod_extra_z = 2.5;
+// Bottom pushfit rod
+#translate(v=[-15,-41.5,bushing_xy[0]+pushrod_extra_z]) rotate(a=[-90,0,0]) pushfit_rod(pushfit_d,50);
+// Top pushfit rod
+translate(v=[-15,-41.5,rod_distance+bushing_xy[0]+pushrod_extra_z]) rotate(a=[-90,0,0]) pushfit_rod(pushfit_d,50);
+// Nut trap
+translate(v=[-zmotor_delta_y,-17-zmotor_delta_x,3]) rotate ([0, 0, 45]) nut_trap ();
+// #translate(v=[0,-17,-0.5]) cylinder(h = 4, r1=3.4, r2=2.9, $fn=25);
+// translate(v=[0,-17,3]) rotate([0,0,30]) cylinder(h = 10, r=hex_nut_r, $fn = 6);
+}
+
+
+// Final prototype
+module x_end_plain(){
+ difference(){
+ x_end_base();
+ x_end_holes();
+ }
+}
+
+x_end_plain();
+
+
+module pushfit_rod(diameter,length){
+ translate([0,-0.3,0]) cylinder(h = length, r=diameter/2, $fn=30);
+ translate([0,0.3,0]) cylinder(h = length, r=diameter/2, $fn=30);
+// difference(){
+// translate(v=[0,-diameter/2.85,length/2]) rotate([0,0,45]) cube(size = [diameter/2,diameter/2,length], center = true);
+// translate(v=[0,-diameter/4-diameter/2-0.4,length/2]) rotate([0,0,0]) cube(size = [diameter,diameter/2,length], center = true);
+// }
+
+}
+