mcopy/scad/jk_lens_assembly.scad

300 lines
10 KiB
OpenSCAD
Raw Normal View History

2022-12-24 06:55:11 +00:00
//
// JK lens assembly
//
include <./common.scad>;
include <./bellows.scad>;
2023-01-06 14:18:03 +00:00
include <./knurledFinishLib_v2.scad>;
2023-01-02 19:30:54 +00:00
2022-12-24 06:55:11 +00:00
PART = "";
LinearBearingOuterDiameter = 15;
LinearBearingHeight = 24;
LinearBearingBoreDiameter = 8;
2022-12-24 22:36:25 +00:00
ThreadDiameter = 8;
2022-12-24 06:55:11 +00:00
LinearMotionDiameter = 8;
TNutDiameter1 = 22;
TNutDiameter2 = 10.2;
TNutInnerDiameter = 8;
TNutHeight1 = 3.5;
TNutHeight2 = 15;
TNutOffset = 1.5;
2022-12-24 22:36:25 +00:00
RodLength = 150;
2022-12-24 06:55:11 +00:00
2023-01-06 15:31:25 +00:00
ZOffset = 120;
2022-12-24 22:36:25 +00:00
XOffset = 38;
XWidth = 50;
FrontOffset = 0;
BackOffset = 10;
2022-12-24 06:55:11 +00:00
LinearMotionX = 22;
LinearMotionY = 20;
LinearMotionZ = 14;
2023-01-06 15:31:25 +00:00
XPosition = 0;
ZPosition = 0;
2023-01-05 22:35:25 +00:00
module linearBearing (padD = 0, padH = 0) {
2022-12-24 06:55:11 +00:00
difference () {
2023-01-05 22:35:25 +00:00
cylinder(r = R(LinearBearingOuterDiameter + padD), h = LinearBearingHeight + padH, center = true, $fn = 100);
cylinder(r = R(LinearBearingBoreDiameter), h = LinearBearingHeight + padH + 1, center = true, $fn = 60);
2022-12-24 06:55:11 +00:00
}
}
2023-01-02 19:30:54 +00:00
module threadedRod (H = 40, pad = 0) {
color("green") cylinder(r = R(ThreadDiameter + pad), h = H, center = true, $fn = 60);
2022-12-24 06:55:11 +00:00
}
2023-01-02 19:30:54 +00:00
module linearMotionRod (H = 40, pad = 0) {
color("blue") cylinder(r = R(LinearMotionDiameter + pad), h = H, center = true, $fn = 60);
2022-12-24 06:55:11 +00:00
}
2023-01-05 22:35:25 +00:00
module TNut (padD = 0, padH = 0) {
2022-12-24 22:36:25 +00:00
color("red") difference () {
2022-12-24 06:55:11 +00:00
union () {
2023-01-05 22:35:25 +00:00
translate([0, 0, -(TNutHeight2 / 2) + (TNutHeight1 / 2) + TNutOffset]) cylinder(r = R(TNutDiameter1 + padD), h = TNutHeight1, center = true, $fn = 100);
cylinder(r = R(TNutDiameter2), h = TNutHeight2 + padH, center = true, $fn = 80);
2022-12-24 06:55:11 +00:00
}
cylinder(r = R(TNutInnerDiameter), h = TNutHeight2 + 1, center = true, $fn = 60);
}
}
module m3Bolt (bolt = 20) {
2023-01-02 19:30:54 +00:00
cylinder(r = 3.1 / 2, h = bolt, center = true, $fn = 40);
}
2023-01-06 15:31:25 +00:00
module m4Bolt (H = 10) {
cylinder(r = R(4.25), h = H, center = true, $fn = 40);
}
module m3BoltNut (bolt = 20, nut = 3.5) {
m3Bolt(bolt);
2023-01-02 19:30:54 +00:00
translate([0, 0, nut]) color("red") {
cylinder(r = 8 / 2, h = 2.5, center = true, $fn = 6);
translate([-4, 0, 0]) cube([8, 6.9, 2.5], center = true);
}
}
2022-12-24 22:36:25 +00:00
module lensAssemblyBellowsBoard () {
//bottom
difference () {
2023-01-02 19:30:54 +00:00
union () {
rotate([0, 0, 90]) bellows_camera_board();
translate([0, -XOffset, FrontOffset]) rotate([0, 90, 0]) cylinder(r = R(22), h = XWidth, center = true, $fn = 80);
}
2022-12-24 22:36:25 +00:00
rotate([-90, 0, 0]) {
2023-01-05 22:35:25 +00:00
translate([-(XWidth/2) + 2.5, -FrontOffset, -XOffset]) rotate([0, 90, 0]) TNut(0.3, 0.3);
//m3s
// -centered
translate([-(XWidth/2) + 2.5 + 5, -FrontOffset - 8, -XOffset]) rotate([0, -90, 0]) rotate([0, 0, 90]) m3BoltNut();
// -top no nut
translate([-(XWidth/2) + 2.5 + 5, -FrontOffset, -XOffset + 8]) rotate([0, -90, 0]) m3Bolt();
// -bottom no nut
translate([-(XWidth/2) + 2.5 + 5, -FrontOffset, -XOffset - 8]) rotate([0, -90, 0]) m3Bolt();
2023-01-05 22:35:25 +00:00
translate([(XWidth/2) - 2.5, -FrontOffset, -XOffset]) rotate([0, -90, 0]) TNut(0.3, 0.3);
//m3s
// -center
2023-01-02 19:30:54 +00:00
translate([(XWidth/2) - 2.5 - 5, -FrontOffset - 8, -XOffset]) rotate([0, 90, 0]) rotate([0, 0, 90]) m3BoltNut();
// -top no nut
translate([(XWidth/2) - 2.5 - 5, -FrontOffset, -XOffset + 8]) rotate([0, 90, 0]) m3Bolt();
// -bottom no nut
translate([(XWidth/2) - 2.5 - 5, -FrontOffset, -XOffset - 8]) rotate([0, 90, 0]) m3Bolt();
2022-12-24 22:36:25 +00:00
}
2023-01-02 19:30:54 +00:00
rotate([-90, 0, 0]) translate([0, -FrontOffset, -XOffset]) rotate([0, 90, 0]) threadedRod(RodLength, 0.5);
translate([0, -XOffset, -10.5]) cube([100,30, 15], center = true);
2022-12-24 22:36:25 +00:00
}
2022-12-24 22:36:25 +00:00
//top
2022-12-24 06:55:11 +00:00
difference () {
2023-01-02 19:30:54 +00:00
translate([0, XOffset, FrontOffset]) rotate([0, 90, 0]) cylinder(r = R(25), h = 24, center = true, $fn = 80);
2022-12-24 06:55:11 +00:00
rotate([-90, 0, 0]) {
2023-01-02 19:30:54 +00:00
translate([0, -FrontOffset, XOffset]) rotate([0, 90, 0]) linearBearing(0.25);
2022-12-24 22:36:25 +00:00
}
2023-01-02 19:30:54 +00:00
translate([0, XOffset, -10.5]) cube([24 + 1,30, 15], center = true);
2022-12-24 22:36:25 +00:00
rotate([-90, 0, 0]) translate([0, -FrontOffset, XOffset]) rotate([0, 90, 0]) linearMotionRod(RodLength);
}
}
module lensAssemblyThreadedZ () {
Z = 90;
difference () {
union () {
//main cylinder
rounded_cube([22, 22, Z], d = 8, $fn = 30, center = true);
//top linear motion rod attachment block
translate([0, -(LinearMotionY/2), (Z/2) - (LinearMotionZ/2)]) cube([LinearMotionX, LinearMotionY, LinearMotionZ], center = true);
//bottom threaded rod block
translate([0, -BackOffset, -XOffset]) rotate([0, 90, 0]) cylinder(r = R(22), h = 22, center = true, $fn = 80);
2022-12-24 06:55:11 +00:00
}
2022-12-24 22:36:25 +00:00
//------
//threaded rod void
threadedRod(Z + 20, 0.5);
2022-12-24 22:36:25 +00:00
//board nut void
translate([0, -10, 0]) rotate([0, 90, 0]) cylinder(r = R(12), h = 30, center = true, $fn = 40);
//board void
translate([8, -BackOffset, 0]) cube([8, 7, 52], center = true);
//T nuts
//top
2023-01-05 22:35:25 +00:00
translate([0, 0, (Z / 2) - 4]) rotate([180, 0, 0]) TNut(0.3, 0.3);
//bottom
2023-01-05 22:35:25 +00:00
translate([0, 0, -(Z / 2) + 4]) TNut(0.3, 0.3);
//----
//T nut M3 bolts
//top
translate([0, 0, (Z / 2) - 4]) {
translate([-8, 0, 0]) rotate([180, 0, 0]) m3BoltNut();
translate([8, 0, 0]) rotate([0, 0, 180]) rotate([180, 0, 0]) m3BoltNut();
translate([0, 8, 0]) rotate([0, 0, -90]) rotate([180, 0, 0]) m3BoltNut();
}
//bottom
translate([0, 0, -(Z / 2) + 4]) {
translate([-8, 0, 0]) m3BoltNut();
translate([8, 0, 0]) rotate([0, 0, 180]) m3BoltNut();
translate([0, 8, 0]) rotate([0, 0, -90]) m3BoltNut();
}
2022-12-24 22:36:25 +00:00
//------
//top linear motion rod voids
//top gap to close
2022-12-24 22:36:25 +00:00
translate([0, -(LinearMotionY/2) - 8, (Z/2) - (LinearMotionZ/2)]) cube([LinearMotionX + 1, LinearMotionY, 2], center = true);
//rod
2022-12-24 22:36:25 +00:00
translate([0, -(LinearMotionY/2), (Z/2) - (LinearMotionZ/2)]) rotate([0, 90, 0]) cylinder(r = R(LinearMotionDiameter)+.2, h = LinearMotionX + 1, center = true, $fn = 60);
//m4 bolt top
2023-01-06 15:31:25 +00:00
translate([0, -(LinearMotionY/2) - 8 + 1, (Z/2) - (LinearMotionZ/2)]) m4Bolt(LinearMotionZ + 1);
//m4 nut top
2022-12-24 22:36:25 +00:00
translate([0, -(LinearMotionY/2) - 8 + 1, (Z/2) - (LinearMotionZ/2) - 6]) m4_nut();
//------
//bottom threaded rod void
translate([0, -BackOffset, -XOffset]) rotate([0, 90, 0]) threadedRod(22 + 1, 0.5);
2022-12-24 22:36:25 +00:00
//flatten bottom
translate([0, -BackOffset, -(Z / 2) - 11]) cube([23, 22, 22], center = true);
2022-12-24 06:55:11 +00:00
}
}
2022-12-24 22:36:25 +00:00
module lensAssemblyLinearZ () {
Z = 90;
ZLinearBearing = 31;
2022-12-24 22:36:25 +00:00
difference () {
union () {
//main cylinder
rounded_cube([22, 22, Z], d = 8, $fn = 30, center = true);
//top
translate([0, -BackOffset, (Z / 2) - (LinearMotionZ/2)]) cube([LinearMotionX, LinearMotionY, LinearMotionZ], center = true);
//bottom
translate([0, -BackOffset, -XOffset]) rotate([0, 90, 0]) cylinder(r = R(22), h = 22, center = true, $fn = 80);
2022-12-24 22:36:25 +00:00
}
//x linear motion rod void
translate([9, -BackOffset, (Z / 2) - (LinearMotionZ/2)]) rotate([0, 90, 0]) linearMotionRod(50, 0.3);
2022-12-24 22:36:25 +00:00
//board void
translate([-8, -BackOffset, -5]) cube([8, 7, 52], center = true);
//z threaded rod
linearMotionRod(250, 0.3);
//top gap to close
translate([0, -(LinearMotionY/2) - 8, (Z/2) - (LinearMotionZ/2)]) cube([LinearMotionX + 1, LinearMotionY, 2], center = true);
//m4 bolt top
2023-01-06 15:31:25 +00:00
translate([0, -(LinearMotionY/2) - 8 + 1, (Z/2) - (LinearMotionZ/2)]) m4Bolt(LinearMotionZ + 1);
//m4 nut top
translate([0, -(LinearMotionY/2) - 8 + 1, (Z/2) - (LinearMotionZ/2) - 6]) m4_nut();
2022-12-24 22:36:25 +00:00
//flatten bottom
translate([0, -BackOffset, -(Z / 2) - 11]) cube([23, 22, 22], center = true);
//z linear bearing
translate([0, 0, -(Z / 2) + ZLinearBearing]) {
2023-01-05 22:35:25 +00:00
linearBearing(0.25, 0.3);
translate([LinearBearingOuterDiameter / 2, 0, 0]) cube([LinearBearingOuterDiameter, LinearBearingOuterDiameter + 0.25, LinearBearingHeight + 0.3], center = true);
}
//z linear bearing
translate([0, 0, -(Z / 2) + ZLinearBearing + 32]) {
2023-01-05 22:35:25 +00:00
linearBearing(0.25, 0.3);
translate([LinearBearingOuterDiameter / 2, 0, 0]) cube([LinearBearingOuterDiameter, LinearBearingOuterDiameter + 0.25, LinearBearingHeight + 0.3], center = true);
}
2022-12-24 22:36:25 +00:00
//x threaded rod
translate([0, -BackOffset, -XOffset]) rotate([0, 90, 0]) threadedRod(50, 0.5);
2022-12-24 22:36:25 +00:00
}
}
2023-01-06 15:31:25 +00:00
module lensAssemblyBaseZ () {
difference () {
rounded_cube([150, 22, 22], d = 8, $fn = 30, center = true);
translate([ZOffset/2, 0, 5]) linearMotionRod(22 + 1, 0.2);
2023-01-07 23:43:59 +00:00
translate([-ZOffset/2, 0, 0]) threadedRod(50, 0.2);
translate([ZOffset/2+10, 0, 0]) rotate([0, 90, 0]) m4Bolt(20);
2023-01-06 15:31:25 +00:00
}
2023-01-07 23:43:59 +00:00
2023-01-06 15:31:25 +00:00
}
2023-01-07 23:43:59 +00:00
module lensAssemblyThreadedCollar (H = 8, pad = 0) {
2023-01-06 14:18:03 +00:00
difference () {
union () {
cylinder(r = R(26), h = H, center = true, $fn = 80);
}
2023-01-07 23:43:59 +00:00
threadedRod(H*2, 0.1 + pad);
2023-01-06 14:18:03 +00:00
translate([8.5, 0, 0]) rotate([0, 90, 0]) m3BoltNut(10, -1);
}
}
module lensAssemblyThreadedKnob () {
H = 8;
D1 = 38.7;
difference () {
union () {
translate([0, 0, -H/2]) knurled_cyl(H, D1, 2, 2, .3, 0, 0);
translate([0, 0, H]) lensAssemblyThreadedCollar(H);
}
translate([0, 0, H]) threadedRod(H*2, 0.1);
}
}
module debug () {
2023-01-06 15:31:25 +00:00
translate([0, 0, ZPosition]) {
translate([-ZOffset/2, BackOffset, 0]) lensAssemblyThreadedZ();
translate([ZOffset/2, BackOffset, 0]) lensAssemblyLinearZ();
2022-12-24 06:55:11 +00:00
2023-01-06 15:31:25 +00:00
translate([ZOffset/2, 10, 18]) color("green") linearBearing();
translate([ZOffset/2, 10, -14]) color("green") linearBearing();
2022-12-24 06:55:11 +00:00
2023-01-06 15:31:25 +00:00
translate([-ZOffset/2, 10, 40]) rotate([180, 0, 0]) TNut();
translate([-ZOffset/2, 10, -40]) TNut();
2022-12-24 06:55:11 +00:00
2023-01-06 15:31:25 +00:00
//X axis
translate([0, -FrontOffset, -XOffset]) rotate([0, 90, 0]) threadedRod(RodLength);
translate([0, -FrontOffset, XOffset]) rotate([0, 90, 0]) linearMotionRod(RodLength);
2022-12-24 06:55:11 +00:00
2023-01-06 15:31:25 +00:00
translate([XPosition, 0, 0]) {
rotate([90, 0, 0]) lensAssemblyBellowsBoard();
translate([0, 0, 40]) rotate([0, 90, 0]) color("green") linearBearing();
translate([-22.5, 0, -XOffset]) rotate([0, 90, 0]) TNut();
translate([22.5, 0, -XOffset]) rotate([0, -90, 0]) TNut();
}
}
//Z axis
translate([-ZOffset/2, BackOffset, 0]) threadedRod(RodLength + 20);
translate([ZOffset/2, BackOffset, 0]) linearMotionRod(RodLength);
translate([0, BackOffset, -70]) lensAssemblyBaseZ();
}
2023-01-02 19:30:54 +00:00
2023-01-07 23:43:59 +00:00
PART = "lens_assembly_base_z";
2023-01-02 19:30:54 +00:00
if (PART == "lens_assembly_bellows_board") {
lensAssemblyBellowsBoard();
} else if (PART == "lens_assembly_threaded_z") {
lensAssemblyThreadedZ();
} else if (PART == "lens_assembly_linear_z") {
lensAssemblyLinearZ();
2023-01-06 15:31:25 +00:00
} else if (PART == "lens_assembly_base_z") {
lensAssemblyBaseZ();
2023-01-06 14:18:03 +00:00
} else if (PART == "lens_assembly_threaded_knob") {
lensAssemblyThreadedKnob();
} else if (PART == "lens_assembly_threaded_collar") {
2023-01-07 23:43:59 +00:00
lensAssemblyThreadedCollar(6, 0.2);
} else {
debug();
2023-01-02 19:30:54 +00:00
}