Merge in 9 months of work on capper branch #71

Merged
mattmcw merged 95 commits from capper into main 2023-02-19 05:28:46 +00:00
2 changed files with 125 additions and 14 deletions
Showing only changes of commit 3419172535 - Show all commits

View File

@ -2,7 +2,7 @@
include <./common.scad>;
BarrelDiameter = 45.1;
BarrelDiameter = 45;
BarrelLength = 52;
SeatDiameter = 20;
@ -26,14 +26,25 @@ DriveLength = 7;
DriveDiameter1 = 11;
DriveDiameter2 = 9;
ShaftLength = 2.75;
ShaftDiameter = 5;
module motorBarrel () {
$fn = 200;
cylinder(r = BarrelDiameter / 2, r2 = (BarrelDiameter - 1) / 2, h = BarrelLength, center = true);
cylinder(r = R(BarrelDiameter), h = BarrelLength, center = true);
}
module motorSeat () {
$fn = 120;
cylinder(r = SeatDiameter / 2, h = SeatLength, center = true);
cylinder(r = R(SeatDiameter), h = SeatLength, center = true);
}
module motorShaft () {
cylinder(r = R(ShaftDiameter), h = ShaftLength, center = true);
}
module motorDrive () {
cylinder(r = R(DriveDiameter1), h = DriveLength, center = true);
}
module motorOriginal () {
@ -43,30 +54,104 @@ module motorOriginal () {
$fn = 50;
translate([BarrelDiameter / 2, 0, -(BarrelLength / 2) + NotchOffset]) {
rotate([0, 90, 0]) {
cylinder(r = NotchDiameter / 2, h = 1, center = true);
translate([0, 0, NotchDiameter / 4]) sphere(r = NotchDiameter / 2);
cylinder(r = R(NotchDiameter), h = 1, center = true);
translate([0, 0, NotchDiameter / 4]) sphere(r = R(NotchDiameter));
}
}
translate([0, 0, (BarrelLength / 2) + (SeatLength) + (ShaftLength / 2)]) motorShaft();
translate([0, 0, (BarrelLength / 2) + (SeatLength) + (ShaftLength) + (DriveLength / 2)]) motorDrive();
}
module capBellowsAdapter () {
module bodyCap () {
$fn = 200;
difference () {
cylinder(r = CapDiameter / 2, h = CapLength, center = true);
cylinder(r = (CapDiameter - CapThickness) / 2, h = CapLength + 1, center = true);
cylinder(r = R(CapDiameter), h = CapLength, center = true);
cylinder(r = R(CapDiameter - CapThickness), h = CapLength + 1, center = true);
//catch
translate([0, 0, (CapLength / 2) - CapCatchOffset]) difference () {
cylinder(r = (CapDiameter + 1) / 2, h = CapCatchLength, center = true);
cylinder(r = CapCatchDiameter / 2, h = CapCatchLength + 1, center = true);
cylinder(r = R(CapDiameter + 1), h = CapCatchLength, center = true);
cylinder(r = R(CapCatchDiameter), h = CapCatchLength + 1, center = true);
}
}
translate([0, 0, (CapLength / 2) + (CapRimThickness / 2)]) {
difference () {
cylinder(r = CapRimDiameter / 2, h = CapRimThickness, center = true);
cube([CapDiameter - CapThickness - 12, CapDiameter - CapThickness - 12, CapRimThickness + 1], center = true);
cylinder(r = R(CapRimDiameter), h = CapRimThickness, center = true);
}
}
}
//motorOriginal();
capBellowsAdapter();
module bodyCapBellowsAdapter () {
$fn = 200;
difference () {
bodyCap();
translate([0, 0, (CapLength / 2) + (CapRimThickness / 2)]) {
cube([CapDiameter - CapThickness - 12, CapDiameter - CapThickness - 12, CapRimThickness + 1], center = true);
}
}
}
module animationMotorBodyPositive () {
difference () {
motorBarrel();
//hollow out
translate([0, 0, 4]) cylinder(r = R(BarrelDiameter) - 5, h = BarrelLength, center = true, $fn = 200);
//cut
translate([0, 0, 20]) cube([100, 100, BarrelLength], center = true);
cylinder(r = R(23), h = BarrelLength + 1, center = true, $fn = 100);
translate([0, (BarrelDiameter / 2) - 2, -10]) cube([8, 8, 16], center = true);
}
//rim
translate([0, 0, -(BarrelLength / 2) - (3 / 2)]) {
difference () {
cylinder(r = R(BarrelDiameter) + 2, h = 3, center = true, $fn = 200);
cylinder(r = R(23), h = 3 + 1, center = true, $fn = 100);
}
}
//motor pad
translate([0, 0, -(BarrelLength / 2) - (3) - (4 / 2)]) {
difference () {
union () {
cube([42, 42, 4], center = true);
cylinder(r = R(BarrelDiameter) + 2, h = 4, center = true, $fn = 200);
}
cylinder(r = R(23), h = 4 + 1, center = true, $fn = 100);
for (i = [0 : 3]) {
rotate([0, 0, (i * 90) + 45]) translate([29.7, 0, 0]) cube([5.5, 5.5, 4 + 1], center = true);
}
}
}
//notch
$fn = 50;
rotate([0, 0, 35]) {
translate([BarrelDiameter / 2, 0, -(BarrelLength / 2) + NotchOffset]) {
rotate([0, 90, 0]) {
cylinder(r = R(NotchDiameter), h = 1, center = true);
translate([0, 0, NotchDiameter / 4]) sphere(r = R(NotchDiameter));
}
}
}
}
module boltSlot () {
cylinder(r = R(6), h = 40, center = true, $fn = 40);
cylinder(r = R(3.25), h = 50, center = true, $fn = 40);
}
module animationMotorBody () {
boltZOffset = -6;
difference () {
animationMotorBodyPositive();
translate([31/2, 31/2, boltZOffset]) boltSlot();
translate([31/2, -31/2, boltZOffset]) boltSlot();
translate([-31/2, 31/2, boltZOffset]) boltSlot();
translate([-31/2, -31/2, -6]) boltSlot();
}
}
//translate([0, 50, 0]) color("red") motorOriginal();
//bodyCapBellowsAdapter();
//animationMotorBody();
//translate([0, 0, -49.5]) color("green") NEMA17();
//bodyCap();

View File

@ -76,3 +76,29 @@ module optoswitch() {
module hex (diag = 10, h = 1) {
cylinder(r = diag / 2, h = h, center = true, $fn = 6);
}
//NEMA17 Stepper
module NEMA17 ( H = 33 ) { //alt = 47.5
difference () {
cube([42, 42, H], center = true);
for (i = [0 : 3]) {
rotate([0, 0, (i * 90) + 45]) translate([29.7, 0, 0]) cube([5.5, 5.5, H + 1], center = true);
}
translate([31/2, 31/2, (H/2)-1.9]) cylinder(r = R(3), h = 4, center = true, $fn=30);
translate([-31/2, 31/2, (H/2)-1.9]) cylinder(r = R(3), h = 4, center = true, $fn=30);
translate([31/2, -31/2, (H/2)-1.9]) cylinder(r = R(3), h = 4, center = true, $fn=30);
translate([-31/2, -31/2, (H/2)-1.9]) cylinder(r = R(3), h = 4, center = true, $fn=30);
}
//pad
translate([0, 0, (H/2) + (1.9/2)]) {
cylinder(r = R(22), h = 1.9, center = true, $fn = 100);
}
//shaft
translate([0, 0, (H/2) + (22.75/2)]) {
difference () {
cylinder(r = R(5), h = 22.75, center = true, $fn = 30);
translate([0, 4.5, 4.7]) cube([5, 5, 22.75], center = true);
}
}
}