-
Notifications
You must be signed in to change notification settings - Fork 0
/
droneArm.scad
112 lines (92 loc) · 2.85 KB
/
droneArm.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// Tristan Van Cise
// CS 680 - 3D Printing and Robotics
// Homework 2 - OpenSCAD
// 09/16/2018
//
// Single arm for part replacement or
// print testing.
//
// General Variables
screwSize = 3; // m3 by default
// CAUTION: Smaller thickness could lead to
// screws boring through motor coils
drone_arm_thickness = 4;
// Circle Edge Smoothness
$fa = 1;
$fs = 0.1;
// Motor mount
motor_key_radius = 4;
motor_mount_radius = 15.5;
motor_screw_distance_from_center = 6;
motor_mount_to_arm_transition_length = 27;
// Arm
arm_width = 20;
arm_length = 60;
distance_to_arm_end = 1.5*motor_mount_to_arm_transition_length+(arm_length);
module motor_mount_base() {
difference() {
hull() {
circle(r=motor_mount_radius);
motor_mount_to_arm_transition_piece();
}
circle(r=motor_key_radius);
}
}
module motor_mount_to_arm_transition_piece() {
translate([0,motor_mount_to_arm_transition_length,0])
square([arm_width,motor_mount_to_arm_transition_length],center=true);
}
// The holes for the motors are ellipses due to
// varying motor screw hole distances from
// different manufacturers.
module motor_screw_holes() {
translate([-motor_screw_distance_from_center,-motor_screw_distance_from_center]) {
motor_screw_ellipse(screwSize+2,screwSize);
translate([2*motor_screw_distance_from_center,0])
mirror([0,1,0])
motor_screw_ellipse(screwSize+2,screwSize);
}
translate([motor_screw_distance_from_center,motor_screw_distance_from_center]) {
motor_screw_ellipse(screwSize+2,screwSize);
translate([-2*motor_screw_distance_from_center,0])
mirror([0,1,0])
motor_screw_ellipse(screwSize+2,screwSize);
}
}
module motor_screw_ellipse(radiusX,radiusY) {
rotate([0,0,45])
resize([radiusX,radiusY])
circle(r=10);
}
module arm_end_screw_holes() {
translate([5,distance_to_arm_end-5])
circle(r=0.5*screwSize,center=true);
translate([-5,distance_to_arm_end-5])
circle(r=0.5*screwSize,center=true);
translate([0,distance_to_arm_end-10])
circle(r=0.5*screwSize,center=true);
}
module motor_mount() {
difference() {
motor_mount_base();
motor_screw_holes();
}
}
module arm() {
translate([0,1.5*motor_mount_to_arm_transition_length+(0.5*arm_length),0])
square([arm_width,arm_length],center=true);
}
module drone_arm(extrude=true) {
motor_mount();
difference() {
arm();
if(extrude) {
linear_extrude(height = 7, center = true, convexity = 10)
arm_end_screw_holes();
} else {
arm_end_screw_holes();
}
}
}
linear_extrude(height = drone_arm_thickness, center = true, convexity = 10)
drone_arm(false);