Creating new repository to prune history.
[SCSI2SD.git] / hardware / bracket / 3.5_hdd_mount.scad
1 //      Copyright (C) 2013 Michael McMaster <michael@codesrc.com>
2 //
3 //      This file is part of SCSI2SD.
4 //
5 //      SCSI2SD is free software: you can redistribute it and/or modify
6 //      it under the terms of the GNU General Public License as published by
7 //      the Free Software Foundation, either version 3 of the License, or
8 //      (at your option) any later version.
9 //
10 //      SCSI2SD is distributed in the hope that it will be useful,
11 //      but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //      GNU General Public License for more details.
14 //
15 //      You should have received a copy of the GNU General Public License
16 //      along with SCSI2SD.  If not, see <http://www.gnu.org/licenses/>.
17
18
19 $fa = 3; // 4-times as many angles per circle.
20 $fs = 0.1; // 0.1mm accuracy
21
22         // A* taken from SFF-8301 Specification for Form Factor of 3.5" Disk Drives
23
24         A3 = 101.6; // width
25         A5 = 3.19; // Distance from side to bottom hole.
26         A6 = 44.45; // Distance from A7 to second bottom hole.
27         A7 = 41.28; // Distance from front to bottom holes.
28         A8 = 28.5; // Distance from front to side holes
29         A9 = 101.60; // Distance between side holes.
30         A10 = 6.35; // Height from base to site holes.
31         A13 = 76.2; // Distance from A7 to third bottom hole.
32         m3HoleRadius=2.667/2; // M3x0.50 minimum hole size (aluminium or softer material)
33         holeBulk=4; // Extra around holes
34         tmp = 10;
35         wallWidth = 1.3;
36         screwWidth = 3;
37         foo = 6;
38         bar = 4;  // PSOC MOUNT
39
40 PCB_DIFF=90.42; // Clearance line of "fat" via is 10mil from edge.
41 PCB_off = (A3 - PCB_DIFF) / 2;
42 // from front = A7 + foo = 47.28
43 // second = 47.28 + A6 = 91.73. Perfect!
44 // Height between board and screw:
45 // screwWidth + 1.6mm pcb only = 3 + 1.6 =4.6. Not a problem!
46 // Width of PCB vs side hole bulk: 101.6 - 97.5360  = 4.064
47 // only 2mm to spare on either side.
48 // TODO Made a NOTCH in the PCB to handle this!
49 // notch: A8 +- holeBulk = 28.5 - 4, 28.5 + 4 = 24 -> 33mm. 3mm in.
50
51
52
53 module hdd_side()
54 {
55         difference()
56         {
57                 union()
58                 {
59                         cube([A8 + A9 + tmp, wallWidth, A10 + holeBulk]);
60
61                         // Bottom mount 1
62                         translate([A7 - (foo / 2), 0, 0])
63                         {
64                                 cube([foo, foo, screwWidth]); 
65                         }
66
67                         // Bottom mount 2
68                         translate([A6 + A7 - (foo / 2), 0, 0])
69                         {
70                                 cube([foo, foo, screwWidth]); 
71                         }
72
73                         // Bottom mount 3
74                         translate([A13 + A7 - (foo / 2), 0, 0])
75                         {
76                                 cube([foo, foo, screwWidth]); 
77                         }
78
79                         // psoc mount 1
80                         translate([A7 - (foo / 2) + foo, 0, 0])
81                         {
82                                 cube([foo, foo + bar, screwWidth]); 
83                         }
84
85                         // psoc mount 2
86                         translate([A6 + A7 - (foo / 2) + foo, 0, 0])
87                         {
88                                 cube([foo, foo + bar, screwWidth]); 
89                         }
90
91                         // Extra bulk behind side holes
92                         translate([A8, 0, A10])
93                         {
94                                 rotate([270, 0, 0])
95                                 {
96                                         cylinder(h=screwWidth, r=holeBulk);
97                                 }
98                         }
99
100                         translate([A8 + A9, 0, A10])
101                         {
102                                 rotate([270, 0, 0])
103                                 {
104                                         cylinder(h=screwWidth, r=holeBulk);
105                                 }
106                         }
107                 }
108         
109                 // Remove excess material from the side
110                 translate([-0.5, -0.5,screwWidth + wallWidth])
111                 {
112                         cube([A8 - tmp + 0.5, wallWidth + 1, A10 + holeBulk]);
113                 }
114                 translate([A8 + tmp, -0.5, screwWidth + wallWidth])
115                 {
116                         cube([A9 - (tmp * 2), wallWidth + 1, A10 + holeBulk]);
117                 }
118
119
120                 // SIDE HOLES
121         
122                 translate([A8, -0.5, A10])
123                 {
124                         rotate([270, 0, 0])
125                         {
126                                 cylinder(h=screwWidth + 1, r=m3HoleRadius);
127                         }
128                 }
129
130                 translate([A8 + A9, -0.5, A10])
131                 {
132                         rotate([270, 0, 0])
133                         {
134                                 cylinder(h=screwWidth + 1, r=m3HoleRadius);
135                         }
136                 }
137
138                 // BOTTOM HOLES
139                 // Bottom hole 1
140                 translate([A7, A5, -0.5])
141                 {
142                         cylinder(h=screwWidth + 1, r = m3HoleRadius); 
143                 }
144
145                 // Bottom hole 2
146                 translate([A6 + A7, A5, -0.5])
147                 {
148                         cylinder(h=screwWidth + 1, r = m3HoleRadius); 
149                 }
150
151                 // Bottom hole 3
152                 translate([A13 + A7, A5, -0.5])
153                 {
154                         cylinder(h=screwWidth + 1, r = m3HoleRadius); 
155                 }
156
157                 // PSOC hole1
158                 translate([A7 + foo, PCB_off, -0.5])
159                 {
160                         cylinder(h=screwWidth + 1, r = m3HoleRadius); 
161                 }
162                 // PSOC hole2
163                 translate([A6 + A7 + foo, PCB_off, -0.5])
164                 {
165                         cylinder(h=screwWidth + 1, r = m3HoleRadius); 
166                 }
167         }
168 }
169
170 union()
171 {
172         hdd_side();
173         translate([0, A3, 0])
174         {
175                 mirror([0, 1, 0])
176                 {
177                         hdd_side();
178                 }
179         }
180
181         cube([wallWidth * 2, A3, wallWidth]);
182
183         translate([A8 + A9 + tmp - wallWidth * 2, 0, 0])
184         {
185                 cube([wallWidth * 2, A3, wallWidth]);
186         }
187
188                 // Bottom hole 1
189                 translate([A7 + foo, foo + bar, 0])
190                 {
191                         cube([wallWidth * 2, A3 - ((foo + bar) * 2), wallWidth]); 
192                 }
193
194                 // Bottom hole 2
195                 translate([A6 + A7 + foo, foo + bar, 0])
196                 {
197                         cube([wallWidth * 2, A3 - ((foo + bar) * 2), wallWidth]); 
198                 }
199
200
201         for (i = [0:3])
202         {
203                 translate([0, (i * (A3 - wallWidth) / 3), 0])
204                 {
205                         cube([A8 + A9 + tmp, wallWidth, wallWidth]);
206                 }
207         }
208 }