Created
June 24, 2016 22:29
-
-
Save ednisley/0f1621de311ec334c484141b21e9b8f2 to your computer and use it in GitHub Desktop.
OpenSCAD source code: Knob for LittleMachineShop 5200 Mini-lathe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tweakage for LMS Mini-Lathe cover | |
// Ed Nisley - KE4ZNU - June 2016 | |
Layout = "Shaft"; // Knob Shim Shaft | |
use <knurledFinishLib_v2.scad> | |
//- Extrusion parameters must match reality! | |
// Print with 2 shells and 3 solid layers | |
ThreadThick = 0.20; | |
ThreadWidth = 0.40; | |
HoleWindage = 0.3; // extra clearance to improve hex socket fit | |
Protrusion = 0.1; // make holes end cleanly | |
inch = 25.4; | |
//---------------------- | |
// Dimensions | |
//- Knobs for cover screws | |
HeadDia = 8.5; // un-knurled section diameter | |
HeadRecess = 2.0; // ... length inside cover surface + some clearance | |
SocketDia = 4.0; // hex key size | |
SocketDepth = 10.0; | |
KnurlLen = 15.0; // length of knurled section | |
KnurlDia = 20.0; // ... diameter at midline of knurl diamonds | |
KnurlDPNom = 12; // Nominal diametral pitch = (# diamonds) / (OD inches) | |
DiamondDepth = 1.5; // ... depth of diamonds | |
DiamondAspect = 4; // length to width ratio | |
KnurlID = KnurlDia - DiamondDepth; // dia at bottom of knurl | |
NumDiamonds = ceil(KnurlDPNom * KnurlID / inch); | |
echo(str("Num diamonds: ",NumDiamonds)); | |
NumSides = 4*NumDiamonds; // 4 facets per diamond | |
KnurlDP = NumDiamonds / (KnurlID / inch); // actual DP | |
echo(str("DP Nom: ",KnurlDPNom," actual: ",KnurlDP)); | |
DiamondWidth = (KnurlID * PI) / NumDiamonds; | |
DiamondLenNom = DiamondAspect * DiamondWidth; // nominal diamond length | |
DiamondLength = KnurlLen / round(KnurlLen/DiamondLenNom); // ... actual | |
TaperLength = 0*DiamondLength; | |
//- Shim to support cover | |
CoverTopThick = 2.0; | |
ShimThick = 10.0; | |
ShimCornerRadius = 2.0; | |
ShimPoints = [[0,0],[60,0],[60,(13.5 - CoverTopThick)],[0,(14.5 - CoverTopThick)]]; | |
//- Shaft extension to keep crap out of the change gear train | |
ID = 0; | |
OD = 1; | |
LENGTH = 2; | |
Shaft = [24.0,30.0,41.0]; // ID=through, OD=thread OD, Length = cover to nut seat | |
ShaftThreadLength = 3.0; | |
ShaftSides = 6*4; | |
ShaftNut = [45,50,16]; // recess around shaft nut, OD = outside of cover | |
Insert = [3.5,5.0,8.0]; // 3 mm threaded insert | |
NumCoverHoles = 3; | |
CoverHole = [Insert[OD],35.0,12.0]; // ID = insert, OD = BCD, LENGTH = screw hole depth | |
ShaftPoints = [ | |
[Shaft[ID]/2,0], | |
[ShaftNut[OD]/2,0], | |
[ShaftNut[OD]/2,Shaft[LENGTH]], | |
[ShaftNut[ID]/2,Shaft[LENGTH]], | |
[ShaftNut[ID]/2,Shaft[LENGTH] - ShaftNut[LENGTH]], | |
[Shaft[OD]/2, Shaft[LENGTH] - ShaftNut[LENGTH]], | |
[Shaft[OD]/2, Shaft[LENGTH] - ShaftNut[LENGTH] - ShaftThreadLength], | |
[Shaft[ID]/2, Shaft[LENGTH] - ShaftNut[LENGTH] - ShaftThreadLength], | |
]; | |
//---------------------- | |
// Useful routines | |
module PolyCyl(Dia,Height,ForceSides=0) { // based on nophead's polyholes | |
Sides = (ForceSides != 0) ? ForceSides : (ceil(Dia) + 2); | |
FixDia = Dia / cos(180/Sides); | |
cylinder(r=(FixDia + HoleWindage)/2, | |
h=Height, | |
$fn=Sides); | |
} | |
//- Build things | |
if (Layout == "Knob") | |
difference() { | |
union() { | |
render(convexity=10) | |
translate([0,0,TaperLength]) // knurled cylinder | |
knurl(k_cyl_hg=KnurlLen, | |
k_cyl_od=KnurlDia, | |
knurl_wd=DiamondWidth, | |
knurl_hg=DiamondLength, | |
knurl_dp=DiamondDepth, | |
e_smooth=DiamondLength/2); | |
color("Orange") // lower tapered cap | |
cylinder(r1=HeadDia/2, | |
r2=(KnurlDia - DiamondDepth)/2, | |
h=(TaperLength + Protrusion), | |
$fn=NumSides); | |
color("Orange") // upper tapered cap | |
translate([0,0,(TaperLength + KnurlLen - Protrusion)]) | |
cylinder(r2=HeadDia/2, | |
r1=(KnurlDia - DiamondDepth)/2, | |
h=(TaperLength + Protrusion), | |
$fn=NumSides); | |
color("Moccasin") // cylindrical extension | |
translate([0,0,(2*TaperLength + KnurlLen - Protrusion)]) | |
cylinder(r=HeadDia/2,h=(HeadRecess + Protrusion),$fn=NumSides); | |
} | |
translate([0,0,(2*TaperLength + KnurlLen + HeadRecess - SocketDepth + Protrusion)]) | |
PolyCyl(SocketDia,(SocketDepth + Protrusion),6); // hex key socket | |
} | |
if (Layout == "Shim") | |
linear_extrude(height=(ShimThick)) // overall flange around edges | |
polygon(points=ShimPoints); | |
if (Layout == "Shaft") | |
difference() { | |
rotate_extrude($fn=ShaftSides,convexity=5) | |
polygon(points=ShaftPoints); | |
for (i=[0:NumCoverHoles-1]) | |
rotate(i*360/NumCoverHoles) | |
translate([CoverHole[OD]/2,0,-Protrusion]) | |
rotate(180/8) | |
PolyCyl(Insert[OD],15,8); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More on my blog at http://wp.me/poZKh-5WT