Files
JC3636W518EN/13-Dash-Mount/dash_mount.scad
T

218 lines
9.1 KiB
OpenSCAD
Raw Normal View History

// Dashboard holder for the JC3636W518 round display (12-OBD-Speed)
//
// Three printed parts + M3x20 bolt + M3 nut + VHB tape:
// cup - snap-in holder for the 58 x 11 mm puck, hinge knuckle at its bottom edge
// base - flat foot (VHB tape) with two hinge ears, captive M3 nut in the right ear
// knob - thumb knob that holds the M3 bolt head
//
// Angle adjustment: the knuckle and both ears carry radial face teeth (detents).
// Loosen the knob ~1 turn -> the ears spring apart and the cup turns freely,
// set the angle, tighten -> the teeth lock (360/teeth degrees per step).
//
// Print in ASA (dashboard heat). Orientation is already correct for every part:
// cup : back on the bed (lip up) base : foot on the bed knob : flat on the bed
//
// Set `part` to "cup", "base" or "knob" and export each STL (F6, then F7).
part = "assembly"; // [assembly, cup, base, knob, print]
tilt = 30; // assembly preview only: lean back from vertical (deg)
/* [Puck] */
puck_d = 58.0; // metal case diameter
puck_h = 11.0; // case thickness
glass_d = 55.0; // cover glass diameter (lip must stay outside it)
/* [Cup] */
fit = 0.3; // diametral clearance puck <-> cup
wall_t = 2.0; // cup side wall
floor_t = 2.0; // cup back
lip = 0.9; // how far the snap lip reaches over the bezel (radial)
lip_t = 1.2; // lip thickness
push_d = 36; // hole in the back to push the puck out (0 = none)
slots = 8; // flex slots in the wall (make the snap easier)
slot_w = 1.2;
usb_angle = 0; // USB-C opening: 0 = right, 180 = left (seen from the front)
usb_w = 13; // opening width (USB-C plug overmold ~12 mm)
/* [Hinge] */
teeth = 36; // detent teeth -> 360/teeth degrees per click
tooth_h = 0.6; // tooth height
tooth_r_in = 5.0; // inner radius of the tooth ring
hinge_r = 9.0; // knuckle / ear disc radius (= outer radius of the teeth)
knuckle_w = 8.0; // knuckle width (between the ears)
ear_t = 4.0; // ear thickness
ear_spread = 0.8; // extra gap per side as printed, so the teeth clear when loose
bolt_d = 3.4; // M3 clearance hole
nut_af = 5.7; // M3 nut across flats + clearance
nut_h = 2.6; // nut pocket depth
/* [Base] */
foot_w = 40; // across the car (x)
foot_l = 46; // front-back (y)
foot_t = 4;
foot_r = 6; // corner radius
/* [Knob] */
knob_d = 20;
knob_floor = 2.5; // plastic between bolt head and ear
head_d = 5.4; // M3 socket head pocket (slightly tight: press in warm, or glue)
head_h = 3.2;
$fn = 96;
eps = 0.01;
// ---------- derived ----------
cup_id = puck_d + fit;
cup_od = cup_id + 2 * wall_t;
cup_h = floor_t + puck_h + 0.2 + lip_t;
hinge_z = cup_h / 2; // knuckle axis height in the cup frame
k_off = hinge_r + 1.5; // cup outer wall -> hinge axis (ears clear the cup)
hinge_y = -(cup_od / 2 + k_off); // knuckle axis position in the cup frame
ear_in = knuckle_w / 2 + tooth_h + ear_spread; // inner face of an ear (as printed)
axis_h = foot_t + hinge_r + 1; // hinge axis above the dashboard
pitch = 360 / teeth;
grip = 2 * ear_t + knuckle_w + 2 * tooth_h; // clamped stack when tight
echo(str("Bolt: M3 x ", ceil(grip + knob_floor), " or a bit longer (M3x20 for defaults)"));
echo(str("Detent step: ", pitch, " deg"));
assert(cup_id - 2 * lip > glass_d, "lip would cover the glass");
// ---------- detent teeth ----------
// One radial tooth in the XY plane, along +x, pointing +z.
module tooth(r0, r1, h) {
a = pitch / 2 * 1.03; // neighbours overlap a little (shared edges are non-manifold)
polyhedron(
points = [[r0 * cos(-a), r0 * sin(-a), -eps], [r0 * cos(a), r0 * sin(a), -eps], [r0, 0, h],
[r1 * cos(-a), r1 * sin(-a), -eps], [r1 * cos(a), r1 * sin(a), -eps], [r1, 0, h]],
faces = [[0, 1, 2], [3, 5, 4], [0, 3, 4, 1], [1, 4, 5, 2], [0, 2, 5, 3]]);
}
// Tooth ring on the plane x = 0 around the x axis, pointing toward +x (dir = 1) or -x
// (dir = -1). `phase` is the angle of tooth 0 in the YZ plane, measured from +y toward +z.
module tooth_ring(dir, phase) {
for (i = [0 : teeth - 1]) {
al = phase + i * pitch;
if (dir > 0) rotate([0, 90, 0]) rotate([0, 0, al + 90]) tooth(tooth_r_in, hinge_r - 0.3, tooth_h);
else rotate([0, -90, 0]) rotate([0, 0, 90 - al]) tooth(tooth_r_in, hinge_r - 0.3, tooth_h);
}
}
// ---------- cup ----------
module knuckle() { // in the cup frame
translate([0, hinge_y, hinge_z]) {
rotate([0, 90, 0]) cylinder(r = hinge_r, h = knuckle_w, center = true);
// phase chosen so the teeth mesh with the ears when `tilt` is a multiple of `pitch`
for (s = [-1, 1]) translate([s * knuckle_w / 2, 0, 0]) tooth_ring(s, pitch / 2 - 90);
}
// bridge from the disc to the cup wall
translate([-knuckle_w / 2, hinge_y, 0]) cube([knuckle_w, -hinge_y - cup_id / 2 + 1, cup_h]);
}
module cup() {
difference() {
union() {
cylinder(d = cup_od, h = cup_h);
intersection() {
knuckle();
translate([-50, -100, 0]) cube([100, 100, cup_h]); // keep it flat on the bed
}
}
// puck pocket
translate([0, 0, floor_t]) cylinder(d = cup_id, h = puck_h + 0.2);
// lip opening with a lead-in chamfer
translate([0, 0, floor_t + puck_h + 0.2 - eps])
cylinder(d1 = cup_id - 2 * lip, d2 = cup_id - 2 * lip + 2 * lip_t * 0.8, h = lip_t + 2 * eps);
// push-out hole
if (push_d > 0) translate([0, 0, -eps]) cylinder(d = push_d, h = floor_t + 2 * eps);
// USB-C opening, full wall height above the floor
rotate([0, 0, usb_angle]) translate([cup_id / 2 - 1, -usb_w / 2, floor_t])
cube([wall_t + 2, usb_w, cup_h]);
// flex slots (skip the ones near the hinge and the USB opening)
for (i = [0 : slots - 1]) {
a = 360 / slots * (i + 0.5);
if (adist(a, 270) > 30 && adist(a, usb_angle) > 25)
rotate([0, 0, a]) translate([cup_id / 2 - 1, -slot_w / 2, floor_t + 2])
cube([wall_t + 2, slot_w, cup_h]);
}
// bolt hole
translate([0, hinge_y, hinge_z]) rotate([0, 90, 0]) cylinder(d = bolt_d, h = 40, center = true, $fn = 32);
}
}
function adist(a, b) = let(d = abs((a - b) % 360)) min(d, 360 - d);
// ---------- base ----------
module rounded_plate(w, l, t, r) {
hull() for (x = [-1, 1], y = [-1, 1])
translate([x * (w / 2 - r), y * (l / 2 - r), 0]) {
cylinder(r = r, h = t - 1);
cylinder(r = r - 1, h = t); // 1 mm top chamfer
}
}
module ear() { // +x ear, inner face at x = ear_in
translate([ear_in, 0, 0]) rotate([90, 0, 90]) linear_extrude(ear_t)
hull() {
translate([0, axis_h]) circle(r = hinge_r);
translate([-hinge_r + 1, 0]) square([2 * hinge_r - 2, foot_t]);
}
translate([ear_in, 0, axis_h]) tooth_ring(-1, 0);
}
module base() {
difference() {
union() {
rounded_plate(foot_w, foot_l, foot_t, foot_r);
ear();
mirror([1, 0, 0]) ear();
}
translate([0, 0, axis_h]) rotate([0, 90, 0]) cylinder(d = bolt_d, h = 60, center = true, $fn = 32);
// captive nut, right ear, from the outside (vertex up: prints without support)
translate([ear_in + ear_t - nut_h, 0, axis_h]) rotate([0, 90, 0])
cylinder(d = nut_af / cos(30), h = nut_h + 1, $fn = 6);
}
}
// ---------- knob ----------
module knob() {
h = knob_floor + head_h + 0.5;
difference() {
cylinder(d = knob_d, h = h);
for (i = [0 : 7]) rotate([0, 0, i * 45]) translate([knob_d / 2 + 1.2, 0, -eps])
cylinder(r = 2.5, h = h + 2 * eps); // grip scallops
translate([0, 0, -eps]) cylinder(d = bolt_d, h = h + 2 * eps, $fn = 32);
translate([0, 0, knob_floor]) cylinder(d = head_d, h = h, $fn = 48);
translate([0, 0, h - 0.6]) cylinder(d1 = knob_d - 6, d2 = knob_d - 4.8, h = 0.6 + eps);
}
}
// ---------- dummy puck (preview only) ----------
module puck() {
color("silver") cylinder(d = puck_d, h = puck_h);
color("black") translate([0, 0, puck_h - 0.1]) cylinder(d = glass_d, h = 0.2);
}
// ---------- layout ----------
module cup_placed(t) {
translate([0, 0, axis_h]) rotate([-t, 0, 0]) rotate([90, 0, 0])
translate([0, -hinge_y, -hinge_z]) children();
}
if (part == "cup") cup();
else if (part == "base") base();
else if (part == "knob") knob();
else if (part == "print") {
cup();
translate([cup_od / 2 + foot_w / 2 + 8, 0, 0]) base();
translate([cup_od / 2 + foot_w + knob_d / 2 + 14, 0, 0]) knob();
}
else {
t = round(tilt / pitch) * pitch; // snap preview to a detent
color("dimgray") base();
cup_placed(t) {
color("orange", 0.9) cup();
translate([0, 0, floor_t + 0.1]) puck();
}
color("orange") translate([-ear_in - ear_t - (knob_floor + head_h + 0.5), 0, axis_h])
rotate([0, 90, 0]) knob();
}