code refactoring

pull/9/head
Glen Chung 2013-10-20 23:20:25 +08:00
parent d8a4be7cc7
commit f8addf47bd
12 changed files with 198 additions and 182 deletions

View File

@ -121,17 +121,16 @@ union() difference() {
} }
if(with_extra_parts) { if(with_extra_parts)
if(exploded) cyclone_motor_gear_extras(exploded_distance=(exploded?20:0));
cyclone_motor_gear_extras(exploded_distance=20);
else module cyclone_motor_gear_extras(exploded_distance=0) {
cyclone_motor_gear_extras(exploded_distance=0); echo("Non-Plastic Parts: 1 x Grub screw M3 x 8 mm to attach gear to motor shaft");
translate([0,2.5+8+exploded_distance,12-3.5])
rotate([90, 0, 0])
color(Steel) cylinder(r=1.5, h=8, $fn=30);
} }
} }
module cyclone_motor_gear_extras(exploded_distance=0) {
// --- M3 x 8mm grub screw to attach Gear to motor shaft ---
translate([0,2.5+8+exploded_distance,12-3.5]) rotate([90, 0, 0]) color(Steel) cylinder(r=1.5, h=8, $fn=30);
}
cyclone_motor_gear(); cyclone_motor_gear();

View File

@ -30,6 +30,8 @@
* -- * --
* DeuxVis - device@ymail.com */ * DeuxVis - device@ymail.com */
include <MCAD/metric_fastners.scad>
include <MCAD/materials.scad>
include <MCAD/teardrop.scad> include <MCAD/teardrop.scad>
include <MCAD/involute_gears.scad> include <MCAD/involute_gears.scad>
@ -77,7 +79,7 @@ module herringbone_gear( teeth=12, circles=0, shaft=5 ) {
); );
} }
module cyclone_rod_gear() { module cyclone_rod_gear(with_extra_parts=false, exploded=false) {
// Extruder Gear // Extruder Gear
difference() { difference() {
union() { union() {
@ -97,6 +99,16 @@ difference() {
translate( [0, 0, (nut_separation/2)] ) cylinder( r=M8_nut_diameter/2, h=7, $fn=6 ); translate( [0, 0, (nut_separation/2)] ) cylinder( r=M8_nut_diameter/2, h=7, $fn=6 );
} }
if(with_extra_parts)
cyclone_rod_gear_extras(exploded_distance=(exploded?12:0));
module cyclone_rod_gear_extras(exploded_distance=0) {
echo("Non-Plastic Parts: 2 x M8 nuts to attach rod_gear on threaded rod");
translate([0,0,-10/2-0.8*8-1.0*exploded_distance]) color(Steel) flat_nut(8);
translate([0,0,nut_separation/2+0.8*8+1.0*exploded_distance]) rotate([180,0,0]) color(Steel) flat_nut(8);
}
} }
cyclone_rod_gear(); cyclone_rod_gear();

View File

@ -272,12 +272,12 @@ module Z_carriage(showSpindle=false,top_part=true, with_extra_parts=false, explo
module Z_carriage_extras(top_part=true, exploded_distance=0) { module Z_carriage_extras(top_part=true, exploded_distance=0) {
if(top_part) { if(top_part) {
echo("PART: 1 x Nema 17 for Z axis"); echo("Non-Plastic Parts: 1 x Nema 17 for Z axis");
translate([-motor_width/2,0,1-exploded_distance]) translate([-motor_width/2,0,1-exploded_distance])
rotate([0,180,0]) rotate([0,180,0])
motor(Cyclone_Nema17, NemaLengthLong); motor(Cyclone_Nema17, NemaLengthLong);
echo("PART: 4 x M3 x 6mm for Z motor"); echo("Non-Plastic Parts: 4 x Bolt M3 x 6 mm for Z motor");
for(i=[-1,1]) for(j=[-1,1]) for(i=[-1,1]) for(j=[-1,1])
translate([-motor_width/2,0,0]) translate([-motor_width/2,0,0])
translate([i*motor_screw_distance/2,j*motor_screw_distance/2,2.5+exploded_distance*0.7]) { translate([i*motor_screw_distance/2,j*motor_screw_distance/2,2.5+exploded_distance*0.7]) {
@ -288,7 +288,7 @@ module Z_carriage_extras(top_part=true, exploded_distance=0) {
rotate([0,0,-90]) rotate([0,0,-90])
cyclone_motor_z_gear(with_extra_parts=true, exploded=(exploded_distance!=0)); cyclone_motor_z_gear(with_extra_parts=true, exploded=(exploded_distance!=0));
echo("PART: 1 x 608 bearing for Z motor"); echo("Non-Plastic Parts: 1 x 608 bearing for Z motor");
translate([0,0,wall_thickness/2]) translate([0,0,wall_thickness/2])
bearing(model=608); bearing(model=608);
@ -296,11 +296,13 @@ module Z_carriage_extras(top_part=true, exploded_distance=0) {
rotate([180,0,11]) rotate([180,0,11])
cyclone_rod_z_gear(with_extra_parts=true, exploded=(exploded_distance!=0)); cyclone_rod_z_gear(with_extra_parts=true, exploded=(exploded_distance!=0));
} }
else
echo("Non-Plastic Parts: 1 x Spindle");
if(top_part) if(top_part)
echo("PART: 2 x LM8UU for Z_carriage top part"); echo("Non-Plastic Parts: 2 x LM8UU for Z_carriage top part");
else else
echo("PART: 2 x LM8UU for Z_carriage bottom part"); echo("Non-Plastic Parts: 2 x LM8UU for Z_carriage bottom part");
rotate([0,0,-90]) rotate([0,0,-90])
translate([-wall_height/2,-Z_threaded_pos,0]) { translate([-wall_height/2,-Z_threaded_pos,0]) {
translate([wall_height/2-Z_smooth_rods_sep/2,Z_threaded_pos,0]) translate([wall_height/2-Z_smooth_rods_sep/2,Z_threaded_pos,0])
@ -312,12 +314,12 @@ module Z_carriage_extras(top_part=true, exploded_distance=0) {
} }
if(top_part) { if(top_part) {
echo("PART: 1 x M3 x 20 mm for Z_carriage part"); echo("Non-Plastic Parts: 1 x M3 x 20 mm for Z_carriage part");
echo("PART: 1 x M3 nut forZ_carriage top part"); echo("Non-Plastic Parts: 1 x M3 nut for Z_carriage top part");
} }
else { else {
echo("PART: 1 x M3 x 20 mm for Z_carriage bottom part"); echo("Non-Plastic Parts: 1 x M3 x 20 mm for Z_carriage bottom part");
echo("PART: 1 x M3 nut for Z_carriage bottom part"); echo("Non-Plastic Parts: 1 x M3 nut for Z_carriage bottom part");
} }
rotate([0,top_part ? 0:180,-90]) translate([-wall_height/2,0,0]) rotate([0,top_part ? 0:180,-90]) translate([-wall_height/2,0,0])
translate([wall_height/2,wall_width+(top_part?-1:-1.5),0]) { translate([wall_height/2,wall_width+(top_part?-1:-1.5),0]) {

View File

@ -81,7 +81,7 @@ module herringbone_gear( teeth=12, circles=0, shaft=5 ) {
); );
} }
module cyclone_motor_z_gear(with_extra_parts=false) { module cyclone_motor_z_gear(with_extra_parts=false, exploded=false) {
// Motor gear // Motor gear
rotate([180,0,0]) union() difference() { rotate([180,0,0]) union() difference() {
union() { union() {
@ -119,7 +119,7 @@ rotate([180,0,0]) union() difference() {
cyclone_motor_z_gear_extras(exploded_distance = (exploded?24:0)); cyclone_motor_z_gear_extras(exploded_distance = (exploded?24:0));
module cyclone_motor_z_gear_extras(exploded_distance=0) { module cyclone_motor_z_gear_extras(exploded_distance=0) {
echo("PART: 1 x M3 x 8 mm grub screw to attach Z motor gear to motor shaft"); echo("Non-Plastic Parts: 1 x Grub screw M3 x 8 mm to attach Z motor gear to motor shaft");
translate([0,-2.5-exploded_distance,-(12-3.5)]) rotate([90, 0, 0]) color(Steel) cylinder(r=1.5, h=8, $fn=30); translate([0,-2.5-exploded_distance,-(12-3.5)]) rotate([90, 0, 0]) color(Steel) cylinder(r=1.5, h=8, $fn=30);
} }
} }

View File

@ -100,10 +100,10 @@ difference() {
} }
if(with_extra_parts) if(with_extra_parts)
cyclone_rod_z_gear(exploded_distance = (exploded ?8:0)); cyclone_rod_z_gear_extras(exploded_distance = (exploded ?8:0));
module cyclone_rod_z_gear(exploded_distance=false) { module cyclone_rod_z_gear_extras(exploded_distance=false) {
echo("PART: 2 x M8 nut for Z rod gear"); echo("Non-Plastic Parts: 2 x M8 nut for rod_gear");
translate([0,0,0.8*8+nut_separation/2+exploded_distance]) rotate([180,0,0]) color(Steel) flat_nut(8); translate([0,0,0.8*8+nut_separation/2+exploded_distance]) rotate([180,0,0]) color(Steel) flat_nut(8);
translate([0,0,-0.8*8-10/2-exploded_distance]) rotate([0,0,0]) color(Steel) flat_nut(8); translate([0,0,-0.8*8-10/2-exploded_distance]) rotate([0,0,0]) color(Steel) flat_nut(8);
} }

View File

@ -95,30 +95,29 @@ translate([frame_width-frame_thickness,frame_height,frame_thickness-2])
} // End of union() command } // End of union() command
if(with_extra_parts) { if(with_extra_parts)
if(exploded) Y_rod_idler_extras(exploded_distance=(exploded?20:0));
Y_rod_idler_extras(with_extra_parts=with_extra_parts, exploded_distance=20);
else module Y_rod_idler_extras(exploded_distance=0) {
Y_rod_idler_extras(with_extra_parts=with_extra_parts, exploded_distance=0); screw_size = 2.9;
screw_length = 16;
echo("Non-Plastic Parts: 2 x Self tapping screw 2.9 x 16 mm for Y_rod_idler");
rotate([90,0,0]) translate([frame_width/3,Y_rod_support_lenght/2.5,-frame_height+bottom_thickness+.2+exploded_distance])
rotate([180,0,0]) color(Steel) {
translate([-5,0,0])
csk_bolt(screw_size, screw_length);
translate([5,0,0])
csk_bolt(screw_size, screw_length);
}
// --- Y smooth rod fix ---
translate([frame_width-frame_thickness,frame_height,frame_thickness-2])
translate([0,-Y_rod_height+smooth_rod_margin,0])
translate([0,-smooth_rod_margin-8.5-exploded_distance,Y_rod_dist_from_wall]) rotate([270,90,0])
smooth_rod_fix(with_extra_parts=true,exploded = (exploded_distance!=0));
} }
} }
module Y_rod_idler_extras(exploded_distance=0) {
// --- Self tapping screw 2.9 x 16mm ---
rotate([90,0,0]) translate([frame_width/3,Y_rod_support_lenght/2.5,-frame_height+bottom_thickness+.2+exploded_distance])
rotate([180,0,0]) color(Steel) {
translate([-5,0,0])
csk_bolt(2.9, 16);
translate([5,0,0])
csk_bolt(2.9, 16);
}
// --- Y smooth rod fix ---
translate([frame_width-frame_thickness,frame_height,frame_thickness-2])
translate([0,-Y_rod_height+smooth_rod_margin,0])
translate([0,-smooth_rod_margin-8.5-exploded_distance,Y_rod_dist_from_wall]) rotate([270,90,0])
smooth_rod_fix(with_extra_parts=true,exploded = (exploded_distance!=0));
}
Y_rod_idler(show_printbed = 1); Y_rod_idler(show_printbed = 1);
//scale([-1,1,1]) Y_rod_idler(show_printbed = 1); //scale([-1,1,1]) Y_rod_idler(show_printbed = 1);

View File

@ -84,24 +84,25 @@ module lm8uu_bearing_holder(with_extra_parts=false, exploded=false) {
//cube([plate_width+3,plate_width+3,100],center=true); //cube([plate_width+3,plate_width+3,100],center=true);
cylinder(r=(plate_width+10)/2,h=100,center=true,$fn=8); cylinder(r=(plate_width+10)/2,h=100,center=true,$fn=8);
} }
if(with_extra_parts) { if(with_extra_parts)
if(exploded) lm8uu_bearing_holder_extras(exploded_distance=(exploded?1.3*linearBearing_L("LM8UU"):0));
lm8uu_bearing_holder_extras(exploded_distance=1.3*linearBearing_L("LM8UU"));
else module lm8uu_bearing_holder_extras(exploded_distance=0) {
lm8uu_bearing_holder_extras(exploded_distance=0); echo("Non-Plastic Parts: 1 x LM8UU linear ball bearing for lm8uu_bearing_holder");
rotate([90,0,90]) translate([0,0,LM8UU_dia/2+2]) rotate([90,0,0])
translate([0,0,exploded_distance])
linearBearing(pos=[0,0,-linearBearing_L("LM8UU")/2], model="LM8UU");
screw_size = 3.5;
screw_length = 13;
echo("Non-Plastic Parts: 1 x Self tapping screw 3.5 x 13 mm to attach lm8uu_bearing_holder on work bed");
translate([plate_height-3+0.2+0.5*exploded_distance,screw_space_x/2,0]) rotate([0,-90,0])
color(Steel) csk_bolt(screw_size, screw_length);
} }
} }
module lm8uu_bearing_holder_extras(exploded_distance=0) {
echo("PART: 1 x LM8UU linear ball bearing for Y axis");
rotate([90,0,90]) translate([0,0,LM8UU_dia/2+2]) rotate([90,0,0])
translate([0,0,exploded_distance])
linearBearing(pos=[0,0,-linearBearing_L("LM8UU")/2], model="LM8UU");
echo("PART: 1 x Self tapping screw 3.5 x 13 mm");
translate([plate_height-3+0.2+0.5*exploded_distance,screw_space_x/2,0]) rotate([0,-90,0])
color(Steel) csk_bolt(3.5, 13);
}
lm8uu_bearing_holder(); lm8uu_bearing_holder();

View File

@ -108,30 +108,31 @@ module motor_stand_no_base_extras(with_motor=false, exploded_distance=0) {
// --- additional parts for assembly instruction --- // --- additional parts for assembly instruction ---
if(with_motor) { if(with_motor) {
translate([motor_width/2,motor_width/2,0]) { translate([motor_width/2,motor_width/2,0]) {
// --- Nema 17 Stepper ---
rotate([0,180,0]) rotate([0,180,0])
translate([0,0,-1+exploded_distance]) translate([0,0,-1+exploded_distance])
motor(Cyclone_Nema17, NemaLengthLong); motor(Cyclone_Nema17, NemaLengthLong);
echo("Non-Plastic Parts: 1 x Nema 17 motor");
// --- Motor Gear --- // --- Motor Gear ---
translate([0,0,12+5.5+exploded_distance]) { translate([0,0,12+5.5+exploded_distance])
rotate([180, 0, -90]) cyclone_motor_gear(with_extra_parts=true, exploded=(exploded_distance!=0)); rotate([180, 0, -90])
} cyclone_motor_gear(with_extra_parts=true, exploded=(exploded_distance!=0));
} }
translate([motor_width/2,motor_width/2,wall_thickness/2]) { translate([motor_width/2,motor_width/2,wall_thickness/2]) {
rotate([0,0,15]) translate([0,axis_distance,2.5-wall_thickness/2]) { rotate([0,0,15]) translate([0,axis_distance,2.5-wall_thickness/2]) {
// --- Bearing --- echo("Non-Plastic Parts: 1 x 608 bearing for motor stand");
translate([0,0,0.5*exploded_distance]) bearing(model=608); translate([0,0,0.5*exploded_distance])
// --- M8 Nut --- bearing(model=608);
translate([0,0,7+1.0*exploded_distance]) color(Steel) flat_nut(8);
// --- Rod Gear --- // --- Rod Gear ---
translate([0,0,1.5-wall_thickness/2+5+2.5+7+3+1.5*exploded_distance]) rotate([0,180,15]) cyclone_rod_gear(); translate([0,0,1.5-wall_thickness/2+5+2.5+7+3+1.5*exploded_distance])
// --- M8 Nut --- rotate([0,180,15])
translate([0,0,1.5-wall_thickness/2+5+2.5+7+3+1.5+10+2*exploded_distance]) rotate([0,180,0]) color(Steel) flat_nut(8); cyclone_rod_gear(with_extra_parts=true, exploded=(exploded_distance!=0));
} }
} }
// --- M3 x 6mm bolts for holding the motor --- echo("Non-Plastic Parts: 4 x M3 x 6mm bolts to attach motor on motor_stand");
for(i=[-1,1]) for(j=[-1,1]) for(i=[-1,1]) for(j=[-1,1])
translate([motor_width/2,motor_width/2,wall_thickness/2]) translate([motor_width/2,motor_width/2,wall_thickness/2])
translate([i*motor_screw_distance/2,j*motor_screw_distance/2,2.5-wall_thickness/2+exploded_distance*0.7]) { translate([i*motor_screw_distance/2,j*motor_screw_distance/2,2.5-wall_thickness/2+exploded_distance*0.7]) {
@ -142,24 +143,22 @@ module motor_stand_no_base_extras(with_motor=false, exploded_distance=0) {
if(!with_motor) { if(!with_motor) {
translate([motor_width/2,motor_width/2,wall_thickness/2]) translate([motor_width/2,motor_width/2,wall_thickness/2])
rotate([0,0,15]) translate([0,axis_distance,2.5-wall_thickness/2]) color(Steel) { rotate([0,0,15]) translate([0,axis_distance,2.5-wall_thickness/2]) color(Steel) {
// --- 608 bearing --- echo("Non-Plastic Parts: 1 x 608 bearing for idle stand");
translate([0,0,0.5*exploded_distance]) bearing(model=608); translate([0,0,0.3*exploded_distance]) bearing(model=608);
// --- M8 washer ---
translate([0,0,7+1.0*exploded_distance]) washer(8); echo("Non-Plastic Parts: 1 x M8 washer for idle stand");
// --- M8 nut --- translate([0,0,7+0.6*exploded_distance]) washer(8);
translate([0,0,6.4+7+0.8+1.5*exploded_distance]) rotate([0,180,0]) flat_nut(8);
echo("Non-Plastic Parts: 1 x M8 nut to attach threaded rod on idle stand");
translate([0,0,6.4+7+0.8+0.9*exploded_distance]) rotate([0,180,0]) flat_nut(8);
} }
} }
} }
module motor_stand_no_base(with_motor=true, with_extra_parts=false, exploded=false) { module motor_stand_no_base(with_motor=true, with_extra_parts=false, exploded=false) {
if(with_extra_parts) { if(with_extra_parts)
if(exploded) motor_stand_no_base_extras(with_motor=with_motor, exploded_distance=(exploded?30:0));
motor_stand_no_base_extras(with_motor=with_motor, exploded_distance=30);
else
motor_stand_no_base_extras(with_motor=with_motor, exploded_distance=0);
}
difference() { difference() {
translate([wall_height/2,totalWallWidth/2-wall_extraWidth_left,wall_thickness/2]) translate([wall_height/2,totalWallWidth/2-wall_extraWidth_left,wall_thickness/2])
@ -181,17 +180,6 @@ difference() {
} // End of difference } // End of difference
} }
module holder_extras(exploded_distance=0) {
// --- Self tapping screw 2.9 x 16mm ---
translate([wall_height,base_width/2+2.5,base_length/1.5]) color(Steel)
rotate([0,90,0]) {
translate([-5,0,-bottom_thickness-.2-exploded_distance])
csk_bolt(2.9, 16);
translate([5,0,-bottom_thickness-.2-exploded_distance])
csk_bolt(2.9, 16);
}
}
module holder(h=35,noScrews=false,base_width_inc=0, with_extra_parts=false, exploded=false) { module holder(h=35,noScrews=false,base_width_inc=0, with_extra_parts=false, exploded=false) {
difference() { difference() {
union() { union() {
@ -213,13 +201,6 @@ module holder(h=35,noScrews=false,base_width_inc=0, with_extra_parts=false, expl
cylinder(r=base_screw_diameter/2,h=100,center=true,$fn=7); cylinder(r=base_screw_diameter/2,h=100,center=true,$fn=7);
} }
} // End of difference } // End of difference
if(with_extra_parts) {
if(exploded)
holder_extras(17);
else
holder_extras(0);
}
} }
module motor_stand(with_motor=true, with_extra_parts=false, exploded=false) { module motor_stand(with_motor=true, with_extra_parts=false, exploded=false) {
@ -229,10 +210,16 @@ module motor_stand(with_motor=true, with_extra_parts=false, exploded=false) {
translate([0,52.4-5/2]) holder(h=12,base_width_inc=1, with_extra_parts=with_extra_parts, exploded=exploded); translate([0,52.4-5/2]) holder(h=12,base_width_inc=1, with_extra_parts=with_extra_parts, exploded=exploded);
translate([0,-wall_extraWidth_left+base_width]) scale([1,-1,1]) holder(with_extra_parts=with_extra_parts, exploded=exploded); translate([0,-wall_extraWidth_left+base_width]) scale([1,-1,1]) holder(with_extra_parts=with_extra_parts, exploded=exploded);
} }
if(with_extra_parts && with_motor) {
translate([0,52.4-5/2])
idle_stand_extras(exploded_distance=(exploded?17:0));
translate([0,-wall_extraWidth_left+base_width]) scale([1,-1,1])
idle_stand_extras(exploded_distance=(exploded?17:0));
}
} }
module idle_stand(with_extra_parts=false) { module idle_stand(with_extra_parts=false, exploded=false) {
union() { union() {
intersection() { // Remove the motor part intersection() { // Remove the motor part
motor_stand(with_motor=false, with_extra_parts=with_extra_parts, exploded=exploded); motor_stand(with_motor=false, with_extra_parts=with_extra_parts, exploded=exploded);
@ -246,6 +233,26 @@ module idle_stand(with_extra_parts=false) {
translate([0,wall_width+5-2*(wall_width+wall_extraWidth_right-52.4)]) holder(noScrews=true, with_extra_parts=with_extra_parts, exploded=exploded); translate([0,wall_width+5-2*(wall_width+wall_extraWidth_right-52.4)]) holder(noScrews=true, with_extra_parts=with_extra_parts, exploded=exploded);
translate([0,52.4+5/2]) scale([1,-1,1]) holder(h=15,base_width_inc=1, with_extra_parts=with_extra_parts, exploded=exploded); translate([0,52.4+5/2]) scale([1,-1,1]) holder(h=15,base_width_inc=1, with_extra_parts=with_extra_parts, exploded=exploded);
} }
if(with_extra_parts) {
translate([0,wall_width+5-2*(wall_width+wall_extraWidth_right-52.4)])
idle_stand_extras(exploded_distance=(exploded?17:0));
translate([0,52.4-5/2, 0])
idle_stand_extras(exploded_distance=(exploded?17:0));
}
}
module idle_stand_extras(exploded_distance=0) {
screw_size = 2.9;
screw_length = 16;
echo("Non-Plastic Parts: 2 x Self tapping screw 2.9 x 16 mm for motor_stand");
translate([wall_height,base_width/2+2.5,base_length/1.5]) color(Steel)
rotate([0,90,0]) {
translate([-5,0,-bottom_thickness-.2-exploded_distance])
csk_bolt(screw_size, screw_length);
translate([5,0,-bottom_thickness-.2-exploded_distance])
csk_bolt(screw_size, screw_length);
}
} }
//for display only, doesn't contribute to final object //for display only, doesn't contribute to final object

View File

@ -30,34 +30,32 @@ difference() {
} }
if(with_extra_parts) { if(with_extra_parts) {
if(exploded) end_stop_holder_extras(exploded_distance=(exploded?8:0));
end_stop_holder_extras(exploded_distance=8);
else
end_stop_holder_extras(exploded_distance=0);
}
}
module end_stop_holder_extras(exploded_distance=0) {
echo("PART: 6 x M3 washer");
for(i = [0:2] ) {
translate([4+i*0.3+(i+1)*0.2*exploded_distance, 28, 5]) rotate([0, 90, 0]) color(Steel) washer(3);
translate([4+i*0.3+(i+1)*0.2*exploded_distance, 38, 5]) rotate([0, 90, 0]) color(Steel) washer(3);
} }
echo("PART: 1 x Micro switch"); module end_stop_holder_extras(exploded_distance=0) {
translate([4+3*0.3+exploded_distance, 28-5.15+(10-9.5)/2, 5-2]) echo("Non-Plastic Parts: 6 x M3 washer to attach micro switch on end_stop_holder");
rotate([90,0,90]) for(i = [0:2] ) {
micro_switch(with_extra_parts=true, exploded=(exploded_distance!=0)); translate([4+i*0.3+(i+1)*0.2*exploded_distance, 28, 5]) rotate([0, 90, 0]) color(Steel) washer(3);
translate([4+i*0.3+(i+1)*0.2*exploded_distance, 38, 5]) rotate([0, 90, 0]) color(Steel) washer(3);
}
echo("PART: 1 x M3 bolt 18 mm"); echo("Non-Plastic Parts: 1 x Micro switch on end_stop_holder");
translate([-3*exploded_distance,6,5]) translate([4+3*0.3+exploded_distance, 28-5.15+(10-9.5)/2, 5-2])
rotate([0,90,0]) rotate([90,0,90])
color(Steel) boltHole(size=3, length=18); micro_switch(with_extra_parts=true, exploded=(exploded_distance!=0));
echo("Non-Plastic Parts: 1 x M3 x 18 mm bolt to attach end_stop_holder on smooth rod");
translate([-3*exploded_distance,6,5])
rotate([0,90,0])
color(Steel) boltHole(size=3, length=18);
echo("Non-Plastic Parts: 1 x M3 nut to attach end_stop_holder on smooth rod");
translate([17+0.9*3/2+exploded_distance,6,5])
rotate([0,-90,0])
rotate([0,0,30]) color(Steel) flat_nut(3);
}
echo("PART: 1 x M3 nut");
translate([17+0.9*3/2+exploded_distance,6,5])
rotate([0,-90,0])
rotate([0,0,30]) color(Steel) flat_nut(3);
} }

View File

@ -17,23 +17,22 @@ module micro_switch(with_extra_parts=false, exploded=false) {
rotate([0,0,10]) rotate([0,0,10])
color(Steel) cube([17,1,4]); color(Steel) cube([17,1,4]);
if(with_extra_parts) { if(with_extra_parts)
if(exploded) micro_switch_extras(exploded_distance=(exploded?15:0));
micro_switch_extras(exploded_distance=15); }
else
micro_switch_extras(exploded_distance=0); module micro_switch_extras(exploded_distance=0) {
screw_size = 2.2;
screw_length = 13;
echo("Non-Plastic Parts: 2 x Self tapping screw 2.2 x 13 mm for micro switch");
translate([5.15, 2, 0]) color(Steel) {
translate([0, 0, 0.5+6.4+exploded_distance])
rotate([180,0,0]) csk_bolt(screw_size, screw_length);
translate([9.5, 0, 0.5+6.4+exploded_distance])
rotate([180,0,0]) csk_bolt(screw_size, screw_length);
} }
} }
}
module micro_switch_extras(exploded_distance=0) {
echo("PART: 2 x Self tapping screw 2.2 x 13 mm");
translate([5.15, 2, 0]) color(Steel) {
translate([0, 0, 0.5+6.4+exploded_distance])
rotate([180,0,0]) csk_bolt(2.2, 13);
translate([9.5, 0, 0.5+6.4+exploded_distance])
rotate([180,0,0]) csk_bolt(2.2, 13);
}
} }

View File

@ -244,12 +244,8 @@ translate([frame_width-frame_thickness/2,frame_height,frame_thickness-2])
} }
} }
if(with_extra_parts) { if(with_extra_parts)
if(exploded) frame_extras(with_motor=with_motor, exploded_distance=(exploded?30:0));
frame_extras(with_motor=with_motor, exploded_distance=30);
else
frame_extras(with_motor=with_motor, exploded_distance=0);
}
} // End of union() command } // End of union() command
@ -260,13 +256,15 @@ module frame_extras(with_motor=1, exploded_distance=0) {
translate([X_threaded_rod_posX,X_threaded_rod_posY,0]) { translate([X_threaded_rod_posX,X_threaded_rod_posY,0]) {
rotate([0,0,-motor_axis_angle]) translate([motor_axis_distance,0,0]) rotate([0,0,90+motor_axis_angle]) { rotate([0,0,-motor_axis_angle]) translate([motor_axis_distance,0,0]) rotate([0,0,90+motor_axis_angle]) {
translate([0,0,wall_thickness-1]) { translate([0,0,wall_thickness-1]) {
// --- Stepper --- echo("Non-Plastic Parts: 1 x Nema 17 on motor frame");
translate([0,0,exploded_distance]) motor(Cyclone_Nema17, NemaLengthLong); translate([0,0,exploded_distance]) motor(Cyclone_Nema17, NemaLengthLong);
// --- Motor gear --- // --- Motor gear ---
translate([0,0,-12-5.5+1-0.5*exploded_distance]) translate([0,0,-12-5.5+1-0.5*exploded_distance])
cyclone_motor_gear(with_extra_parts=true, exploded=(exploded_distance!=0)); cyclone_motor_gear(with_extra_parts=true, exploded=(exploded_distance!=0));
} }
// --- M3 x 8 mm bolts for holding the motor ---
echo("Non-Plastic Parts: 4 x Bolts M3 x 8 mm to attach motor on frame");
for(i=[-1,1]) for(j=[-1,1]) for(i=[-1,1]) for(j=[-1,1])
translate([i*motor_screw_distance/2,j*motor_screw_distance/2,0]) translate([i*motor_screw_distance/2,j*motor_screw_distance/2,0])
translate([0,0,-0.4*exploded_distance]) { translate([0,0,-0.4*exploded_distance]) {
@ -277,26 +275,27 @@ module frame_extras(with_motor=1, exploded_distance=0) {
translate([X_threaded_rod_posX,X_threaded_rod_posY,0]) { translate([X_threaded_rod_posX,X_threaded_rod_posY,0]) {
rotate([0,0,0]) { rotate([0,0,0]) {
// --- Bearing --- echo("Non-Plastic Parts: 1 x 608 bearing for motor frame");
translate([0,0,-1.0-7/2-0.2*exploded_distance]) bearing(model=608); translate([0,0,-1.0-7/2-0.2*exploded_distance]) bearing(model=608);
// --- M8 Nut ---
translate([0,0,-1.0-7/2-0.6*exploded_distance]) rotate([0,180,0]) color(Steel) flat_nut(8);
// --- Rod Gear --- // --- Rod Gear ---
translate([0,0,-8-1.0-7/2-1.0*exploded_distance]) rotate([0,0,6]) cyclone_rod_gear(); translate([0,0,-8-1.0-7/2-1.0*exploded_distance])
// --- M8 Nut --- rotate([0,0,6])
translate([0,0,-11.5-8-1.0-7/2-1.2*exploded_distance]) color(Steel) flat_nut(8); cyclone_rod_gear(with_extra_parts=true, exploded=(exploded_distance!=0));
} }
} }
} }
// --- Self tapping screw 2.9 x 16mm --- screw_size = 2.9;
screw_length = 16;
echo("Non-Plastic Parts: 3 x Self tapping screw 2.9 x 16 mm to attach frame on base");
rotate([90,0,0]) translate([frame_width/2,frame_thickness/2,-frame_height+frame_thickness/2+.2+exploded_distance]) color(Steel) { rotate([90,0,0]) translate([frame_width/2,frame_thickness/2,-frame_height+frame_thickness/2+.2+exploded_distance]) color(Steel) {
translate([-base_screw_distance,0,0]) rotate([180,0,0]) translate([-base_screw_distance,0,0]) rotate([180,0,0])
csk_bolt(2.9, 16); csk_bolt(screw_size, screw_length);
translate([base_screw_distance*0.8,0,0]) rotate([180,0,0]) translate([base_screw_distance*0.8,0,0]) rotate([180,0,0])
csk_bolt(2.9, 16); csk_bolt(screw_size, screw_length);
translate([base_screw_distance*0.2,0,0]) rotate([180,0,0]) translate([base_screw_distance*0.2,0,0]) rotate([180,0,0])
csk_bolt(2.9, 16); csk_bolt(screw_size, screw_length);
} }
// --- X smooth rod fix --- // --- X smooth rod fix ---
@ -316,7 +315,7 @@ module frame_extras(with_motor=1, exploded_distance=0) {
// this seems to reduce working area of Y axis // this seems to reduce working area of Y axis
if(false) { if(false) {
echo("PART: 1 x Micro switch on Y smooth rod for Y axis"); echo("Non-Plastic Parts: 1 x Micro switch on Y smooth rod for Y axis");
translate([frame_width-frame_thickness/2,frame_height,frame_thickness-2]) translate([frame_width-frame_thickness/2,frame_height,frame_thickness-2])
translate([0,-Y_rod_height+smooth_rod_margin,0]) translate([0,-Y_rod_height+smooth_rod_margin,0])
translate([0,-smooth_rod_margin,Y_rod_dist_from_wall]) translate([0,-smooth_rod_margin,Y_rod_dist_from_wall])
@ -325,8 +324,8 @@ module frame_extras(with_motor=1, exploded_distance=0) {
} }
// this seems to reduce working area of X axis // this seems to reduce working area of X axis
if(fasle) { if(false) {
echo("PART: 1 x Micro switch on X smooth rod for X axis"); echo("Non-Plastic Parts: 1 x Micro switch on X smooth rod for X axis");
translate([X_smooth_rods_sep_projected,-smooth_rod_margin,0]) translate([X_smooth_rods_sep_projected,-smooth_rod_margin,0])
translate([15+0.5*exploded_distance, -8, frame_thickness]) translate([15+0.5*exploded_distance, -8, frame_thickness])
rotate([180,180,-90]) rotate([180,180,-90])
@ -335,7 +334,7 @@ module frame_extras(with_motor=1, exploded_distance=0) {
// this seems to reduce working area of X axis // this seems to reduce working area of X axis
if(false) { if(false) {
echo("PART: 1 x Micro switch on motor frame for X axis"); echo("Non-Plastic Parts: 1 x Micro switch on motor frame for X axis");
rotate([90, 0, -45]) rotate([90, 0, -45])
translate([X_rods_corner_shaft_size/2-19.8,0,-X_rods_corner_shaft_size/2+0.5*exploded_distance]) translate([X_rods_corner_shaft_size/2-19.8,0,-X_rods_corner_shaft_size/2+0.5*exploded_distance])
micro_switch(with_extra_parts=true, exploded=(exploded_distance!=0)); micro_switch(with_extra_parts=true, exploded=(exploded_distance!=0));
@ -345,20 +344,21 @@ module frame_extras(with_motor=1, exploded_distance=0) {
if(!with_motor) { if(!with_motor) {
translate([X_threaded_rod_posX,X_threaded_rod_posY,0]) { translate([X_threaded_rod_posX,X_threaded_rod_posY,0]) {
rotate([0,0,0]) { rotate([0,0,0]) {
// --- Bearing --- echo("Non-Plastic Parts: 1 x 608 bearing for no motor frame");
translate([0,0,-1.0-7/2-0.2*exploded_distance]) bearing(model=608); translate([0,0,-1.0-7/2-0.2*exploded_distance]) bearing(model=608);
// --- M8 Nut ---
echo("Non-Plastic Parts: 1 x M8 nut to attach threaded rod on no motor frame");
translate([0,0,-6.5-1.0-7/2-0.6*exploded_distance]) rotate([0,0,0]) color(Steel) flat_nut(8); translate([0,0,-6.5-1.0-7/2-0.6*exploded_distance]) rotate([0,0,0]) color(Steel) flat_nut(8);
} }
} }
echo("PART: 1 x Micro switch on no motor frame for X axis"); echo("Non-Plastic Parts: 1 x Micro switch on no motor frame for X axis");
rotate([90, 0, -45]) rotate([90, 0, -45])
translate([X_rods_corner_shaft_size/2-19.8,0,-X_rods_corner_shaft_size/2+0.5*exploded_distance]) translate([X_rods_corner_shaft_size/2-19.8,0,-X_rods_corner_shaft_size/2+0.5*exploded_distance])
micro_switch(with_extra_parts=true, exploded=(exploded_distance!=0)); micro_switch(with_extra_parts=true, exploded=(exploded_distance!=0));
if(true) { if(true) {
echo("PART: 1 x Micro switch on Y smooth rod for Y axis"); echo("Non-Plastic Parts: 1 x Micro switch on Y smooth rod for Y axis");
translate([frame_width-frame_thickness/2,frame_height,frame_thickness-2]) translate([frame_width-frame_thickness/2,frame_height,frame_thickness-2])
translate([0,-Y_rod_height+smooth_rod_margin,0]) translate([0,-Y_rod_height+smooth_rod_margin,0])
translate([0,-smooth_rod_margin,Y_rod_dist_from_wall]) translate([0,-smooth_rod_margin,Y_rod_dist_from_wall])
@ -368,7 +368,7 @@ module frame_extras(with_motor=1, exploded_distance=0) {
// this seems to reduce working area of Y axis // this seems to reduce working area of Y axis
if(false) { if(false) {
echo("PART: 1 x Micro switch on no motor frame for Y axis"); echo("Non-Plastic Parts: 1 x Micro switch on no motor frame for Y axis");
translate([frame_width-frame_thickness/2+10.8/2-0.5,frame_height-19.8-2,frame_thickness]) translate([frame_width-frame_thickness/2+10.8/2-0.5,frame_height-19.8-2,frame_thickness])
translate([0,-Y_rod_height+smooth_rod_margin,0]) translate([0,-Y_rod_height+smooth_rod_margin,0])
translate([0,-smooth_rod_margin-8.5-0.5*exploded_distance,0]) translate([0,-smooth_rod_margin-8.5-0.5*exploded_distance,0])

View File

@ -43,24 +43,23 @@ translate([0,0,part_z/2]) difference() {
} // End of difference() command } // End of difference() command
if(with_extra_parts) { if(with_extra_parts)
if(exploded) smooth_rod_fix_extras(exploded_distance=(exploded?20:0));
smooth_rod_fix_extras(exploded_distance=20);
else
smooth_rod_fix_extras(exploded_distance=0);
}
}
module smooth_rod_fix_extras(exploded_distance=0) { module smooth_rod_fix_extras(exploded_distance=0) {
// --- Self tapping screw 2.9 x 16 mm --- screw_size = 2.9;
color(Steel) { screw_length = 16;
translate([0,0,-.2-exploded_distance]) { echo("Non-Plastic Parts: 2 x Self tapping screw 2.9 x 16 mm for smooth_rod_fix");
translate([-smooth_rod_screw_sep,0,0]) color(Steel) {
csk_bolt(2.9, 16); translate([0,0,-.2-exploded_distance]) {
translate([smooth_rod_screw_sep,0,0]) translate([-smooth_rod_screw_sep,0,0])
csk_bolt(2.9, 16); csk_bolt(screw_size, screw_length);
translate([smooth_rod_screw_sep,0,0])
csk_bolt(screw_size, screw_length);
}
} }
} }
} }
smooth_rod_fix(); smooth_rod_fix();