forked from diara628/MCAD_old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
motors.scad
98 lines (89 loc) · 2.69 KB
/
motors.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Copyright 2010 D1plo1d
// This library is dual licensed under the GPL 3.0 and the GNU Lesser General Public License as per http://creativecommons.org/licenses/LGPL/2.1/ .
include <math.scad>
//generates a motor mount for the specified nema standard #.
module stepper_motor_mount(nema_standard,slide_distance=0, mochup=true, tolerance=0) {
//dimensions from:
// http://www.numberfactory.com/NEMA%20Motor%20Dimensions.htm
if (nema_standard == 17)
{
_stepper_motor_mount(
motor_shaft_diameter = 0.1968*mm_per_inch,
motor_shaft_length = 0.945*mm_per_inch,
pilot_diameter = 0.866*mm_per_inch,
pilot_length = 0.80*mm_per_inch,
mounting_bolt_circle = 1.725*mm_per_inch,
bolt_hole_size = 3.5,
bolt_hole_distance = 1.220*mm_per_inch,
slide_distance = slide_distance,
mochup = mochup,
tolerance=tolerance);
}
if (nema_standard == 23)
{
_stepper_motor_mount(
motor_shaft_diameter = 0.250*mm_per_inch,
motor_shaft_length = 0.81*mm_per_inch,
pilot_diameter = 1.500*mm_per_inch,
pilot_length = 0.062*mm_per_inch,
mounting_bolt_circle = 2.625*mm_per_inch,
bolt_hole_size = 0.195*mm_per_inch,
bolt_hole_distance = 1.856*mm_per_inch,
slide_distance = slide_distance,
mochup = mochup,
tolerance=tolerance);
}
}
//inner mehod for creating a stepper motor mount of any dimensions
module _stepper_motor_mount(
motor_shaft_diameter,
motor_shaft_length,
pilot_diameter,
pilot_length,
mounting_bolt_circle,
bolt_hole_size,
bolt_hole_distance,
slide_distance = 0,
motor_length = 40, //arbitray - not standardized
mochup,
tolerance = 0
)
{
union()
{
// == centered mount points ==
//mounting circle inset
translate([0,slide_distance/2,0]) circle(r = pilot_diameter/2 + tolerance);
square([pilot_diameter,slide_distance],center=true);
translate([0,-slide_distance/2,0]) circle(r = pilot_diameter/2 + tolerance);
//todo: motor shaft hole
//mounting screw holes
for (x = [-1,1])
{
for (y = [-1,1])
{
translate([x*bolt_hole_distance/2,y*bolt_hole_distance/2,0])
{
translate([0,slide_distance/2,0]) circle(bolt_hole_size/2 + tolerance);
translate([0,-slide_distance/2,0]) circle(bolt_hole_size/2 + tolerance);
square([bolt_hole_size+2*tolerance,slide_distance],center=true);
}
}
}
// == motor mock-up ==
//motor box
if (mochup == true)
{
%translate([0,0,-5]) cylinder(h = 5, r = pilot_diameter/2);
%translate(v=[0,0,-motor_length/2])
{
cube(size=[bolt_hole_distance+bolt_hole_size+5,bolt_hole_distance+bolt_hole_size+5,motor_length], center = true);
}
//shaft
%translate(v=[0,0,-(motor_length-motor_shaft_length-2)/2])
{
%cylinder(r=motor_shaft_diameter/2,h=motor_length+motor_shaft_length--1, center = true);
}
}
}
}