Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OpenSCAD source code: CNC 3018-Pro Home switch mounts
// 3018-Pro Mount for Makerbot Endstop PCB
// Ed Nisley KE4ZNU - 2019-07
/* [Build Options] */
Layout = "Show"; // [Build, Show]
/* [Hidden] */
ThreadThick = 0.25; // [0.20, 0.25]
ThreadWidth = 0.40; // [0.40]
function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
Protrusion = 0.01; // [0.01, 0.1]
HoleWindage = 0.2;
ID = 0;
OD = 1;
LENGTH = 2;
//- Shapes
// Basic PCB with hole for switch pins
// origin at switch actuator corner, as seen looking at component side
SwitchClear = [15.0,5.0,2.0]; // clearance around switch pins
SwitchOffset = [12.5,9.0,0.0]; // center of switch pins from actuator corner
PCB = [26.0,16.4,2*SwitchClear.z]; // switch PCB beyond connector, pin height
XBlock = [PCB.x,PCB.y,5.0];
module XMount() {
difference() {
cube(XBlock,center=false);
translate(SwitchOffset + [0,0,XBlock.z - SwitchClear.z/2])
cube(SwitchClear + [0,0,Protrusion],center=true);
}
}
YBlock = [PCB.x + 10.0,PCB.y,20.0];
module YMount() {
difference() {
translate([-10.0,0,0])
cube(YBlock,center=false);
translate([0,-Protrusion,10.0])
cube(YBlock + [0,2*Protrusion,0],center=false);
translate(SwitchOffset + [0,0,10.0 - SwitchClear.z/2])
cube(SwitchClear + [0,0,Protrusion],center=true);
}
}
ZBlock = [PCB.x,PCB.y,6.0];
ZPin = [20.0,10.0,5.5];
module ZMount() {
difference() {
cube(ZBlock,center=false);
translate(SwitchOffset + [0,0,ZBlock.z - SwitchClear.z/2])
cube(SwitchClear + [0,0,Protrusion],center=true);
}
translate([0,-ZBlock.y,0])
difference() {
cube(ZPin,center=false);
translate([ZPin.x/2,-Protrusion,4.0])
cube(ZPin + [0,2*Protrusion,0],center=false);
}
}
//- Build things
if (Layout == "Show") {
translate([0,YBlock.y,0])
XMount();
translate([0,-YBlock.y/2])
YMount();
translate([0,-(ZBlock.y + YBlock.y)])
ZMount();
}
@ednisley

This comment has been minimized.

Copy link
Owner Author

commented Aug 12, 2019

More details on my blog at https://wp.me/poZKh-8m7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.