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.

75 line
2.4KB

  1. use <stepper.scad>
  2. use <arm.scad>
  3. use <marker.scad>
  4. use <electronics.scad>
  5. //module arm(holes, width, thinkness, bore){
  6. arm1 = 70;
  7. arm2 = 55;
  8. x = 55; //[15:85]
  9. y = 70; //[35:85]
  10. length = sqrt(pow(x,2) + pow(y,2));
  11. arm1_sq = pow(arm1,2);
  12. arm2_sq = pow(arm2,2);
  13. length_sq = pow(length,2);
  14. b = acos((arm1_sq + length_sq - arm2_sq)/(2 * arm1 * length));
  15. c = acos((arm1_sq - length_sq + arm2_sq)/(2 * arm1 * arm2));
  16. angle1 = b + atan2(y,x) - 90;
  17. angle2 = angle1 - 90 + c;
  18. stepper_spaceing = 45;
  19. stepper_offset = 55;
  20. arm_thickness = 3;
  21. arm_width = 10;
  22. arm_offset = 15;
  23. %translate([stepper_offset,0,0]) {
  24. // stepper on joint C
  25. rotate([0,90,0]) stepper_103H5205();
  26. // stepper on joint A
  27. translate([0,stepper_spaceing,0]) rotate([0,90,0]) stepper_103H5205();
  28. translate([arm_offset,0,0]){
  29. translate([0,stepper_spaceing,0]) rotate([angle1,0,0]) rotate([0,-90,0]) arm([0,-25],arm_width,arm_thickness,5);
  30. //arm1
  31. rotate([angle1,0,0]) rotate([0,-90,0]) arm([0,-25,arm1],arm_width,arm_thickness,5);
  32. //arm2
  33. translate([3,0,0]) rotate([angle1,0,0]) translate([0,0,-25]) rotate([-angle1,0,0]) rotate([90,0,90]) arm([0,stepper_spaceing],arm_width,arm_thickness,5);
  34. translate([-3,0,0]) rotate([angle1,0,0]) translate([0,0,-25]) rotate([-angle1,0,0]) rotate([90,0,90]) arm([0,stepper_spaceing],arm_width,arm_thickness,5);
  35. //arm3
  36. rotate([angle2,0,0]){
  37. translate([3,0,0]) rotate([90,0,-90]) arm([0,25],arm_width,arm_thickness,5);
  38. translate([-3,0,0]) rotate([90,0,-90]) arm([0,25],arm_width,arm_thickness,5);
  39. translate([0,-25,0]) rotate([angle1-angle2,0,0]) {
  40. // arm4
  41. rotate([0,-90,0]) arm([0,arm1],arm_width,arm_thickness,5);
  42. translate([0,0,arm1]) rotate([angle2-angle1,0,0]) {
  43. translate([3,0,0]) rotate([90, 0, 90]) arm([25,0,arm2+25],arm_width,arm_thickness,5);
  44. translate([-3,0,0]) rotate([90, 0, 90]) arm([25,0,arm2+25],arm_width,arm_thickness,5);
  45. translate([-stepper_offset-arm_offset,arm2+25]) rotate([0,90,0]) marker(0);
  46. }
  47. }
  48. }
  49. }
  50. }
  51. // electronics
  52. translate([20,80,-10]) rotate([-0,-90,0]){
  53. color("olive") translate([-12,-2,5]) cube([40,61,1]);
  54. stepper_controller();
  55. translate([0,25.4,0]) stepper_controller();
  56. }
  57. //carriage
  58. translate([stepper_offset,0,0])
  59. rotate([0,90,0]) {
  60. stepper_103H5205_mount();
  61. translate([0,stepper_spaceing,0]) stepper_103H5205_mount();
  62. }