No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bearing.scad 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*
  2. * Copyright (c) 2022 - 2023 Thomas Buck (thomas@xythobuz.de)
  3. * Philipp Schönberger (mail@phschoen.de)
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * See <http://www.gnu.org/licenses/>.
  16. */
  17. include <config.scad>;
  18. include <BOSL2/std.scad>;
  19. include <BOSL2/threading.scad>;
  20. bearing_holder();
  21. bearing_holder_mount();
  22. //NOTE: [0,0,0] should be the "top" contact point of the bearings
  23. module bearing_holder()
  24. {
  25. difference()
  26. {
  27. if(bearing_type=="static") {
  28. bearing_holder_static();
  29. }
  30. if(bearing_type=="dynamic_m6_vcn320") {
  31. bearing_holder_m6_vcn320();
  32. }
  33. if(bearing_type=="dynamic_3d_vcn410") {
  34. bearing_holder_d3_vcn410();
  35. }
  36. // cut of the flange
  37. translate([0,bearing_mount_flange, 0])// move in by flange
  38. translate([0,-bearing_mount_dia/2, 0])// move to edge of cylinder
  39. translate([-bearing_mount_dia,-bearing_mount_dia, -bearing_h*2])// center on on half
  40. cube([bearing_mount_dia *2, bearing_mount_dia, bearing_h *3]);
  41. }
  42. }
  43. module bearing_holder_static()
  44. {
  45. // glider ball itself
  46. %translate([0, 0, -bearing_static_dia/2])
  47. color([0.3,0.3,0.3,0.2])
  48. sphere(d = bearing_static_dia, $fn = $fn);
  49. difference()
  50. {
  51. // holder itself
  52. color("magenta")
  53. hull()
  54. {
  55. // hold static ball itself
  56. translate([0, 0, -bearing_static_dia -bearing_static_dia*0.35])
  57. cylinder(d1 = bearing_mount_dia, d2=bearing_static_dia+1, h = bearing_static_dia);
  58. // bottom surface
  59. translate([0, 0, -bearing_h])
  60. cylinder(d = bearing_mount_dia, h = $e);
  61. }
  62. // cut the bearing on the side
  63. // #translate([-bearing_mount_dia / 2 - 1, bearing_mount_dia / 2 - bearing_holder_sider_cut, -1])
  64. // cube([bearing_mount_dia + 2, bearing_mount_dia / 2 + 1, bearing_h + 2]);
  65. // tiny hole through the complete holder to seperate the ball from the holder if needed
  66. color([0.9,0.5,0.5])// lightred
  67. translate([0, 0, -bearing_h-$e])
  68. cylinder(d = bearing_thread_hole, h = bearing_h+$e*2);
  69. // sphere cut of the holder itself
  70. color("gray")
  71. translate([0, 0, - bearing_static_dia / 2])
  72. sphere(d = bearing_static_dia, $fn = $fn);
  73. // cut in order to see through from the side
  74. if (cut_bearing_holder)
  75. translate([-bearing_mount_dia,-bearing_mount_dia, -bearing_h*2])
  76. cube([bearing_mount_dia *2, bearing_mount_dia, bearing_h *3]);
  77. }
  78. }
  79. module bearing_holder_m6_vcn320()
  80. {
  81. l=bearing_h*0.7;
  82. d=3.18;
  83. l2=bearing_h-d*0.6;
  84. difference()
  85. {
  86. union()
  87. {
  88. // main holder part for the m6 screw
  89. translate([0,0,-bearing_h])
  90. cylinder(d=bearing_mount_dia,h=l);
  91. // ball bearing itself
  92. %union()
  93. {
  94. // ball itself
  95. color("red")
  96. translate([0,0,-d/2])
  97. sphere(d = d, $fn = $fn);
  98. // metal champer for the ball
  99. color("silver")
  100. translate([0,0,-1 + d*0.2 -d/2])
  101. cylinder(d2 = 3.5,d1 = 6,h=1);
  102. // m6 rod
  103. translate([0,0,-bearing_h+l2/2-$e])
  104. threaded_rod(d=6, l=l2+$e, pitch=1.0);
  105. }
  106. }
  107. // cut of the rod itself
  108. translate([0,0,-bearing_h+l2/2-$e])
  109. threaded_rod(d=6.1, l=l2, pitch=1.0);
  110. if (cut_bearing_holder)
  111. translate([-bearing_mount_dia,-bearing_mount_dia, -bearing_h*2])
  112. cube([bearing_mount_dia *2, bearing_mount_dia, bearing_h *3]);
  113. }
  114. }
  115. module bearing_holder_d3_vcn410()
  116. {
  117. S=0.6;
  118. D1=3.6;
  119. d=2;
  120. L= 4;
  121. D=3;
  122. // bearing itself
  123. % color([1,1,1,0.0])
  124. {
  125. translate([0,0,-d/2])
  126. sphere(d=d);
  127. translate([0,0,-S-1])
  128. cylinder(d=D1,h=1);
  129. translate([0,0,-L-S])
  130. cylinder(d=D,h=L);
  131. }
  132. difference()
  133. {
  134. union()
  135. {
  136. translate([0,0,-bearing_h])
  137. cylinder(d=bearing_mount_dia,h=bearing_h-L);
  138. translate([0,0,-L-S+1/2])
  139. cylinder(d1=bearing_mount_dia,d2=D+1,h=L-1);
  140. }
  141. // tiny hole through the complete holder to seperate the ball from the holder if needed
  142. color([0.9,0.5,0.5])// lightred
  143. translate([0, 0, -bearing_h-$e])
  144. cylinder(d = bearing_thread_hole, h = bearing_h+$e*2);
  145. // cut for the bearing itself
  146. translate([0,0,-S-1])
  147. cylinder(d=D1+$c,h=1);
  148. translate([0,0,-L-S])
  149. cylinder(d=D+$c,h=L);
  150. }
  151. }
  152. module bearing_holder_mount()
  153. {
  154. translate([0, 0, -1-bearing_h])
  155. {
  156. difference()
  157. {
  158. cylinder(d=bearing_mount_dia+wall,h=bearing_h*0.75);
  159. translate([0, 0, 1])
  160. cylinder(d=bearing_mount_dia+$c*2,h=bearing_h+$e);
  161. }
  162. // add the flange
  163. intersection()
  164. {
  165. cylinder(d=bearing_mount_dia+wall,h=bearing_h*0.75);
  166. // cut of the flange
  167. translate([0,bearing_mount_flange-$c, 0])// move in by flange
  168. translate([0,-bearing_mount_dia/2, 0])// move to edge of cylinder
  169. translate([-bearing_mount_dia,-bearing_mount_dia, -bearing_h*2])// center on on half
  170. cube([bearing_mount_dia *2, bearing_mount_dia, bearing_h *3]);
  171. }
  172. }
  173. }