Przeglądaj źródła

Add button plunger development file (hat.scad)

ZiB 4 miesięcy temu
rodzic
commit
ebeb56dc32
2 zmienionych plików z 95 dodań i 0 usunięć
  1. 18 0
      hat.json
  2. 77 0
      hat.scad

+ 18 - 0
hat.json

@@ -0,0 +1,18 @@
+{
+    "fileFormatVersion": "1",
+    "parameterSets": {
+        "New set 1": {
+            "BTN_CX": "[48.4, 39.1, 29.8, 20.4]",
+            "BTN_CZ": "3.5",
+            "BTN_D": "2.5",
+            "CLR_YP": "1.6000000000000001",
+            "FLANGE_T": "1.2",
+            "HEAD_H": "1.5",
+            "PCB_W": "41.219999999999999",
+            "STEM_CLEAR": "0.29999999999999999",
+            "WALL": "2",
+            "WALL_H": "16",
+            "WALL_W": "20"
+        }
+    }
+}

+ 77 - 0
hat.scad

@@ -0,0 +1,77 @@
+// ============================================================
+//  Button Extension Hat — development scratch file
+//  Mirrors the +Y wall button-hole geometry from cpu_case.scad
+// ============================================================
+use <ee04.scad>
+
+// Parameters copied from cpu_case.scad
+WALL    = 2.0;   // wall thickness (depth of hole)
+BTN_CX  = [48.4, 39.1, 29.8, 20.4];   // PCB-relative button X centres
+BTN_CZ  = 3.85;  // button centre height above PCB bottom (calibrated)
+PCB_W   = 41.22; // board width (Y axis)
+
+// Wall section dimensions (just enough context around one hole)
+WALL_W = 20;
+WALL_H = 16;
+
+HOLE_CX = WALL_W / 2;
+HOLE_CZ = WALL_H / 2;
+
+/* [Physical button] */
+BTN_ACTUATOR_D = 2.0;   // measured button actuator diameter (<2 mm on EE04)
+
+/* [Slip fit — SLA resin] */
+SLIP_CLEAR = 0.15;   // radial clearance per side; SLA tolerances are tight so 0.15 gives easy slip without slop
+
+/* [Plunger] */
+PLUNGER_D = BTN_ACTUATOR_D;             // body and head diameter — matches button actuator
+HOLE_D    = PLUNGER_D + 2 * SLIP_CLEAR; // wall cutout — slip fit around plunger body
+FLANGE_D  = 2.9;                         // retention flange OD — keep current value
+FLANGE_T  = 1.2;                         // flange thickness (axial)
+HEAD_H    = 1.5;                         // how far head protrudes past exterior wall face
+
+/* [Rest clearance] */
+CLR_YP_CONTACT = 1.565;  // calibrated: plunger tip just touches button at this value
+REST_CLEAR     = 0.40;   // axial gap added so a slightly thick print doesn't pre-press button at rest
+CLR_YP         = CLR_YP_CONTACT + REST_CLEAR;
+
+// Plunger — origin at hole centre on the interior wall face (y=0).
+// At rest: flange front face flush with interior wall face; button spring holds it there.
+module plunger() {
+  color("orange") union() {
+    // Body: runs from flange back face through wall to back of head
+    translate([0, -FLANGE_T, 0])
+      rotate([-90, 0, 0])
+        cylinder(d = PLUNGER_D, h = FLANGE_T + WALL + HEAD_H, $fn = 32);
+
+    // Inner flange: sits inside the case, stops plunger escaping outward
+    translate([0, -FLANGE_T, 0])
+      rotate([-90, 0, 0])
+        cylinder(d = FLANGE_D, h = FLANGE_T, $fn = 32);
+
+    // Outer head: finger-press cap proud of exterior wall face
+    translate([0, WALL, 0])
+      rotate([-90, 0, 0])
+        cylinder(d = PLUNGER_D, h = HEAD_H, $fn = 32);
+  }
+}
+
+// Wall section: positive Y face is the exterior (matching cpu_case +Y exterior)
+difference() {
+  cube([WALL_W, WALL, WALL_H]);
+
+  translate([HOLE_CX, WALL + 0.1, HOLE_CZ])
+    rotate([90, 0, 0])
+      cylinder(d = HOLE_D, h = WALL + 0.2, $fn = 32);
+}
+
+// Plunger at rest — flange flush with interior wall face
+translate([HOLE_CX, 0, HOLE_CZ]) plunger();
+
+// EE04 board — aligned so BTN_CX[0] lines up with HOLE_CX and
+// BTN_CZ lines up with HOLE_CZ; PCB +Y edge sits CLR_YP behind interior wall face.
+translate([
+  HOLE_CX - BTN_CX[0],
+  -(PCB_W + CLR_YP),
+  HOLE_CZ - BTN_CZ
+]) EE04();