Skip to content

Instantly share code, notes, and snippets.

@ednisley
Created September 3, 2023 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ednisley/4f88a186fe1c310d58e240c8aeda2864 to your computer and use it in GitHub Desktop.
Save ednisley/4f88a186fe1c310d58e240c8aeda2864 to your computer and use it in GitHub Desktop.
OpenSCAD source code: Pin wrench for laser cutter mirror retaining ring
// OMTech laser cutter mirror pin wrench
// Ed Nisley - KE4ZNU - August 2023
// From https://www.thingiverse.com/thing:4146258
use <knurledFinishLib_v2_1.scad>
/* [Hidden] */
ThreadThick = 0.20;
ThreadWidth = 0.40;
HoleWindage = 0.2; // extra clearance
Protrusion = 0.1; // make holes end cleanly
inch = 25.4;
//----------------------
// Dimensions
/* [Knob] */
PinDia = 2.4; // pin diameter
PinOC = 20.5; // … on-center spacing
PinDepth = 10.0; // … hole depth
LocDia = 14.5; // central stud
LocLength = 3.0;
ShaftDia = 26.0; // un-knurled section diameter
ShaftLength = 15.0; // ... length
KnurlDia = 30.0; // diameter at midline of knurl diamonds
KnurlLen = 20.0; // ... length of knurled section
/* [Hidden] */
KnurlDPNom = 32; // Nominal diametral pitch = (# diamonds) / (OD inches)
DiamondDepth = 0.5; // ... depth of diamonds
DiamondAspect = 2; // 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.75*DiamondLength;
KnobOAL = ShaftLength + KnurlLen + 2*TaperLength;
//----------------------
// 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 it
difference() {
union() {
render(convexity=10)
translate([0,0,TaperLength])
knurl(k_cyl_hg=KnurlLen,
k_cyl_od=KnurlDia,
knurl_wd=DiamondWidth,
knurl_hg=DiamondLength,
knurl_dp=DiamondDepth,
e_smooth=DiamondLength/2);
color("Orange")
cylinder(r1=ShaftDia/2,
r2=(KnurlDia - DiamondDepth)/2,
h=(TaperLength + Protrusion),
$fn=NumSides);
color("Orange")
translate([0,0,(TaperLength + KnurlLen - Protrusion)])
cylinder(r2=ShaftDia/2,
r1=(KnurlDia - DiamondDepth)/2,
h=(TaperLength + Protrusion),
$fn=NumSides);
color("Moccasin")
translate([0,0,(2*TaperLength + KnurlLen - Protrusion)])
cylinder(r=ShaftDia/2,h=(ShaftLength + Protrusion),$fn=NumSides);
color("Brown")
translate([0,0,KnobOAL - Protrusion])
cylinder(r=LocDia/2,h=(LocLength + Protrusion),$fn=NumSides);
}
for (i=[-1,1])
translate([i*PinOC/2,0,KnobOAL - PinDepth])
rotate(180/6)
PolyCyl(PinDia,PinDepth + Protrusion,6);
}
@ednisley
Copy link
Author

ednisley commented Sep 3, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment