simplify wiring, keep right and left separated
[challenge-bot] / wheel.scad
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 = 20;
11
12 wheel_depth = 6;
13 wheel_radius = 68/2;
14
15 module encoder_shaft(){
16 // measured with calipers, checked against the motor shaft
17 motor_shaft_big = 3.7; // radius, gets doubled in cylinder
18 motor_shaft_small = 4.8; // total length of box
19 motor_shaft_length = wheel_depth * 3 / 4;
20
21 intersection(){
22 cylinder(h = motor_shaft_length, r = motor_shaft_big, center = true);
23 // x direction is multiplied by 2 because the radius of the cylinder
24 // goes in both directions. the extra .1 is for overlap
25 cube([motor_shaft_big * 2.1, motor_shaft_small, motor_shaft_length],
26 center = true);}}
27
28 module mounting_screw(){
29 cylinder(h = wheel_depth * 1.1, r = 1, center = true);}
30
31 module wheel(){
32 translate([0, 0, wheel_depth / 2]){
33 difference(){
34 cylinder(h = wheel_depth, r = wheel_radius, center = true);
35 translate([0, 0, wheel_depth / 4]){
36 scale([1, 1, 1.1]){
37 encoder_shaft();}}
38 mounting_screw();
39 for(i = [1 : 5]){
40 rotate(i * 360/5, [0, 0, 1]){
41 translate([0, 0, -0.6 * wheel_depth])
42 between_spokes();}}
43 translate([0, 0, wheel_depth / 4]){
44 difference(){
45 cylinder(h = wheel_depth / 1.2,
46 r = 0.85 * wheel_radius,
47 center = true);
48 cylinder(h = wheel_depth / 1.2,
49 r = 0.23 * wheel_radius,
50 center = true);}}}}}
51
52 module wheel_block(){
53 cube([wheel_radius, wheel_radius, wheel_depth]);}
54
55 module pie_slice(){
56 intersection(){
57 translate([0, 0, wheel_depth / 2]){
58 cylinder(h = wheel_depth,
59 r = 0.85 * wheel_radius,
60 center = true);}
61 translate([0, wheel_radius * 0.3, 0]){
62 rotate([0, 0, (360 / 5) / 2]){
63 intersection(){
64 wheel_block();
65 rotate([0, 0, 90 - 360 / 5])
66 wheel_block();}}}}}
67
68 module between_spokes(){
69 minkowski(){
70 pie_slice();
71 cylinder(h = wheel_depth / 2, r = 1);}}
72
73 wheel();