put left motor speed pin on 10 for pwm
[challenge-bot] / 3d-printables / wheel-data.scad
CommitLineData
3d90aff0 1// challenge-bot
2// GNU AGPLv3 (or later at your option)
3// project available at these locations:
4// https://gitorious.org/ozzloy/challenge-bot
5// https://github.com/waynegramlich/challenge-bot
6
7// use $fn = 20 while developing, 100 when about to print
8// 20 will make previews fast
9// 100 will make printing smooth
10$fn = 100;
11
3cfef3f3 12wheel_square_spoke_size = 45;
13wheel_square_spoke_thickness = 2;
3d90aff0 14
15wall_width = 3;
16
17wheel_width = 9;
21c36d93 18wheel_radius =
19 sqrt(2 * pow(wheel_square_spoke_size / 2, 2)) + wall_width / 2 + 1;
3d90aff0 20
21motor_shaft_radius = 3.7;
22motor_shaft_flat_width = 4.8;
23
24tread_radius = 4 / 2;
25
26module mounting_screw_flat() {
3d0dc05f 27 circle(1.1); }
3d90aff0 28
29module motor_shaft_flat(radius, flat_width) {
30 intersection() {
31 circle(radius);
32 square([flat_width, radius * 2], center = true); } }
33
34module motor_shaft(radius,
35 flat_width,
36 shaft_length) {
37 linear_extrude(height = shaft_length) {
38 motor_shaft_flat(radius, flat_width); } }
39
40module rim(radius, wall_width, wheel_width) {
41 linear_extrude(height = wheel_width) {
42 difference() {
43 circle(radius);
44 circle(radius - wall_width); } } }
45
46module motor_shaft_holder_flat(radius, flat_width, wall_width) {
47 difference() {
48 motor_shaft_flat(radius + wall_width,
49 flat_width + wall_width);
50 motor_shaft_flat(radius, flat_width); } }
51
52module motor_shaft_holder(radius, flat_width, wall_width, height) {
53 linear_extrude(height = height) {
54 motor_shaft_holder_flat(radius, flat_width, wall_width); } }
55
56module tread(wheel_radius, tread_radius) {
57 rotate_extrude(convexity = 10) {
58 translate([wheel_radius, 0]) {
59 circle(tread_radius); } } }
60
3d90aff0 61module wheel(radius,
62 width,
63 shaft_radius,
64 shaft_flat_width,
65 wall_width,
66 tread_radius) {
3d90aff0 67 difference() {
68 rim(radius, wall_width * 2, width);
69 translate([0, 0, width / 2]) {
70 tread(radius, tread_radius); } }
3cfef3f3 71 linear_extrude(height = wheel_square_spoke_thickness) {
3d90aff0 72 difference() {
3cfef3f3 73 square(wheel_square_spoke_size, center = true);
3d90aff0 74 mounting_screw_flat(); } }
3cfef3f3 75 translate([0, 0, wheel_square_spoke_thickness]) {
3d90aff0 76 motor_shaft_holder(shaft_radius,
77 shaft_flat_width,
78 wall_width,
3cfef3f3 79 width - wheel_square_spoke_thickness); } }