mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2024-11-23 15:23:51 -05:00
Added printed pcb_mount to hold PCBs without mounting holes.
This commit is contained in:
parent
18294b4b81
commit
a85fdaf176
BIN
libtest.png
BIN
libtest.png
Binary file not shown.
Before Width: | Height: | Size: 721 KiB After Width: | Height: | Size: 739 KiB |
@ -91,6 +91,7 @@ use <tests/strap_handle.scad>
|
||||
use <tests/ssr_shroud.scad>
|
||||
use <tests/psu_shroud.scad>
|
||||
use <tests/flat_hinge.scad>
|
||||
use <tests/pcb_mount.scad>
|
||||
|
||||
x5 = 800;
|
||||
|
||||
@ -304,6 +305,9 @@ translate([x3, veroboard_y])
|
||||
translate([x3 + 70, veroboard_y + 30])
|
||||
geared_steppers();
|
||||
|
||||
translate([x3 + 140, veroboard_y + 20])
|
||||
pcb_mounts();
|
||||
|
||||
translate([x3, d_connectors_y])
|
||||
d_connectors();
|
||||
|
||||
|
124
printed/pcb_mount.scad
Normal file
124
printed/pcb_mount.scad
Normal file
@ -0,0 +1,124 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2019
|
||||
// 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/>.
|
||||
//
|
||||
|
||||
//
|
||||
//! A frame to mount a PCB by its corners when it has no mounting holes.
|
||||
//! The stl must be given a parameterless wrapper in the project that uses it.
|
||||
//
|
||||
include <../core.scad>
|
||||
include <../vitamins/screws.scad>
|
||||
use <../vitamins/pcb.scad>
|
||||
|
||||
clearance = 0.2;
|
||||
min_wall = extrusion_width * 2;
|
||||
wall = 2;
|
||||
|
||||
overlap = 2;
|
||||
|
||||
screw = M3_cap_screw;
|
||||
screw_clearance_r = 3.1 / 2;
|
||||
pillar_r = corrected_radius(screw_clearance_r) + wall;
|
||||
|
||||
function pillar_x_pitch(pcb) = pcb_length(pcb) + 2 * clearance + 2 * (pillar_r - overlap) / sqrt(2); //! x pitch of screw pillars
|
||||
function pillar_y_pitch(pcb) = pcb_width(pcb) + 2 * clearance + 2 * (pillar_r - overlap) / sqrt(2); //! y pitch of screw pillars
|
||||
|
||||
function pcb_mount_length(pcb) = pillar_x_pitch(pcb) + 2 * pillar_r; //! Outside length of the mount
|
||||
function pcb_mount_width(pcb) = pillar_y_pitch(pcb) + 2 * pillar_r; //! Outside width of the mount
|
||||
|
||||
frame_w = 3;
|
||||
frame_t = 2;
|
||||
|
||||
washer_thickness = 1.25;
|
||||
|
||||
module pcb_mount_screw_positions(pcb) //! Positions of the screws and pillars
|
||||
for(x = [-1, 1], y = [-1, 1])
|
||||
translate([x * pillar_x_pitch(pcb) / 2, y * pillar_y_pitch(pcb) / 2])
|
||||
children();
|
||||
|
||||
module pcb_mount_holes(pcb, h = 0) //! Drill holes for PCB mount
|
||||
pcb_mount_screw_positions(pcb)
|
||||
drill(screw_clearance_radius(screw), h);
|
||||
|
||||
module pcb_mount_ring()
|
||||
difference() {
|
||||
circle(pillar_r);
|
||||
|
||||
poly_circle(screw_clearance_r);
|
||||
}
|
||||
|
||||
module pcb_mount_washer_stl() //! A plastic washer to clamp a PCB
|
||||
linear_extrude(height = washer_thickness)
|
||||
pcb_mount_ring();
|
||||
|
||||
module pcb_mount(pcb, height = 5, washers = true) { //! Make the STL of a pcb mount for the specified PCB.
|
||||
stl(str("pcb_mount_", pcb[0], "_", height));
|
||||
|
||||
y_pitch = pcb_width(pcb) > 4 * pillar_r + 4 ? pillar_r + 1
|
||||
: pcb_width(pcb) / 2 + frame_w + 1 + pillar_r;
|
||||
|
||||
if(washers)
|
||||
for(x = [-1, 1], y = [-1, 1])
|
||||
translate([x * (pillar_r + 1), y * y_pitch, 0])
|
||||
pcb_mount_washer_stl();
|
||||
|
||||
for(x = [-1, 1])
|
||||
translate([x * pillar_x_pitch(pcb) / 2, 0, frame_t / 2])
|
||||
cube([frame_w, pillar_y_pitch(pcb) - 2 * wall, frame_t], center = true);
|
||||
|
||||
for(y = [-1, 1])
|
||||
translate([0, y * pillar_y_pitch(pcb) / 2, frame_t / 2])
|
||||
cube([pillar_x_pitch(pcb) - 2 * wall, frame_w, frame_t], center = true);
|
||||
|
||||
pcb_mount_screw_positions(pcb)
|
||||
linear_extrude(height = height)
|
||||
pcb_mount_ring();
|
||||
|
||||
linear_extrude(height = height + pcb_thickness(pcb) - layer_height)
|
||||
difference() {
|
||||
pcb_mount_screw_positions(pcb)
|
||||
pcb_mount_ring();
|
||||
|
||||
square([pcb_length(pcb) + 2 * clearance, pcb_width(pcb) + 2 * clearance], center = true);
|
||||
}
|
||||
}
|
||||
|
||||
module pcb_mount_assembly(pcb, thickness, height = 5) { //! A PCB mount assembly with fasteners
|
||||
translate_z(height)
|
||||
pcb(pcb);
|
||||
|
||||
color(pp1_colour) pcb_mount(pcb, washers = false);
|
||||
|
||||
washer = screw_washer(screw);
|
||||
nut = screw_nut(screw);
|
||||
t = pcb_thickness(pcb);
|
||||
screw_length = screw_longer_than(height + t + washer_thickness + thickness + washer_thickness(washer) + nut_thickness(nut, true));
|
||||
|
||||
pcb_mount_screw_positions(pcb) {
|
||||
translate_z(height + t) {
|
||||
color(pp2_colour) pcb_mount_washer_stl();
|
||||
|
||||
translate_z(washer_thickness)
|
||||
screw(screw, screw_length);
|
||||
}
|
||||
|
||||
translate_z(-thickness)
|
||||
vflip()
|
||||
nut_and_washer(nut, true);
|
||||
}
|
||||
}
|
62
readme.md
62
readme.md
@ -30,13 +30,13 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
|
||||
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#Ring_terminals">Ring_terminals</a> </td><td> <a href = "#Flat_hinge">Flat_hinge</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr>
|
||||
<tr><td> <a href = "#Fans">Fans</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 = "#Fuseholder">Fuseholder</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 = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Screws">Screws</a> </td><td> <a href = "#Psu_shroud">Psu_shroud</a> </td><td> <a href = "#Sector">Sector</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 = "#Sweep">Sweep</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 = "#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 = "#Geared_steppers">Geared_steppers</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 = "#Green_terminals">Green_terminals</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 = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</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 = "#Screw_knob">Screw_knob</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 = "#Socket_box">Socket_box</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 = "#Ssr_shroud">Ssr_shroud</a> </td><td></td><td></td></tr>
|
||||
<tr><td> <a href = "#Jack">Jack</a> </td><td> <a href = "#Ssrs">Ssrs</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </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>
|
||||
@ -3851,6 +3851,54 @@ Printed handle that can be printed without needing support material due to its t
|
||||
| 1 | handle_assembly |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
<a name="Pcb_mount"></a>
|
||||
## Pcb_mount
|
||||
A frame to mount a PCB by its corners when it has no mounting holes.
|
||||
The stl must be given a parameterless wrapper in the project that uses it.
|
||||
|
||||
|
||||
[printed/pcb_mount.scad](printed/pcb_mount.scad) Implementation.
|
||||
|
||||
[tests/pcb_mount.scad](tests/pcb_mount.scad) Code for this example.
|
||||
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```pcb_mount_length(pcb)``` | Outside length of the mount |
|
||||
| ```pcb_mount_width(pcb)``` | Outside width of the mount |
|
||||
| ```pillar_x_pitch(pcb)``` | x pitch of screw pillars |
|
||||
| ```pillar_y_pitch(pcb)``` | y pitch of screw pillars |
|
||||
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```pcb_mount(pcb, height = 5, washers = true)``` | Make the STL of a pcb mount for the specified PCB. |
|
||||
| ```pcb_mount_assembly(pcb, thickness, height = 5)``` | A PCB mount assembly with fasteners |
|
||||
| ```pcb_mount_holes(pcb, h = 0)``` | Drill holes for PCB mount |
|
||||
| ```pcb_mount_screw_positions(pcb)``` | Positions of the screws and pillars |
|
||||
| ```pcb_mount_washer_stl()``` | A plastic washer to clamp a PCB |
|
||||
|
||||
![pcb_mount](tests/png/pcb_mount.png)
|
||||
|
||||
### Vitamins
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 4 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
||||
| 1 | ```pcb(PI_IO)``` | PI_IO V2 |
|
||||
| 1 | ```pin_socket(2p54header, 13, 2)``` | Pin socket 13 x 2 |
|
||||
| 4 | ```screw(M3_cap_screw, 16)``` | Screw M3 cap x 16mm |
|
||||
| 3 | ```terminal_35(2)``` | Terminal block 2 way 3.5mm |
|
||||
| 4 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
|
||||
|
||||
### Printed
|
||||
| Qty | Filename |
|
||||
| ---:|:--- |
|
||||
| 1 | pcb_mount_PI_IO_5.stl |
|
||||
|
||||
|
||||
<a href="#top">Top</a>
|
||||
|
||||
---
|
||||
|
35
tests/pcb_mount.scad
Normal file
35
tests/pcb_mount.scad
Normal file
@ -0,0 +1,35 @@
|
||||
//
|
||||
// NopSCADlib Copyright Chris Palmer 2019
|
||||
// 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 <../lib.scad>
|
||||
use <../printed/pcb_mount.scad>
|
||||
|
||||
PI_IO = ["PI_IO", "PI_IO V2", 35.56, 25.4, 1.6, 0, 0, 0, "green", true, [],
|
||||
[[(3.015 - 2.7) * 25.4 - 3.5 /2, (4.5 - 3.685) * 25.4, 90, "term35", 2],
|
||||
[(3.46 - 2.7) * 25.4 - 3.5 /2, (4.5 - 3.69) * 25.4, 90, "term35", 2],
|
||||
[(3.91 - 2.7) * 25.4 - 3.5 /2, (4.5 - 3.69) * 25.4, 90, "term35", 2],
|
||||
[(3.4 - 2.7) * 25.4, (4.5 - 4.15) * 25.4, 0, "2p54socket", 13, 2],
|
||||
], []];
|
||||
|
||||
module pcb_mounts()
|
||||
if($preview)
|
||||
pcb_mount_assembly(PI_IO, 3);
|
||||
else
|
||||
pcb_mount(PI_IO);
|
||||
|
||||
pcb_mounts();
|
BIN
tests/png/pcb_mount.png
Normal file
BIN
tests/png/pcb_mount.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 109 KiB |
Loading…
Reference in New Issue
Block a user