initial commit
[clinton/prusa3.git] / inc / mendel_misc.inc
1 /*
2 * Miscellaneous constants and standard objects used in Mendel
3 * by Vik Olliver 29-03-2010. Uses components of the
4 * OpenSCAD Shapes Library (www.openscad.at)
5 * Copyright (C) 2009 Catarina Mota <clifford@clifford.at>
6 *
7 * 5-Apr-2010 vik@diamondage.co.nz
8 * Different clearances are being implemented for vertical and
9 * horizontal holes, as rudimentary extruders cannot relaibly
10 * control extrusions around corners.
11 *
12 * 5-Apr-2010 vik@diamondage.co.nz
13 * Added vertex separation and adapted for Y motor bracket.
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 *
29 */
30
31
32 // Useful constants etc.
33 nema17_side=45;
34 m3_clearance_rad=1.9;
35 m4_clearance_rad_v=2.8; // Vertical clearance
36 m4_clearance_rad_h=2.2; // Horizontal clearance
37 m6_clearance_rad=3.7;
38 m8_tight_rad=4.6;
39 m8_clearance_rad=4.9;
40 bearing_608_rad_v=11.8;
41
42
43
44 // Stuff relevant to the construction of various interconnecting bits of Mendel.
45 //
46 // Vertex and Y motor mount stuff.
47 vertex_m8_sep=58;
48 // X carriage design
49 x_car_top_axle_offset=32;
50 x_car_bottom_axle_offset=22.5;
51 x_car_length= 98; // Length of the X carriage
52 x_car_wing_offset=7.8; // Offset of X Carriage wings from centre line
53 x_car_top_knob_width=13; // Width of knobbly bit at each end of the X carriage top section.
54 x_belt_spacing=20;
55
56 // Extruder size etc.
57 extruder_mount_hole_spacing=50;
58 extruder_thick=20;
59 extruder_height=44;
60
61 // Axis leadscrew holder
62 leadscrew_base_height=17;
63 z_guide_bar_rad=4.3; // Radius of the Z guide bars
64 z_motor_rail_sep=63;
65 z_motor_rail_height=12;
66
67 module box(w,h,d) {
68 scale ([w,h,d]) cube(1, true);
69 }
70
71 module hexagon(height, depth) {
72 boxWidth=height/1.75;
73 union(){
74 box(boxWidth, height, depth);
75 rotate([0,0,60]) box(boxWidth, height, depth);
76 rotate([0,0,-60]) box(boxWidth, height, depth);
77 }
78 }
79
80 module m8_hole_horiz(l) {
81 cylinder(l,m8_clearance_rad,m8_clearance_rad,center=true);
82 translate ([m8_clearance_rad*0.6,0,0]) rotate ([0,0,45])
83 cube([m8_clearance_rad,m8_clearance_rad,l],center=true);
84 }
85
86 module m8_hole_vert(l) {
87 cylinder(l,m8_clearance_rad,m8_clearance_rad,center=true);
88 }
89
90 // For nut cavities, "height" is the max distance between two points on the hex.
91 module m4_nut_cavity(l) {
92 hexagon(height=7.5,depth=l);
93 }
94
95 module m8_nut_cavity(l) {
96 hexagon(height=14,depth=l);
97 }
98
99 module m3_slot(l) {
100 cube([7.149,l,3.4],center=true);
101 }
102
103 module m4_hole_horiz(l) {
104 cylinder(l,m4_clearance_rad_h,m4_clearance_rad_h,center=true);
105 translate ([m4_clearance_rad_h*0.6,0,0]) rotate ([0,0,45])
106 cube([m4_clearance_rad_h,m4_clearance_rad_h,l],center=true);
107 }
108
109 module m4_hole_vert(l) {
110 cylinder(l,m4_clearance_rad_v,m4_clearance_rad_v,center=true);
111 }
112
113 module m4_hole_vert_with_hex(l) {
114 union () {
115 m4_hole_vert(l);
116 translate ([0,0,-l/4]) rotate ([0,0,30]) scale ([1.1,1.1,1]) m4_nut_cavity(l/2);
117 }
118 }
119
120 module m4_hole_horiz_with_hex(l) {
121 union () {
122 m4_hole_horiz(l);
123 translate ([0,0,-l/4]) rotate ([0,0,0]) m4_nut_cavity(l/2);
124 }
125 }
126
127 module m8_hole_vert_with_hex(l) {
128 union () {
129 m8_hole_vert(l);
130 translate ([0,0,-l/4]) rotate ([0,0,30]) m8_nut_cavity(l/2);
131 }
132 }
133
134
135 // Hole for a NEMA17 with one sloped side so that the wires can dangle
136 // out of it...
137 module nema_17() {
138 union () {
139 translate ([0,0,nema17_side/2]) box(nema17_side,nema17_side,nema17_side);
140 cylinder (h=nema17_side*1.5,r=24/2,center=true);
141 // Flip-out bit needed when building with X vertical
142 translate ([nema17_side/2,0,0]) rotate ([0,-45,0]) translate ([nema17_side/2,0,nema17_side/2])
143 box(nema17_side,nema17_side,nema17_side);
144 // 8mm * M3 clearance slots, 4 of.
145 rotate ([0,0,45]) translate([20,0,0]) box(8,m3_clearance_rad*2, 60);
146 rotate ([0,0,-45]) translate([20,0,0]) box(8,m3_clearance_rad*2, 60);
147 rotate ([0,0,135]) translate([20,0,0]) box(8,m3_clearance_rad*2, 60);
148 rotate ([0,0,-135]) translate([20,0,0]) box(8,m3_clearance_rad*2, 60);
149 }
150 }
151
152 // Set of 3 holes at each end of an X carriage by which the two halves are joined and balanced.
153 module x_carriage_common_holes() {
154 union() {
155 translate ([(x_car_length-x_car_top_knob_width)/2,0,0]) m4_hole_vert(60);
156 translate ([(x_car_length-x_car_top_knob_width)/2,16.5,0]) m4_hole_vert(60);
157 translate ([(x_car_length-x_car_top_knob_width)/2,-15,0]) m4_hole_vert(60);
158 translate ([(x_car_length-x_car_top_knob_width)/-2,0,0]) m4_hole_vert(60);
159 translate ([(x_car_length-x_car_top_knob_width)/-2,16.5,0]) m4_hole_vert(60);
160 translate ([(x_car_length-x_car_top_knob_width)/-2,-15,0]) m4_hole_vert(60);
161 }
162 }
163