Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. // Test support frame for proto boards
  2. // Ed Nisley KE4ZNU - Jan 2017
  3.  
  4. ClampFlange = true;
  5.  
  6. Channel = false;
  7.  
  8. //- Extrusion parameters - must match reality!
  9.  
  10. ThreadThick = 0.25;
  11. ThreadWidth = 0.40;
  12.  
  13. function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
  14.  
  15. Protrusion = 0.1;
  16.  
  17. HoleWindage = 0.2;
  18.  
  19. //- Screw sizes
  20.  
  21. inch = 25.4;
  22.  
  23. Tap4_40 = 0.089 * inch;
  24. Clear4_40 = 0.110 * inch;
  25. Head4_40 = 0.211 * inch;
  26. Head4_40Thick = 0.065 * inch;
  27. Nut4_40Dia = 0.228 * inch;
  28. Nut4_40Thick = 0.086 * inch;
  29. Washer4_40OD = 0.270 * inch;
  30. Washer4_40ID = 0.123 * inch;
  31.  
  32. ID = 0;
  33. OD = 1;
  34. LENGTH = 2;
  35.  
  36. Insert = [3.9,4.6,5.8];
  37.  
  38. //- PCB sizes
  39.  
  40. PCBSize = [110.0,80.0,1.5];
  41. PCBShelf = 2.0;
  42.  
  43. Clearance = 2*[ThreadWidth,ThreadWidth,0];
  44.  
  45. WallThick = 5.0;
  46. FrameHeight = 10.0;
  47.  
  48. ScrewOffset = 0.0 + Clear4_40/2;
  49.  
  50. ScrewSites = [[-1,1],[-1,1]]; // -1/0/+1 = left/mid/right and bottom/mid/top
  51.  
  52. OAHeight = FrameHeight + Clearance[2] + PCBSize[2];
  53.  
  54. FlangeExtension = 3.0;
  55. FlangeThick = IntegerMultiple(2.0,ThreadThick);
  56. Flange = PCBSize
  57. + 2*[ScrewOffset,ScrewOffset,0]
  58. + 2*[Washer4_40OD,Washer4_40OD,0]
  59. + [2*FlangeExtension,2*FlangeExtension,(FlangeThick - PCBSize[2])]
  60. ;
  61.  
  62. echo("Flange: ",Flange);
  63. NumSides = 4*5;
  64.  
  65. WireChannel = [Flange[0],15.0,3.0 + PCBSize[2]];
  66. WireChannelOffset = [Flange[0]/2,25.0,(FrameHeight + PCBSize[2] - WireChannel[2]/2)];
  67.  
  68. //- Adjust hole diameter to make the size come out right
  69.  
  70. module PolyCyl(Dia,Height,ForceSides=0) { // based on nophead's polyholes
  71.  
  72. Sides = (ForceSides != 0) ? ForceSides : (ceil(Dia) + 2);
  73.  
  74. FixDia = Dia / cos(180/Sides);
  75.  
  76. cylinder(r=(FixDia + HoleWindage)/2,h=Height,$fn=Sides);
  77. }
  78.  
  79. //- Build it
  80.  
  81. difference() {
  82. union() { // body block
  83. translate([0,0,OAHeight/2])
  84. cube(PCBSize + Clearance + [2*WallThick,2*WallThick,FrameHeight],center=true);
  85.  
  86. for (x=[-1,1], y=[-1,1]) { // screw bosses
  87. translate([x*(PCBSize[0]/2 + ScrewOffset),
  88. y*(PCBSize[1]/2 + ScrewOffset),
  89. 0])
  90. cylinder(r=Washer4_40OD,h=OAHeight,$fn=NumSides);
  91. }
  92.  
  93. if (ClampFlange) // flange for work holder
  94. linear_extrude(height=Flange[2])
  95. hull()
  96. for (i=[-1,1], j=[-1,1]) {
  97. translate([i*(Flange[0]/2 - Washer4_40OD/2),j*(Flange[1]/2 - Washer4_40OD/2)])
  98. circle(d=Washer4_40OD,$fn=NumSides);
  99. }
  100. }
  101.  
  102. for (x=[-1,1], y=[-1,1]) { // screw position indexes
  103.  
  104. translate([x*(PCBSize[0]/2 + ScrewOffset),
  105. y*(PCBSize[1]/2 + ScrewOffset),
  106. -Protrusion])
  107. rotate(x*y*180/(2*6))
  108. PolyCyl(Clear4_40,(OAHeight + 2*Protrusion),6); // screw clearance holes
  109.  
  110. translate([x*(PCBSize[0]/2 + ScrewOffset),
  111. y*(PCBSize[1]/2 + ScrewOffset),
  112. OAHeight - PCBSize[2] - Insert[LENGTH]])
  113. rotate(x*y*180/(2*6))
  114. PolyCyl(Insert[OD],Insert[LENGTH] + Protrusion,6); // inserts
  115.  
  116. translate([x*(PCBSize[0]/2 + ScrewOffset),
  117. y*(PCBSize[1]/2 + ScrewOffset),
  118. OAHeight - PCBSize[2]])
  119. PolyCyl(1.2*Washer4_40OD,(PCBSize[2] + Protrusion),NumSides); // washers
  120. }
  121.  
  122. translate([0,0,OAHeight/2]) // through hole below PCB
  123. cube(PCBSize - 2*[PCBShelf,PCBShelf,0] + [0,0,2*OAHeight],center=true);
  124.  
  125. translate([0,0,(OAHeight - (PCBSize[2] + Clearance[2])/2 + Protrusion/2)]) // PCB pocket on top
  126. cube(PCBSize + Clearance + [0,0,Protrusion],center=true);
  127.  
  128. if (Channel)
  129. translate(WireChannelOffset) // opening for wires from bottom side
  130. cube(WireChannel + [0,0,Protrusion],center=true);
  131. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement