Instantly share code, notes, and snippets.

Embed
What would you like to do?
OpenSCAD source code: COB LED heatsink mount for Micromark bandsaw
// Chip-on-board LED light heatsink mount for desk lamp
// Ed Nisley KE4ZNU December 2015
// February 2017 - rectangular COB, smaller heatsink
Layout = "Show"; // Show Build
//- Extrusion parameters must match reality!
ThreadThick = 0.25;
ThreadWidth = 0.40;
HoleWindage = 0.2;
Protrusion = 0.1; // make holes end cleanly
inch = 25.4;
function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
//----------------------
// Dimensions
ID = 0; // for round things
OD = 1;
LENGTH = 2;
Gooseneck = [3.0,5.0,15.0]; // anchor for end of gooseneck
COB = [30.0,11.0,2.5]; // Chip-on-board LED module
Heatsink = [37.1,19.2,10.0]; // overall
HeatsinkBase = 2.0; // solid base below fins
HSLip = 1.0; // width of lip under heatsink
BaseMargin = 2*2*ThreadWidth;
BaseRadius = 3*ThreadThick + Gooseneck[OD]/2; // defines slab thickness
BaseSides = 2*4;
Base = [(Gooseneck[LENGTH] + Gooseneck[OD] + Heatsink[0] + 2*BaseRadius + BaseMargin),
(Heatsink[1] + 2*BaseRadius + 2*BaseMargin),
2*BaseRadius];
echo(str("Slab thickness: ",Base[2]));
//----------------------
// 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);
}
//-- Lamp heatsink mount
module Lamp() {
difference() {
translate([(Base[0]/2 - BaseRadius - Gooseneck[LENGTH]),0,0])
hull()
for (i=[-1,1], j=[-1,1])
translate([i*(Base[0]/2 - BaseRadius),j*(Base[1]/2 - BaseRadius),Base[2]/2])
sphere(r=BaseRadius/cos(180/BaseSides),$fn=BaseSides);
translate([(Heatsink[0]/2 + Gooseneck[OD]), // main heatsink recess
0,
(Base[2] + Heatsink[2]/2 - HeatsinkBase)])
cube((Heatsink + [HoleWindage,HoleWindage,0.0]),center=true);
translate([(Heatsink[0]/2 + Gooseneck[OD]),0,HeatsinkBase]) // lower lip to shade lamp module
scale([1,1,2])
cube(Heatsink - [2*HSLip,2*HSLip,0],center=true);
translate([0,0,Base[2]/2]) // goooseneck insertion
rotate([0,-90,0]) rotate(180/8)
PolyCyl(Gooseneck[OD],Base[0],8);
translate([0,0,Base[2]/2 + Gooseneck[ID]/2]) // wire exit
rotate([180,0,0])
PolyCyl(Gooseneck[ID],Base[2],6);
translate([Gooseneck[OD],0,(Base[2] - HeatsinkBase - Protrusion)/2]) // wire slot
rotate([180,0,0])
cube([2*Gooseneck[OD],Gooseneck[ID],(Base[2] - HeatsinkBase + Protrusion)],center=true);
}
}
//----------------------
// Build it
if (Layout == "Show") {
Lamp();
}
if (Layout == "Build") {
}
@ednisley

This comment has been minimized.

Owner

ednisley commented Feb 3, 2017

More details on my blog at http://wp.me/poZKh-6tK

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