Merge branch 'martinbudden-scs_bearing_blocks'

This commit is contained in:
Chris Palmer 2020-02-24 00:03:42 +00:00
commit fa91acbaad
6 changed files with 312 additions and 17 deletions

View File

@ -64,6 +64,7 @@ include <vitamins/ldrs.scad>
include <vitamins/geared_steppers.scad>
include <vitamins/extrusions.scad>
include <vitamins/sk_brackets.scad>
include <vitamins/scs_bearing_blocks.scad>
use <vitamins/jack.scad>
use <vitamins/meter.scad>

View File

@ -31,23 +31,23 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#Rockers">Rockers</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Rod">Rod</a> </td><td> <a href = "#Handle">Handle</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Screws">Screws</a> </td><td> <a href = "#Pcb_mount">Pcb_mount</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</a> </td><td> <a href = "#Psu_shroud">Psu_shroud</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Sk_brackets">Sk_brackets</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Iecs">Iecs</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#Ssr_shroud">Ssr_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Inserts">Inserts</a> </td><td> <a href = "#Springs">Springs</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Jack">Jack</a> </td><td> <a href = "#Ssrs">Ssrs</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Ldrs">Ldrs</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Leds">Leds</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Light_strips">Light_strips</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Linear_bearings">Linear_bearings</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Mains_sockets">Mains_sockets</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Meter">Meter</a> </td><td> <a href = "#Washers">Washers</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Microswitches">Microswitches</a> </td><td> <a href = "#Wire">Wire</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Microview">Microview</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Modules">Modules</a> </td><td></td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Scs_bearing_blocks">Scs_bearing_blocks</a> </td><td> <a href = "#Psu_shroud">Psu_shroud</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Sk_brackets">Sk_brackets</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Iecs">Iecs</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Ssr_shroud">Ssr_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Inserts">Inserts</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Jack">Jack</a> </td><td> <a href = "#Springs">Springs</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Ldrs">Ldrs</a> </td><td> <a href = "#Ssrs">Ssrs</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Leds">Leds</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Light_strips">Light_strips</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Linear_bearings">Linear_bearings</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Mains_sockets">Mains_sockets</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Meter">Meter</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Microswitches">Microswitches</a> </td><td> <a href = "#Washers">Washers</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Microview">Microview</a> </td><td> <a href = "#Wire">Wire</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Modules">Modules</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td></td><td></td><td></td></tr>
</table>
---
@ -2408,6 +2408,64 @@ Machine screws and wood screws with various head styles.
| 1 | ```screw(No6_screw, 30)``` | Screw No6 pan wood x 30mm |
<a href="#top">Top</a>
---
<a name="Scs_bearing_blocks"></a>
## Scs_bearing_blocks
[vitamins/scs_bearing_blocks.scad](vitamins/scs_bearing_blocks.scad) Object definitions.
[vitamins/scs_bearing_block.scad](vitamins/scs_bearing_block.scad) Implementation.
[tests/scs_bearing_blocks.scad](tests/scs_bearing_blocks.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| ```scs_bearing(type)``` | Linear bearing used |
| ```scs_block_center_height(type)``` | Height of the center of the block |
| ```scs_block_side_height(type)``` | Height of the side of the block, this determines the minimum screw length |
| ```scs_hole_offset(type)``` | Offset of bearing hole from base of block |
| ```scs_screw(type)``` | Screw type |
| ```scs_screw_separation_x(type)``` | Screw separation in X direction |
| ```scs_screw_separation_z(type)``` | Screw separation in Z direction |
### Functions
| Function | Description |
|:--- |:--- |
| ```scs_size(type)``` | Size of scs bracket bounding block |
### Modules
| Module | Description |
|:--- |:--- |
| ```scs_bearing_block(type)``` | Draw the specified SCS bearing block |
| ```scs_bearing_block_assembly(type, part_thickness, screw_type, nut_type)``` | Assembly with screws and nuts in place |
| ```scs_bearing_block_hole_positions(type)``` | Place children at hole positions |
![scs_bearing_blocks](tests/png/scs_bearing_blocks.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 12 | ```nut(M4_nut)``` | Nut M4 x 3.2mm |
| 24 | ```nut(M5_nut)``` | Nut M5 x 4mm |
| 1 | ```scs_bearing_block(SCS10LUU)``` | SCS10LUU bearing block |
| 1 | ```scs_bearing_block(SCS10UU)``` | SCS10UU bearing block |
| 1 | ```scs_bearing_block(SCS12LUU)``` | SCS12LUU bearing block |
| 1 | ```scs_bearing_block(SCS12UU)``` | SCS12UU bearing block |
| 1 | ```scs_bearing_block(SCS16LUU)``` | SCS16LUU bearing block |
| 1 | ```scs_bearing_block(SCS16UU)``` | SCS16UU bearing block |
| 1 | ```scs_bearing_block(SCS6UU)``` | SCS6UU bearing block |
| 1 | ```scs_bearing_block(SCS8LUU)``` | SCS8LUU bearing block |
| 1 | ```scs_bearing_block(SCS8UU)``` | SCS8UU bearing block |
| 4 | ```screw(M4_cap_screw, 25)``` | Screw M4 cap x 25mm |
| 8 | ```screw(M4_cap_screw, 30)``` | Screw M4 cap x 30mm |
| 16 | ```screw(M5_cap_screw, 35)``` | Screw M5 cap x 35mm |
| 8 | ```screw(M5_cap_screw, 45)``` | Screw M5 cap x 45mm |
| 12 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
| 24 | ```washer(M5_washer)``` | Washer M5 x 10mm x 1mm |
<a href="#top">Top</a>
---

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View File

@ -0,0 +1,35 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../utils/layout.scad>
include <../vitamins/scs_bearing_blocks.scad>
module scs_bearing_blocks()
layout([for(s = scs_bearing_blocks) 2 * scs_size(s)[0]]) {
part_thickness = 5;
scs_bearing_block_assembly(scs_bearing_blocks[$i], part_thickness);
if($i > 0) // skip $i==0, since no SCS6LUU long variant to match SCS6UU
translate([0, 60])
scs_bearing_block_assembly(scs_bearing_blocks_long[$i - 1], part_thickness);
}
if($preview)
scs_bearing_blocks();

View File

@ -0,0 +1,157 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//
// SCSnUU and SCSnLUU bearing blocks
//
include <NopSCADlib/core.scad>
use <NopSCADlib/vitamins/screw.scad>
use <NopSCADlib/vitamins/nut.scad>
use <NopSCADlib/vitamins/washer.scad>
use <NopSCADlib/vitamins/linear_bearing.scad>
function scs_size(type) = [type[4],type[6],type[5]]; //! Size of scs bracket bounding block
function scs_hole_offset(type) = type[2]; //! Offset of bearing hole from base of block
function scs_block_center_height(type) = type[6]; //! Height of the center of the block
function scs_block_side_height(type) = type[7]; //! Height of the side of the block, this determines the minimum screw length
function scs_screw(type) = type[11]; //! Screw type
function scs_screw_separation_x(type) = type[8]; //! Screw separation in X direction
function scs_screw_separation_z(type) = type[9]; //! Screw separation in Z direction
function scs_bearing(type) = type[14]; //! Linear bearing used
sks_bearing_block_color = grey90;
module scs_bearing_block(type) { //! Draw the specified SCS bearing block
vitamin(str("scs_bearing_block(", type[0], "): ", type[0], " bearing block"));
T = type[1];
h = scs_hole_offset(type);
E = type[3];
W = scs_size(type)[0];
assert(W == 2 * E, str("W or E wrong for scs_bearing_block", type[0]));
L = scs_size(type)[2];
F = scs_block_center_height(type);
G = scs_block_side_height(type);
B = scs_screw_separation_x(type);
C = scs_screw_separation_z(type);
K = type[10];
S1 = scs_screw(type);
S2 = type[12];
L1 = type[13];
module right_trapezoid(base, top, height, h = 0, center = true) {//! A right angled trapezoid with the 90&deg; corner at the origin. 3D when ```h``` is nonzero, otherwise 2D
extrude_if(h, center = center)
polygon(points = [ [0,0], [base, 0], [top, height], [0, height] ]);
}
boltHoleRadius = screw_clearance_radius(S1);
footHeight = min(0.75, (G - bearing_dia(scs_bearing(type)) - 1.5) / 2); // estimate, not specified on drawings
color(sks_bearing_block_color) {
linear_extrude(L, center = true) {
bearingRadius = bearing_dia(scs_bearing(type)) / 2;
// center section with bearing hole
difference() {
union() {
translate([-(B - 2 * boltHoleRadius) / 2, -h + footHeight])
square([B - 2 * boltHoleRadius, G - footHeight]);
for(m = [0, 1])
mirror([m, 0, 0])
translate([0 , G - h])
right_trapezoid(bearingRadius, bearingRadius -F + G, F - G);
}
circle(r = bearingRadius);
}
// add the sides
for(m = [0, 1])
mirror([m, 0, 0]) {
trapezoidX = boltHoleRadius - 0.5; // estimate, not specified on drawings
sideX = 2 * (K - boltHoleRadius - trapezoidX);
chamfer = 0.5;
assert(sideX > chamfer, "trapezoidX too large in scs_bearing_block");
translate([B / 2 + boltHoleRadius, -h]) {
square([sideX - chamfer, G]);
translate([sideX, 0])
rotate(90)
right_trapezoid(G - chamfer, G, chamfer);
translate([sideX, 0]) {
right_trapezoid(trapezoidX - footHeight, trapezoidX, footHeight);
translate([trapezoidX, footHeight])
rotate(90)
right_trapezoid(T - footHeight, L1 - footHeight, trapezoidX);
}
}
translate([B / 2 - boltHoleRadius, -h])
mirror([1, 0, 0])
right_trapezoid(boltHoleRadius, boltHoleRadius + footHeight, footHeight);
}
}
// side blocks with bolt holes
for(x = [-B / 2, B / 2])
translate([x, G / 2 - h, 0])
rotate([90, 0, 0])
linear_extrude(G, center = true)
difference() {
square([boltHoleRadius * 2, L], center = true);
for (y = [-C / 2, C / 2])
translate([0, y])
circle(r = boltHoleRadius);
}
}
not_on_bom() no_explode()
linear_bearing(scs_bearing(type));
}
module scs_bearing_block_hole_positions(type) { //! Place children at hole positions
screw_separation_x = scs_screw_separation_x(type);
screw_separation_z = scs_screw_separation_z(type);
G = scs_block_side_height(type);
h = scs_hole_offset(type);
for(x = [-screw_separation_x, screw_separation_x], z = [-screw_separation_z, screw_separation_z])
translate([x / 2, G - h, z / 2])
rotate([-90, 0, 0])
children();
}
module scs_bearing_block_assembly(type, part_thickness, screw_type, nut_type) { //! Assembly with screws and nuts in place
scs_bearing_block(type);
screw_type = is_undef(screw_type) ? scs_screw(type) : screw_type;
nut_type = is_undef(nut_type) ? screw_nut(screw_type) : nut_type;
washer_type = nut_washer(nut_type);
washer_thickness = washer_type ? washer_thickness(washer_type) : 0;
G = scs_block_side_height(type);
nut_offset = G + part_thickness + nut_thickness(nut_type) + washer_thickness;
screw_length = screw_longer_than(nut_offset);
scs_bearing_block_hole_positions(type) {
screw(screw_type, screw_length);
translate_z(-nut_offset)
nut(nut_type)
if (washer_type)
washer(washer_type);
}
}

View File

@ -0,0 +1,44 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//
// SCS bearing blocks
//
include <NopSCADlib/core.scad>
include <NopSCADlib/vitamins/screws.scad>
include <NopSCADlib/vitamins/linear_bearings.scad>
// T h E W L F G B C K S1 S2 L1 LB
SCS6UU = ["SCS6UU", 6, 9, 15, 30, 25, 18, 15, 20, 15, 5, M4_cap_screw, 3.4, 8, LM6UU];
SCS8UU = ["SCS8UU", 6, 11, 17, 34, 30, 22, 18, 24, 18, 5, M4_cap_screw, 3.4, 8, LM8UU];
SCS10UU = ["SCS10UU", 8, 13, 20, 40, 35, 26, 21, 28, 21, 6, M5_cap_screw, 4.3, 12, LM10UU];
SCS12UU = ["SCS12UU", 8, 15, 21, 42, 36, 28, 24, 30.5, 26, 5.75, M5_cap_screw, 4.3, 12, LM12UU];
SCS16UU = ["SCS16UU", 9, 19, 25, 50, 44, 38.5, 32.5, 36, 34, 7, M5_cap_screw, 4.3, 12, LM16UU];
SCS8LUU = ["SCS8LUU", 6, 11, 17, 34, 58, 22, 18, 24, 42, 5, M4_cap_screw, 3.4, 8, LM8LUU];
SCS10LUU = ["SCS10LUU", 8, 13, 20, 40, 68, 26, 21, 28, 45, 6, M5_cap_screw, 4.3, 12, LM10LUU];
SCS12LUU = ["SCS12LUU", 8, 15, 21, 42, 70, 28, 24, 30.5, 50, 5.75, M5_cap_screw, 4.3, 12, LM12LUU];
SCS16LUU = ["SCS16LUU", 9, 19, 25, 50, 85, 38.5, 32.5, 36, 60, 7, M5_cap_screw, 4.3, 12, LM16LUU];
scs_bearing_blocks = [SCS6UU, SCS8UU, SCS10UU, SCS12UU, SCS16UU];
scs_bearing_blocks_long = [SCS8LUU, SCS10LUU, SCS12LUU, SCS16LUU];
use <scs_bearing_block.scad>