Skip to content

Commit cb8181d

Browse files
committed
Rename hardware related variables and clean up their usage
1 parent 2d719c9 commit cb8181d

9 files changed

Lines changed: 63 additions & 64 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,13 @@ rider and would like to use a top rider mount. The opposite is not available.
294294
### Dimensions
295295

296296
* General
297-
* `ScrewHole_diameter_M3`: A hole for an M3 bolt has this diameter. Usually,
298-
the bolt is not meant to grab this hole, but slide into and out of it. For
299-
(almost) each bolt, there is a corresponding threaded metal part (nut or
300-
insert), so increase this value if your bolts are hard to get where they
301-
need to go. Print `Calibration/ScrewHoles` to find a good value for your
302-
printer.
303-
* `HexNutHole_diameter`: The outer circle around a hex nut's hexagon has this
297+
* `m3_screw_diameter_loose`: A hole for an M3 bolt has this diameter. The
298+
bolt is not meant to grab this hole, but slide into and out of it ("loose"
299+
fit). For (almost) each bolt, there is a corresponding threaded metal part
300+
(nut or insert), so increase this value if your bolts are hard to get where
301+
they need to go. Print `Calibration/ScrewHoles` to find a good value for
302+
your printer.
303+
* `m3_hex_nut_diameter`: The outer circle around a hex nut's hexagon has this
304304
diameter. This is **not** the same as the "wrench size" from [DIN
305305
934](https://www.fasteners.eu/standards/DIN/934/) (dimension `S`), but its
306306
nominal value is `2 / sqrt(3) * S`. For M3, this equals `6.35mm` nominally.

lib/utils.scad

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,15 @@ module roundedCube(dimen, radii, center=false) {
3939
}
4040

4141
module HeatsetInsertHole(bottom=false) {
42-
translate([0, 0, bottom ? 0 : -HeatsetInsert_height]) {
43-
42+
translate([0, 0, bottom ? 0 : -m3_insert_hole_depth]) {
4443
rotate_extrude()
4544
polygon([
4645
[0, 0],
47-
[0, HeatsetInsert_height],
48-
[HeatsetInsert_diameter/2, HeatsetInsert_height],
49-
[HeatsetInsert_diameter/2, HeatsetInsert_height-HeatsetInsert_full_depth],
50-
[HeatsetInsert_diameter/2+HeatsetInsert_extra_radius, HeatsetInsert_height-HeatsetInsert_full_depth-HeatsetInsert_extra_radius],
51-
[HeatsetInsert_diameter/2+HeatsetInsert_extra_radius, 0],
46+
[0, m3_insert_hole_depth],
47+
[m3_insert_hole_diameter/2, m3_insert_hole_depth],
48+
[m3_insert_hole_diameter/2, m3_insert_cavity_depth+(m3_insert_cavity_diameter-m3_insert_hole_diameter)/2],
49+
[m3_insert_cavity_diameter/2, m3_insert_cavity_depth],
50+
[m3_insert_cavity_diameter/2, 0],
5251
]);
5352
}
5453
}
@@ -97,7 +96,7 @@ module MountRail(clearance=MountRail_clearance) {
9796

9897
module ScrewHole(
9998
depth, // total depth, including head
100-
diameter=ScrewHole_diameter_M3,
99+
diameter,
101100
head_depth=0,
102101
head_diameter=0,
103102
elongation=0,
@@ -126,9 +125,9 @@ module ScrewHole(
126125
module ScrewHoleM3(depth, head_depth=0, elongation=0) {
127126
ScrewHole(
128127
depth,
129-
diameter=ScrewHole_diameter_M3,
128+
diameter=m3_screw_diameter_loose,
130129
head_depth=head_depth,
131-
head_diameter=ScrewHole_diameter_M3*2,
130+
head_diameter=m3_screw_head_diameter,
132131
elongation=elongation
133132
);
134133
}

src/DisplayCase/DisplayCableStrainRelief.scad

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module DisplayCableStrainRelief() {
3131
for(i=[-1,1])
3232
translate([0, i*4.4, 10])
3333
rotate([0, 90, 0])
34-
cylinder(r=3.2, h=3);
34+
cylinder(d=m3_screw_head_diameter, h=3);
3535
}
3636

3737
// for the cable
@@ -46,11 +46,11 @@ module DisplayCableStrainRelief() {
4646
translate([3, 4.4, 10])
4747
rotate([0, 90, 0])
4848
rotate([0, 0, 360/6/2])
49-
cylinder(r=3.2, h=200, $fn=6);
49+
cylinder(d=m3_hex_nut_diameter, h=200, $fn=6);
5050

5151
translate([3, -4.4, 10])
5252
rotate([0, 90, 0])
53-
cylinder(r=3.2, h=200);
53+
cylinder(d=m3_screw_head_diameter, h=200);
5454

5555
for(i=[-1,1])
5656
translate([0, i*4.4, 10])

src/DisplayCase/DisplayCaseBottom.scad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module DisplayCaseBottom() {
4444
scale([14/12, 1, 1]) // scale to a side ratio of 14:12
4545
cylinder(d=12, h=100);
4646

47-
left = DisplayCase_outer_width-DisplayCase_outer_large_radius-(DisplayCase_outer_radius+2+HeatsetInsert_diameter/2+1);
47+
left = DisplayCase_outer_width-DisplayCase_outer_large_radius-(DisplayCase_outer_radius+2+m3_insert_hole_diameter/2+1);
4848
right = DisplayCase_outer_width/2+DisplayCaseTop_pcb_width/2-default_clearance-DisplayCaseBottom_standoff_size-(DisplayCase_outer_width-DisplayCase_outer_large_radius);
4949
translate([-left, 0, 4])
5050
cube([left+right, 5+21/2, 30]);

src/MainCase/MainCase.scad

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module DebugPCB() {
2020
translate([wall_thickness, wall_thickness, wall_thickness])
2121

2222
// move up by the height of the screw inserts
23-
translate([0, 0, HeatsetInsert_height])
23+
translate([0, 0, m3_insert_hole_depth])
2424

2525
// move by the offset
2626
translate([PCB_offset.x, PCB_offset.y, 0])
@@ -32,12 +32,12 @@ module DebugPCB() {
3232

3333
module HeatsetInsertStandoff(extend=0) {
3434
HeatsetInsertStandoff_profile_points = [
35-
[0, HeatsetInsert_height*0/3],
36-
[0, HeatsetInsert_height*3/3],
37-
[HeatsetInsert_diameter, HeatsetInsert_height*3/3],
38-
[HeatsetInsert_diameter, HeatsetInsert_height*2/3],
39-
[HeatsetInsert_diameter + HeatsetInsert_height/3, HeatsetInsert_height*1/3],
40-
[HeatsetInsert_diameter + HeatsetInsert_height/3, HeatsetInsert_height*0/3],
35+
[0, m3_insert_hole_depth*0/3],
36+
[0, m3_insert_hole_depth*3/3],
37+
[m3_insert_hole_diameter, m3_insert_hole_depth*3/3],
38+
[m3_insert_hole_diameter, m3_insert_hole_depth*2/3],
39+
[m3_insert_hole_diameter + m3_insert_hole_depth/3, m3_insert_hole_depth*1/3],
40+
[m3_insert_hole_diameter + m3_insert_hole_depth/3, m3_insert_hole_depth*0/3],
4141
];
4242

4343
render()
@@ -116,7 +116,7 @@ module GpsAntennaLid() {
116116
}
117117

118118
translate([0, GpsAntennaHousing_top_height / 2 - GpsAntennaHousing_screw_offset, GpsAntennaHousing_depth - GpsAntennaLid_thickness])
119-
cylinder(d=ScrewHole_diameter_M3, h=10, $fn=32);
119+
cylinder(d=m3_screw_diameter_loose, h=10, $fn=32);
120120
}
121121
}
122122

@@ -235,11 +235,11 @@ module MainCase(without_inserts=false, top_rider=MainCase_top_rider, back_rider=
235235
rotate([90,0,0])
236236
linear_extrude(OBS_width)
237237
polygon(polyRound([
238-
[wall_thickness, wall_thickness+HeatsetInsert_height, 0],
239-
[OBS_height-wall_thickness, wall_thickness+HeatsetInsert_height, 0],
240-
[OBS_height-wall_thickness, OBS_depth-2*HeatsetInsert_height, 0],
238+
[wall_thickness, wall_thickness+m3_insert_hole_depth, 0],
239+
[OBS_height-wall_thickness, wall_thickness+m3_insert_hole_depth, 0],
240+
[OBS_height-wall_thickness, OBS_depth-2*m3_insert_hole_depth, 0],
241241
[OBS_height/2, OBS_depth-20+OBS_height/2, 0],
242-
[wall_thickness, OBS_depth-2*HeatsetInsert_height, 0],
242+
[wall_thickness, OBS_depth-2*m3_insert_hole_depth, 0],
243243
], fn=$pfn));
244244

245245
translate([0, 78, 0])
@@ -273,7 +273,7 @@ module MainCase(without_inserts=false, top_rider=MainCase_top_rider, back_rider=
273273

274274
// a little standoff for the PCB
275275
translate([wall_thickness, PCB_offset.y + wall_thickness, wall_thickness])
276-
linear_extrude(HeatsetInsert_height)
276+
linear_extrude(m3_insert_hole_depth)
277277
polygon(polyRound([
278278
[0, 0, 0],
279279
[3, 0, 0],
@@ -362,7 +362,7 @@ module MainCase(without_inserts=false, top_rider=MainCase_top_rider, back_rider=
362362
}
363363

364364
// Hole for USB Charger Port
365-
translate([UsbPort_offset, 0, HeatsetInsert_height + wall_thickness - UsbPort_vertical_offset])
365+
translate([UsbPort_offset, 0, m3_insert_hole_depth + wall_thickness - UsbPort_vertical_offset])
366366
hull()for(i=[-1, 1])for(j=[-1, 1]) {
367367
translate([i/2*6.5, 0, j/2*0.7])
368368
rotate([-90, 0, 0])
@@ -394,14 +394,14 @@ module MainCase(without_inserts=false, top_rider=MainCase_top_rider, back_rider=
394394
}
395395
}
396396

397-
module HexNutHole(depth=0) {
397+
module HexNutHole(nut_depth=3, screw_depth=0) {
398398
mirror([0, 0, 1])
399399
union() {
400-
cylinder(d=HexNutHole_diameter, h=HexNutHole_depth, $fn=6);
400+
cylinder(d=m3_hex_nut_diameter, h=nut_depth, $fn=6);
401401

402-
if (depth > HexNutHole_depth) {
403-
translate([0, 0, HexNutHole_depth])
404-
cylinder(d=ScrewHole_diameter_M3, h=depth - HexNutHole_depth, $fn=32);
402+
if (screw_depth > nut_depth) {
403+
translate([0, 0, nut_depth])
404+
cylinder(d=m3_screw_diameter_loose, h=screw_depth - nut_depth, $fn=32);
405405
}
406406
}
407407
}
@@ -467,7 +467,7 @@ module MountAttachmentHolePattern(with_cable_hole=true) {
467467
j * MountAttachment_holes_dy / 2,
468468
0,
469469
])
470-
HexNutHole(20);
470+
HexNutHole(nut_depth=4, screw_depth=20);
471471
}
472472
}
473473
}

src/MainCase/MainCaseLid.scad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ module MainCaseLid() {
121121
// Holes for M3 screws
122122
for (hole = MainCaseLid_hole_positions) {
123123
translate([hole.x, hole.y, -1])
124-
cylinder(d=ScrewHole_diameter_M3, h=10, $fn=32);
124+
cylinder(d=m3_screw_diameter_loose, h=10, $fn=32);
125125
}
126126
}
127127
}

src/Mounting/LockingPin.scad

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
include <../../variables.scad>
22

3-
LockingPin_diameter = 5.2;
4-
LockingPin_hole_diameter = 3.0;
5-
LockingPin_small_hole_diameter = 2.0;
6-
LockingPin_height = 15;
7-
LockingPin_handle_length = 15.2;
8-
LockingPin_handle_height = 3.5;
9-
LockingPin_foot_height = 2.0;
10-
LockingPin_fillet_radius = 2.0;
11-
123
// $fa = 1;
134
// $fs = 0.1;
145
$fn = 64;
@@ -69,7 +60,7 @@ module LockingPin() {
6960

7061
// hole in main shaft, for holding screw
7162
translate([0, 0, -1])
72-
cylinder(d=LockingPin_hole_diameter, h=LockingPin_height+2);
63+
cylinder(d=m3_screw_diameter_tight, h=LockingPin_height+2);
7364
}
7465
}
7566
}

src/Mounting/StandardMountAdapter.scad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module LockingPinHole(depth=16) {
99
union() {
1010
// the pin
1111
translate([0, 0, -depth-4])
12-
cylinder(h=depth, d=3.2);
12+
cylinder(h=depth, d=m3_screw_diameter_loose);
1313

1414
// the chamber
1515
translate([-6, -5.5/2, -4])

variables.scad

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,23 @@ MainCase_top_rider_cable = !(MainCase_back_rider && MainCase_back_rider_cable);
5353
// Dimensions for parts
5454
// ------------------------
5555

56-
HeatsetInsert_diameter = 4;
57-
HeatsetInsert_height = 5.75;
58-
HeatsetInsert_full_depth = 4.5; // how far the normal hole reaches before it expands to the cavity
59-
HeatsetInsert_extra_radius = 0.5;
56+
// General thickness of all walls of the main case and where applicable
57+
wall_thickness = 2;
6058

61-
// Holes for M3 screws, including clearance
62-
ScrewHole_diameter_M3 = 3.2;
59+
// Dimensions of M3 hardware
60+
m3_screw_diameter_tight = 3.0; // screw should grab the plastic well
61+
m3_screw_diameter_loose = 3.25; // screw should slide in nicely
62+
m3_screw_head_depth = 3; // minimum depth for sinking the screw head
63+
m3_screw_head_diameter = 6; // can have a little clearance
64+
m3_hex_nut_diameter = 6.45; // outer circle, *not* wrench size (S), but `S*2/sqrt(3)`, plus clearance
65+
m3_insert_hole_diameter = 4;
66+
m3_insert_hole_depth = 5.75;
67+
m3_insert_cavity_depth = 5.75 - 4.5; // size of cavity on the bottom for displaced plastic
68+
m3_insert_cavity_diameter = m3_insert_hole_diameter + 1;
6369

6470
SensorHole_diameter = 22.3; // 0.3 clearance
6571
SensorHole_ledge = 1.0;
6672

67-
wall_thickness = 2;
68-
6973
UsbCover_height = 9.7;
7074
UsbCover_foot_height = 1.5;
7175
UsbCover_width = 15.5;
@@ -222,9 +226,6 @@ MountAttachment_holes_x_offset = -0.5;
222226
MountAttachment_holes_dx = 15;
223227
MountAttachment_holes_dy = 33;
224228

225-
HexNutHole_diameter = 6.5;
226-
HexNutHole_depth = 4;
227-
228229
HandlebarRailRail_height = 7;
229230
HandlebarRailRail_length = 32.4;
230231

@@ -303,3 +304,11 @@ BikeRackMountSide_height = 28 + BikeRackMount_bottom_spacing;
303304

304305
TopTubeMount_diameter = 72;
305306
TopTubeMount_height = 20;
307+
308+
LockingPin_diameter = 5.2;
309+
LockingPin_small_hole_diameter = 2.0;
310+
LockingPin_height = 15;
311+
LockingPin_handle_length = 15.2;
312+
LockingPin_handle_height = 3.5;
313+
LockingPin_foot_height = 2.0;
314+
LockingPin_fillet_radius = 2.0;

0 commit comments

Comments
 (0)