This repository has been archived by the owner on Dec 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBalancingRobot.scad
102 lines (83 loc) · 3.69 KB
/
BalancingRobot.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
$fn = 100;
/**
* Source file for the 3D printed support for the balancing robot.
* All dimensions are in centimeters, manually measured!
*/
bot_width = 175;
bot_height = 8;
bot_depth = 45;
// Padding around the edge of the board.
padding = 5;
// Size of the 4 screw holes
hole_radius = 2;
// Stepper motor sizings
motor_width = 25;
motor_depth = 40;
motor_inset = 15;
// Size of the battery pack
battery_width = 75;
battery_depth = 40;
battery_height = 20;
battery_hole_radius = 3 / 2;
battery_hole_spacing = 20;
// Motor guard sizes
guard_width = 5;
guard_depth = motor_depth;
guard_height = 5;
tyrep_depth = (bot_depth - motor_depth) / 2;
tyrep_width = 4;
difference() {
// Base plate
color("#6c71c4") hull() {
corner_radius = 2.5;
translate([corner_radius, corner_radius, 0])
cylinder(h=bot_height, r = corner_radius);
translate([bot_width - corner_radius, corner_radius, 0])
cylinder(h=bot_height, r = corner_radius);
translate([corner_radius, bot_depth - corner_radius, 0])
cylinder(h=bot_height, r = corner_radius);
translate([bot_width - corner_radius, bot_depth - corner_radius, 0])
cylinder(h=bot_height, r = corner_radius);
}
// 4 holes that align with the breadboard.
translate([padding + hole_radius, padding + hole_radius, 0])
cylinder(h = bot_height, r=hole_radius);
translate([bot_width - padding - hole_radius, bot_depth - padding - hole_radius, 0])
cylinder(h = bot_height, r=hole_radius);
translate([bot_width - padding - hole_radius, padding + hole_radius, 0])
cylinder(h = bot_height, r=hole_radius);
translate([padding + hole_radius, bot_depth - padding - hole_radius, 0])
cylinder(h = bot_height, r=hole_radius);
// Battery holes
translate([bot_width/2, bot_depth / 2 - (battery_hole_spacing / 2), 0])
cylinder(h = bot_height, r = battery_hole_radius);
translate([bot_width/2, bot_depth / 2 + (battery_hole_spacing / 2), 0])
cylinder(h = bot_height, r = battery_hole_radius);
// Tyreps
translate([motor_inset + (motor_width / 2) - (tyrep_width / 2), 0, 0])
cube([tyrep_width, tyrep_depth, bot_height]);
translate([motor_inset + (motor_width / 2) - (tyrep_width / 2), bot_depth - tyrep_depth, 0])
cube([tyrep_width, tyrep_depth, bot_height]);
translate([bot_width - motor_inset - (motor_width / 2) - (tyrep_width / 2), 0, 0])
cube([tyrep_width, tyrep_depth, bot_height]);
translate([bot_width - motor_inset - (motor_width / 2) - (tyrep_width / 2), bot_depth - tyrep_depth, 0])
cube([tyrep_width, tyrep_depth, bot_height]);
}
// Motors, battery packs
%union() {
translate([motor_inset, (bot_depth - motor_depth) / 2, bot_height])
cube([motor_width, motor_depth, motor_depth]);
translate([bot_width - motor_width - motor_inset, (bot_depth - motor_depth) / 2, bot_height])
cube([motor_width, motor_depth, motor_depth]);
translate([(bot_width - battery_width) / 2, (bot_depth - battery_depth) / 2, bot_height])
cube([battery_width, battery_depth, battery_height]);
}
// Motor guards
translate([motor_inset - guard_width, (bot_depth - motor_depth) / 2, bot_height])
cube([guard_width, guard_depth, guard_height]);
translate([motor_inset + motor_width, (bot_depth - motor_depth) / 2, bot_height])
cube([guard_width, guard_depth, guard_height]);
translate([bot_width - motor_inset - guard_width - motor_width, (bot_depth - motor_depth) / 2, bot_height])
cube([guard_width, guard_depth, guard_height]);
translate([bot_width - motor_inset, (bot_depth - motor_depth) / 2, bot_height])
cube([guard_width, guard_depth, guard_height]);