2022-06-07 11:55:47 +00:00
|
|
|
include <common.scad>;
|
|
|
|
|
|
|
|
// Using a Tower Pro SG-5010 servo
|
|
|
|
|
|
|
|
// https://www.thingiverse.com/thing:83806 - Lego mount (has dimensions of servo body)
|
|
|
|
// https://www.thingiverse.com/thing:5241574 - Robot arm (just cool)
|
|
|
|
|
2022-06-14 02:46:23 +00:00
|
|
|
currentAngle=0;
|
2022-06-13 02:26:03 +00:00
|
|
|
|
2022-06-07 11:55:47 +00:00
|
|
|
LensVoidDiameter = 40; //mm
|
|
|
|
LensZ = 80;
|
2022-06-13 02:26:03 +00:00
|
|
|
LensY = 30;
|
2022-06-07 11:55:47 +00:00
|
|
|
|
|
|
|
CapOffsetX = -50;
|
|
|
|
CapOffsetY = -11;
|
2022-06-12 17:14:43 +00:00
|
|
|
CapLengthX = 50;
|
|
|
|
CapWidthZ = 4;
|
2022-06-07 11:55:47 +00:00
|
|
|
|
2022-06-12 17:14:43 +00:00
|
|
|
BoltSpacingX = 10;
|
2022-06-11 20:03:08 +00:00
|
|
|
BoltSpacingY = 49;
|
2022-06-13 02:26:03 +00:00
|
|
|
BoltD = 3.5;
|
|
|
|
|
|
|
|
RailSlotsX = 20;
|
|
|
|
RailSlotsD = 6;
|
|
|
|
|
|
|
|
MountBoltSpacingY=40;
|
|
|
|
|
2022-06-18 03:39:19 +00:00
|
|
|
OptoEndstopAdjustZ=2-9;
|
2022-06-16 04:29:31 +00:00
|
|
|
|
|
|
|
module OptoEndstop () {
|
|
|
|
$fn=30;
|
|
|
|
Y=5;
|
|
|
|
Z2=3.64-1.75;
|
|
|
|
difference () {
|
|
|
|
union() {
|
|
|
|
cube([11.15, 28.25, 1.75], center=true);
|
|
|
|
translate([0,14,0]) cylinder(r=R(6), h=1.75, center=true);
|
|
|
|
translate([0,-14,0]) cylinder(r=R(6), h=1.75, center=true);
|
|
|
|
}
|
|
|
|
translate([0,14,0]) cylinder(r=R(2.85), h=1.75+1, center=true);
|
|
|
|
translate([0,-14,0]) cylinder(r=R(2.85), h=1.75+1, center=true);
|
|
|
|
}
|
|
|
|
translate([-R(6.1)+1.2, R(28.25)-R(Y+4.15+4.15)-3.65, 0]) {
|
|
|
|
translate([0,R(Y)+R(4.15),-R(1.75)-R(10.15)]) cube([6.1, 4.15, 10.15], center=true);
|
|
|
|
translate([0,-R(Y)-R(4.15),-R(1.75)-R(10.15)]) cube([6.1, 4.15, 10.15], center=true);
|
|
|
|
}
|
2022-06-18 03:39:19 +00:00
|
|
|
translate([3,4, -R(1.75)-R(.75)]) cube([3.6, 15.7, .75], center=true);
|
2022-06-16 04:29:31 +00:00
|
|
|
}
|
2022-06-13 02:26:03 +00:00
|
|
|
|
|
|
|
module BoltVoid () {
|
|
|
|
cylinder(r=R(BoltD), h=20, center=true);
|
|
|
|
translate([0, 0, 4]) m3_nut(5);
|
|
|
|
}
|
2022-06-11 20:03:08 +00:00
|
|
|
|
2022-06-07 11:55:47 +00:00
|
|
|
module Mount () {
|
|
|
|
$fn = 200;
|
|
|
|
difference(){
|
|
|
|
union(){
|
2022-06-22 11:45:01 +00:00
|
|
|
//outer cylinder
|
2022-06-13 02:26:03 +00:00
|
|
|
translate([0, 0, 5]) difference(){
|
2022-06-07 11:55:47 +00:00
|
|
|
cylinder(r=R(LensVoidDiameter)+15, h=LensY, center=true);
|
|
|
|
cylinder(r=R(LensVoidDiameter)+5, h=LensY+1, center=true);
|
2022-06-22 11:45:01 +00:00
|
|
|
translate([0, 0, 10.01]) cylinder(r1=R(LensVoidDiameter), r2=R(LensVoidDiameter)+10, h=10, center=true);
|
2022-06-07 11:55:47 +00:00
|
|
|
}
|
2022-06-22 11:45:01 +00:00
|
|
|
|
2022-06-07 11:55:47 +00:00
|
|
|
translate([0,0,-(LensY/4)-(5/4)]) difference(){
|
2022-06-13 02:26:03 +00:00
|
|
|
cylinder(r=R(LensVoidDiameter)+5, h=R(LensY)-R(5)-10, center=true);
|
2022-06-07 11:55:47 +00:00
|
|
|
cylinder(r=R(LensVoidDiameter), h=LensY+1, center=true);
|
|
|
|
}
|
2022-06-22 11:45:01 +00:00
|
|
|
|
2022-06-11 20:03:08 +00:00
|
|
|
difference () {
|
2022-06-13 02:26:03 +00:00
|
|
|
union() {
|
|
|
|
translate([50, 0, -6]) cube([100, LensVoidDiameter + 30, 8], center=true);
|
|
|
|
translate([0, 0, -6]) cylinder(r=R(LensVoidDiameter)+12, h=8, center=true);
|
|
|
|
}
|
2022-06-11 20:03:08 +00:00
|
|
|
cylinder(r=R(LensVoidDiameter), h=LensY+1, center=true);
|
2022-06-13 02:26:03 +00:00
|
|
|
//servo
|
2022-06-11 20:03:08 +00:00
|
|
|
translate([50, 0, -6]) {
|
|
|
|
cube([20, 40.25, 10], center = true);
|
2022-06-13 02:26:03 +00:00
|
|
|
translate([BoltSpacingX/2, BoltSpacingY/2, 0]) BoltVoid();
|
|
|
|
translate([-BoltSpacingX/2, BoltSpacingY/2, 0]) BoltVoid();
|
|
|
|
translate([BoltSpacingX/2, -BoltSpacingY/2, 0]) BoltVoid();
|
|
|
|
translate([-BoltSpacingX/2, -BoltSpacingY/2, 0]) BoltVoid();
|
2022-06-11 20:03:08 +00:00
|
|
|
}
|
2022-06-13 02:26:03 +00:00
|
|
|
translate([50, 0, -6-3.01]) cube([2, 56, 2], center=true);
|
2022-06-11 20:03:08 +00:00
|
|
|
}
|
2022-06-07 11:55:47 +00:00
|
|
|
}
|
2022-06-14 02:46:23 +00:00
|
|
|
translate([0,R(LensVoidDiameter),1+4.5]) cube([LensVoidDiameter*2, LensVoidDiameter, 7], center=true);
|
2022-06-13 02:26:03 +00:00
|
|
|
//
|
|
|
|
translate([80, R(MountBoltSpacingY), 0]) RailSlots();
|
|
|
|
translate([80, -R(MountBoltSpacingY), 0]) RailSlots();
|
2022-06-22 11:45:01 +00:00
|
|
|
|
|
|
|
translate([0, 0, -4]) cylinder(r2=R(LensVoidDiameter)-5, r1=R(LensVoidDiameter)+5, h=LensY/2, center=true);
|
2022-06-13 02:26:03 +00:00
|
|
|
//endstop
|
2022-06-22 11:45:01 +00:00
|
|
|
/*translate([0, -34, 25-2-2-10]) {
|
2022-06-18 03:39:19 +00:00
|
|
|
difference () {
|
|
|
|
cube([14, 20, 50], center=true);
|
|
|
|
translate([0, R(LensVoidDiameter)+10+4.01, 0]) cylinder(r=R(LensVoidDiameter)+5, h=LensY + 29, center=true, $fn=200);
|
|
|
|
}
|
|
|
|
translate([0, 11, -14+9]) cylinder(r=R(22), h=4, center=true);
|
2022-06-22 11:45:01 +00:00
|
|
|
}*/
|
2022-06-07 11:55:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module Cap () {
|
|
|
|
$fn = 200;
|
|
|
|
difference(){
|
|
|
|
union(){
|
|
|
|
translate([CapOffsetX,CapOffsetY,0]){
|
|
|
|
cylinder(r=R(LensVoidDiameter) + 4, h=4, center = true);
|
2022-06-12 17:14:43 +00:00
|
|
|
translate([35,(LensVoidDiameter/4)+1,0]) {
|
|
|
|
difference () {
|
|
|
|
cube([CapLengthX,R(LensVoidDiameter),CapWidthZ], center=true);
|
|
|
|
translate([R(CapLengthX)-(R(LensVoidDiameter)/2), 0, 0]) difference() {
|
|
|
|
cube([R(LensVoidDiameter),R(LensVoidDiameter), CapWidthZ+1], center=true);
|
|
|
|
cylinder(r=R(LensVoidDiameter)/2, h=CapWidthZ+1+1, center=true);
|
|
|
|
translate([-R(LensVoidDiameter)/2, 0, 0]) cube([R(LensVoidDiameter),R(LensVoidDiameter), CapWidthZ+1], center=true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-06-07 11:55:47 +00:00
|
|
|
}
|
2022-06-12 17:14:43 +00:00
|
|
|
translate([0, 0, -4]) cylinder(r=5,h=4,center=true);
|
2022-06-07 11:55:47 +00:00
|
|
|
}
|
2022-06-13 02:26:03 +00:00
|
|
|
translate([0, 0, -4]) cylinder(r1=R(5.85), r2=R(5.5), h=4.01,center=true, $fn=20);
|
|
|
|
cylinder(r=R(2.5), h=10,center=true);
|
2022-06-28 12:34:29 +00:00
|
|
|
translate([0, 0, 2.5]) cylinder(r=R(6.5), h=5,center=true);
|
2022-06-13 02:26:03 +00:00
|
|
|
}
|
2022-06-22 11:45:01 +00:00
|
|
|
|
|
|
|
//removed, unneeded
|
|
|
|
//translate([CapOffsetX,CapOffsetY - R(LensVoidDiameter) - 4, 1.25]) cylinder(r=R(15), h=1.5, center=true);
|
2022-06-13 02:26:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module MountFront () {
|
|
|
|
$fn=60;
|
|
|
|
difference () {
|
|
|
|
Mount();
|
|
|
|
translate([0, -50, 50-2]) cube([100, 100, 100], center=true);
|
|
|
|
translate([0, 0, 50-2+7]) cube([100, 100, 100], center=true);
|
|
|
|
translate([0,-30,-2]) cylinder(r=R(4), h=3, center=true);
|
|
|
|
rotate([0,0,40]) translate([0,-30,-2]) cylinder(r=R(4), h=3, center=true);
|
|
|
|
rotate([0,0,-40])translate([0,-30,-2]) cylinder(r=R(4), h=3, center=true);
|
|
|
|
rotate([0,0,80]) translate([0,-30,-2]) cylinder(r=R(4), h=3, center=true);
|
|
|
|
rotate([0,0,-80])translate([0,-30,-2]) cylinder(r=R(4), h=3, center=true);
|
|
|
|
translate([90, 0, -11]) rotate([45,0,0]) cube([70, 4.3, 4.3], center=true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module MountBack () {
|
|
|
|
$fn=60;
|
|
|
|
difference () {
|
|
|
|
Mount();
|
|
|
|
translate([0, 0, -50-1.999]) cube([400, 100, 100], center=true);
|
|
|
|
translate([0, 50, -50+2+7]) cube([100, 100, 100], center=true);
|
2022-06-07 11:55:47 +00:00
|
|
|
}
|
2022-06-13 02:26:03 +00:00
|
|
|
//translate([0,-30,-2]) cylinder(r=R(3.9), h=3, center=true);
|
|
|
|
rotate([0,0,40]) translate([0,-30,-2]) cylinder(r=R(3.9), h=3, center=true);
|
|
|
|
rotate([0,0,-40])translate([0,-30,-2]) cylinder(r=R(3.9), h=3, center=true);
|
|
|
|
rotate([0,0,80]) translate([0,-30,-2]) cylinder(r=R(3.9), h=3, center=true);
|
|
|
|
rotate([0,0,-80])translate([0,-30,-2]) cylinder(r=R(3.9), h=3, center=true);
|
2022-06-07 11:55:47 +00:00
|
|
|
}
|
2022-06-13 02:26:03 +00:00
|
|
|
|
|
|
|
module RailSlots () {
|
|
|
|
translate([R(RailSlotsX), 0, 0]) cylinder(r=R(RailSlotsD), h=40, center=true);
|
|
|
|
translate([-R(RailSlotsX), 0, 0]) cylinder(r=R(RailSlotsD), h=40, center=true);
|
|
|
|
cube([RailSlotsX, RailSlotsD, 40], center=true);
|
|
|
|
}
|
|
|
|
|
|
|
|
module RailMount () {
|
|
|
|
//
|
|
|
|
X=110;
|
|
|
|
RailD=15;
|
|
|
|
RailSpacingY=80;
|
|
|
|
$fn=60;
|
|
|
|
difference () {
|
|
|
|
translate([X, 0, -14]) difference () {
|
|
|
|
cube([100, LensVoidDiameter + 30.6, 8], center=true);
|
|
|
|
//
|
|
|
|
translate([-40, R(MountBoltSpacingY), 0]) cylinder(r=R(6),h=40,center=true);
|
|
|
|
translate([-40, -R(MountBoltSpacingY), 0]) cylinder(r=R(6),h=40,center=true);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
translate([X, 0, -11]) rotate([45,0,0]) cube([100, 4, 4], center=true);
|
|
|
|
translate([X + R(100), 0, -14]) cube([8, LensVoidDiameter + 30.6, 28], center=true);
|
|
|
|
translate([X + R(100) + 5 ,R(RailSpacingY),-14]) difference() {
|
|
|
|
translate([-2.5, -2.5, 0]) cylinder(r=R(RailD + 5), h=28, center=true);
|
|
|
|
cylinder(r=R(RailD), h=28+1, center=true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module OptoEndstopMount () {
|
2022-06-16 04:29:31 +00:00
|
|
|
|
2022-06-18 03:39:19 +00:00
|
|
|
translate([-5,9.5,20]) {
|
|
|
|
difference() {
|
|
|
|
translate([0, 0, 1-7.25]) cube([14-0.3-0.3, 14, 32+4], center=true);
|
|
|
|
//lens void
|
|
|
|
translate([0, R(LensVoidDiameter)+5+4, 0]) cylinder(r=R(LensVoidDiameter)+5, h=LensY + 29, center=true, $fn=200);
|
|
|
|
//connector void
|
|
|
|
translate([0,-8.3, -14.5]) cube([9, 8, 5], center=true);
|
|
|
|
//bolts
|
|
|
|
translate([2,-5,-13.25+OptoEndstopAdjustZ]) rotate([90, 0, 0]) cylinder(r=R(2.9),h=20,center=true, $fn=40);
|
|
|
|
translate([2,-5,15+OptoEndstopAdjustZ]) rotate([90, 0, 0]) cylinder(r=R(2.9),h=20,center=true, $fn=40);
|
|
|
|
//main void
|
2022-06-20 17:00:40 +00:00
|
|
|
translate([-0.5,1,-3]) cube([8,20,15],center=true);
|
2022-06-18 03:39:19 +00:00
|
|
|
//pathway void
|
2022-06-20 17:00:40 +00:00
|
|
|
translate([0,6,-2]) cylinder(r=R(22), h=6, center=true);
|
2022-06-18 03:39:19 +00:00
|
|
|
//smd voids
|
2022-06-20 17:00:40 +00:00
|
|
|
translate([5, -6.5, -3]) cube([3.6, 1, 18], center=true);
|
2022-06-13 02:26:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-12 17:14:43 +00:00
|
|
|
module Debug () {
|
|
|
|
Mount();
|
2022-06-22 11:45:01 +00:00
|
|
|
translate([-CapOffsetX,-CapOffsetY,5.71]) rotate([0,0,currentAngle]) Cap();
|
2022-06-13 02:26:03 +00:00
|
|
|
//color("green") RailMount();
|
2022-06-16 04:29:31 +00:00
|
|
|
//translate([5, -38, -11.8+OptoEndstopAdjustZ]) rotate([0, -90, 0]) opto_endstop();
|
2022-06-22 11:45:01 +00:00
|
|
|
//color("green") translate([5, -38, -11.8]) OptoEndstopMount();
|
|
|
|
//translate([1.5, -38 + 2 -10, -11.8 + 11 + 2 +.75]) rotate([90, 0, 0])OptoEndstop();
|
2022-06-12 17:14:43 +00:00
|
|
|
}
|
|
|
|
|
2022-06-28 12:34:29 +00:00
|
|
|
Render="Cap";
|
2022-06-07 11:55:47 +00:00
|
|
|
|
2022-06-12 17:14:43 +00:00
|
|
|
if (Render=="Debug") {
|
|
|
|
Debug();
|
|
|
|
} else if (Render=="Cap") {
|
|
|
|
Cap();
|
2022-06-13 02:26:03 +00:00
|
|
|
} else if (Render=="MountFront") {
|
|
|
|
MountFront();
|
|
|
|
} else if (Render=="MountBack") {
|
2022-06-28 12:34:29 +00:00
|
|
|
rotate([180, 0, 0]) MountBack();
|
2022-06-13 02:26:03 +00:00
|
|
|
} else if (Render=="RailMount") {
|
|
|
|
RailMount();
|
|
|
|
} else if (Render=="OptoEndstopMount") {
|
2022-06-22 11:45:01 +00:00
|
|
|
echo("Deprecated");
|
|
|
|
//rotate([-90,0,0]) OptoEndstopMount();
|
2022-06-12 17:14:43 +00:00
|
|
|
}
|