add micro switchs for X and Y

pull/9/head
Glen Chung 2013-10-19 22:34:31 +08:00
parent 984dc7a80e
commit afdf475861
3 changed files with 132 additions and 25 deletions

View File

@ -2,23 +2,63 @@
//http://www.thingiverse.com/thing:30085
//http://creativecommons.org/licenses/by-sa/3.0/
include <MCAD/units.scad>
include <MCAD/materials.scad>
include <MCAD/metric_fastners.scad>
include <MCAD/nuts_and_bolts.scad>
use <micro_switch.scad>
module end_stop_holder(with_extra_parts=false, exploded=false) {
difference() {
union() {
cube([4,43,10]); //4,45,10
translate([8, 15,0]) cylinder(h = 10, r = 8, $fn = 50);
cube([16, 15,10]);
translate([17,6,5]) cube([2,5.75,10], center=true);
translate([17,6,5]) rotate(a=[60,0,0]) cube([2,5.75,10], center=true);
translate([17,6,5]) rotate(a=[120,0,0]) cube([2,5.75,10], center=true);
}
translate([8, 15,0]) cylinder(h = 10, r = 4, $fn = 50);
translate([5, 0, 0]) cube([6, 15,10]);
translate([8, 15,-epsilon]) cylinder(h = 10+2*epsilon, r = 4, $fn = 50);
translate([5, -epsilon, -epsilon]) cube([6, 15+epsilon,10+2*epsilon]);
translate([-10, 6, 5]) rotate(a=[0, 90, 0]) cylinder(h = 30, r = 1.5, $fn= 20);
translate([-10, 28, 5]) rotate(a=[0, 90, 0]) cylinder(h = 30, r = 1, $fn= 20);
translate([-10, 38, 5]) rotate(a=[0, 90, 0]) cylinder(h = 30, r = 1, $fn= 20);
translate([17,6,5]) cube([2,3.5,6], center=true);
translate([17,6,5]) rotate(a=[60,0,0]) cube([2,3.5,6], center=true);
translate([17,6,5]) rotate(a=[120,0,0]) cube([2,3.5,6], center=true);
translate([17,6,5]) cube([2+epsilon,3.5,6], center=true);
translate([17,6,5]) rotate(a=[60,0,0]) cube([2+epsilon,3.5,6], center=true);
translate([17,6,5]) rotate(a=[120,0,0]) cube([2+epsilon,3.5,6], center=true);
}
if(with_extra_parts) {
if(exploded)
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");
translate([4+3*0.3+exploded_distance, 28-5.15+(10-9.5)/2, 5-2])
rotate([90,0,90])
micro_switch(with_extra_parts=true, exploded=(exploded_distance!=0));
echo("PART: 1 x M3 bolt 18 mm");
translate([-3*exploded_distance,6,5])
rotate([0,90,0])
color(Steel) boltHole(size=3, length=18);
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);
}
end_stop_holder();

View File

@ -1,30 +1,40 @@
include <MCAD/materials.scad>
include <MCAD/metric_fastners.scad>
module micro_switch(with_extra_parts=false) {
difference() {
cube([19.8, 10.8, 6.4]);
module micro_switch(with_extra_parts=false, exploded=false) {
scale([-1,1,1]) translate([-19.8, 0, 0]){
difference() {
color(BlackPaint) cube([19.8, 10.8, 6.4]);
translate([5.15, 2, 0]) {
translate([0, 0, -0.5])
cylinder(h = 7.4, R=2.6, $fn=100);
translate([9.5, 0, -0.5])
cylinder(h = 7.4, R=2.6, $fn=100);
translate([5.15, 2, 0]) {
translate([0, 0, -0.5])
cylinder(h = 7.4, R=2.6, $fn=100);
translate([9.5, 0, -0.5])
cylinder(h = 7.4, R=2.6, $fn=100);
}
}
}
translate([2.8, 10.8, 1.2])
rotate([0,0,10])
cube([17,1,4]);
translate([2.8, 10.8, 1.2])
rotate([0,0,10])
color(Steel) cube([17,1,4]);
if(with_extra_parts) {
// --- Self tapping screw 2.2 x 13mm ---
translate([5.15, 2, 0]) color(Steel) {
translate([0, 0, 0.5+6.4])
rotate([180,0,0]) csk_bolt(2.2, 13);
translate([9.5, 0, 0.5+6.4])
rotate([180,0,0]) csk_bolt(2.2, 13);
if(with_extra_parts) {
if(exploded)
micro_switch_extras(exploded_distance=15);
else
micro_switch_extras(exploded_distance=0);
}
}
}
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);
}
}
micro_switch();

View File

@ -12,6 +12,9 @@ use <../libs/obiscad/bcube.scad>
use <../libs/obiscad/bevel.scad>
use <../libs/build_plate.scad>
use <../smooth_rod_fix/smooth_rod_fix.scad>
use <../libs/End_Stop_Holder.scad>
use <../libs/micro_switch.scad>
layer_thickness = 0.4;
@ -309,6 +312,36 @@ module frame_extras(with_motor=1, exploded_distance=0) {
translate([0,-smooth_rod_margin-8.5-0.5*exploded_distance,Y_rod_dist_from_wall]) rotate([90,90,180])
smooth_rod_fix(with_extra_parts=true, exploded=(exploded_distance!=0));
if(with_motor) {
// this seems to reduce working area of Y axis
if(false) {
echo("PART: 1 x Micro switch on Y smooth rod for Y axis");
translate([frame_width-frame_thickness/2,frame_height,frame_thickness-2])
translate([0,-Y_rod_height+smooth_rod_margin,0])
translate([0,-smooth_rod_margin,Y_rod_dist_from_wall])
translate([-frame_thickness/2-0.5*exploded_distance, 15, 8]) rotate([180,0,0]) rotate([0,-90,0])
end_stop_holder(with_extra_parts=true, exploded=(exploded_distance!=0));
}
// this seems to reduce working area of X axis
if(fasle) {
echo("PART: 1 x Micro switch on X smooth rod for X axis");
translate([X_smooth_rods_sep_projected,-smooth_rod_margin,0])
translate([15+0.5*exploded_distance, -8, frame_thickness])
rotate([180,180,-90])
end_stop_holder(with_extra_parts=true, exploded=(exploded_distance!=0));
}
// this seems to reduce working area of X axis
if(false) {
echo("PART: 1 x Micro switch on motor frame for X axis");
rotate([90, 0, -45])
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));
}
}
if(!with_motor) {
translate([X_threaded_rod_posX,X_threaded_rod_posY,0]) {
rotate([0,0,0]) {
@ -318,6 +351,30 @@ module frame_extras(with_motor=1, exploded_distance=0) {
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");
rotate([90, 0, -45])
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));
if(true) {
echo("PART: 1 x Micro switch on Y smooth rod for Y axis");
translate([frame_width-frame_thickness/2,frame_height,frame_thickness-2])
translate([0,-Y_rod_height+smooth_rod_margin,0])
translate([0,-smooth_rod_margin,Y_rod_dist_from_wall])
translate([-frame_thickness/2-0.5*exploded_distance, 8, -15]) rotate([90,0,0]) rotate([0,-90,0])
end_stop_holder(with_extra_parts=true, exploded=(exploded_distance!=0));
}
// this seems to reduce working area of Y axis
if(false) {
echo("PART: 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([0,-Y_rod_height+smooth_rod_margin,0])
translate([0,-smooth_rod_margin-8.5-0.5*exploded_distance,0])
rotate([0, 0, 90])
micro_switch(with_extra_parts=true, exploded=(exploded_distance!=0));
}
}
}