The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

Tag: Improvements

Making the world a better place, one piece at a time

  • Bandsaw Worklight: LED Cable Clips

    Adapting the sewing machine cable clips for larger USB cables:

    LED Cable Clips - solid model
    LED Cable Clips – solid model

    The calculation positioning the posts wasn’t quite right; they now touch the cable OD at their midline and converge slightly overhead to retain it.

    They’re great candidates for sequential printing:

    LED Cable Clips - Slic3r - sequential print
    LED Cable Clips – Slic3r – sequential print

    With the basement at 14 °C, any cooling is too much: the platform heater can’t keep the bed above the thermal cutout temperature, the firmware concludes the thermistor has failed, and shuts the printer off. So I popped the four finished clips off the platform, removed the skirt, unplugged the fan, rebooted that sucker, and restarted the print.

    One clip in the front keeps the cable away from the power switch and speed control directly below the gooseneck mount:

    USB Gooseneck Mount - cable clip
    USB Gooseneck Mount – cable clip

    A few clips in the back route the cable from the COB LED epoxied directly onto the bandsaw frame away from the motor enclosure:

    Bandsaw platform COB LED - cable clips
    Bandsaw platform COB LED – cable clips

    They’re mounted on double-sided foam tape. The COB LED on the frame isn’t anything to write home about, but you can see the foam tape peeking out around the clip base:

    Bandsaw platform COB LED
    Bandsaw platform COB LED

    Unlike those LED filaments, it seems you can gently bend the aluminum substrate under a COB LED.

    The bandsaw platform now has plenty of light: a fine upgrade!

    Yeah, you can buy stick-on cable anchors, but what’s the fun in that? These fit exactly, hold securely, and work just fine.

    The OpenSCAD source code as a GitHub Gist:

    // LED Cable Clips
    // Ed Nisley – KE4ZNU – October 2014
    // February 2017 – adapted for USB cables
    Layout = "Show"; // Show Build
    //- Extrusion parameters must match reality!
    ThreadThick = 0.25;
    ThreadWidth = 0.40;
    HoleWindage = 0.2; // extra clearance
    Protrusion = 0.1; // make holes end cleanly
    function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
    //———————-
    // Dimensions
    Base = [15.0,15.0,6*ThreadThick]; // base over sticky square
    CableOD = 3.8;
    BendRadius = 5.0;
    CornerRadius = Base[0]/5;
    CornerSides = 4*4;
    NumSides = 6*3;
    //– Oval clip with central passage
    module OvalPass() {
    intersection() {
    hull()
    for (i=[-1,1], j=[-1,1])
    translate([i*(Base[0]/2 – CornerRadius),j*(Base[1]/2 – CornerRadius),0])
    rotate(180/CornerSides)
    cylinder(r=CornerRadius,h=Base[2] + 1.00*CableOD,$fn=CornerSides,center=false);
    union() {
    translate([0,0,Base[2]/2]) // oversize mount base
    scale([2,2,1])
    cube(Base,center=true);
    for (j=[-1,1]) // bending ovals
    translate([0,j*(Base[1]/2 – 0.125*(Base[1] – CableOD)/2),(Base[2] – Protrusion)])
    resize([Base[0]/0.75,0,0])
    cylinder(d1=0.75*(Base[1]-CableOD),
    d2=(Base[1]-CableOD)/cos(0*180/NumSides),
    h=(CableOD + Protrusion),
    center=false,$fn=NumSides);
    }
    }
    if (Layout == "Show")
    color("Red",0.3)
    translate([0,0,Base[2] + CableOD/2])
    rotate([0,90,0])
    cylinder(d=CableOD,h=2*Base[0],center=true,$fn=48);
    }
    //———————-
    // Build it
    OvalPass();
  • Bandsaw Worklight: USB Gooseneck Mount

    The bandsaw now sports a chunky mount for its gooseneck light:

    USB Gooseneck Mount - on bandsaw
    USB Gooseneck Mount – on bandsaw

    The gooseneck ends in a USB Type-A plug, so an ordinary USB extension cable can connect it to the hacked hub supplying 9 VDC:

    USB Gooseneck Mount - interior
    USB Gooseneck Mount – interior

    The plastic came from a slightly earlier version of the solid model, with one foam pad under the gooseneck’s USB plug to soak up the clearance. The four smaller holes, with M3 brass inserts visible in the bottom half (on the right), clamp the gooseneck connector in place against the foam; you could push it out if you were really determined, but you’d have to be really determined.

    If I ever build another one, it’ll sandwich the plug between opposing pads:

    USB Gooseneck Connector Mount - Slic3r preview
    USB Gooseneck Connector Mount – Slic3r preview

    The lettering on the block stands out much better in the solid model:

    USB Gooseneck Connector Mount - solid model - overview
    USB Gooseneck Connector Mount – solid model – overview

    Obviously, I need help with the stylin’ thing. This looks better, but with terrible overhangs for printing in the obvious no-support orientation:

    USB Gooseneck Connector Mount - solid model - rounded top
    USB Gooseneck Connector Mount – solid model – rounded top

    Anyhow, the USB extension cable (on the left) has plenty of clearance and pulls straight out of the housing, so I can remove the bandsaw cover without unwiring:

    USB Gooseneck Mount - assembled
    USB Gooseneck Mount – assembled

    The LED ticks along at 40 °C in a 14 °C basement, suggesting a thermal coefficient around 14 °C/W. Even in the summer months, with the basement around 25 °C, there’s no risk of PETG softening at 50 °C.

    I’ll epoxy a similar 1.8 W COB LED onto the curve of the bandsaw frame where it can shine on the left and rear part of the table; it doesn’t even need a case.

    The OpenSCAD source code as a GitHub Gist:

    // Gooseneck lamp for MicroMark bandsaw
    // Ed Nisley KE4ZNU
    // February 2017
    Layout = "Mount"; // Mount Show Build
    Gap = 5; // distance between halves for Show
    //- 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
    Tap10_32 = 0.159 * inch;
    Clear10_32 = 0.190 * inch;
    Head10_32 = 0.373 * inch;
    Head10_32Thick = 0.110 * inch;
    Nut10_32Dia = 0.433 * inch;
    Nut10_32Thick = 0.130 * inch;
    Washer10_32OD = 0.381 * inch;
    Washer10_32ID = 0.204 * inch;
    ID = 0; // for round things
    OD = 1;
    LENGTH = 2;
    Insert = [3.0,4.9,2*ThreadThick + IntegerMultiple(4.2,ThreadThick)]; // M3 short brass insert
    CornerRadius = 5.0; // rounded mount block corners for pretty
    CornerSides = 4*4;
    RoundedTop = true; // true for fancy smooth top edges
    USBPlug = [39.0,16.0,8.3]; // plug, X from base of plug
    USBSocket = [28.0,20.0,11.5]; // USB extension, X from tip of socket
    USBMating = [-12.0,0,0]; // offset of plug base relative to block center
    Foam = [35.0,10.0,2.0 – 1.0]; // foam pad to secure USB plug (Z = thickness – compression)
    GooseneckOD = 5.0; // flexy gooseneck diameter
    MountScrewOC = 35.0; // make simple screw hole spacing for bandsaw case
    MountBlock = [10*round((USBPlug[0] + USBSocket[0] + 5.0)/10),
    10*round((MountScrewOC + Washer10_32OD + 5.0)/10),
    // 2*6*ThreadThick + IntegerMultiple(max(USBPlug[2],USBSocket[2]),ThreadThick)];
    16.0]; // thickness = 16 mm M3x0.5 button head screw
    echo(str("Block size: ",MountBlock));
    LegendDepth = 2*ThreadThick; // lettering depth
    //———————-
    // 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);
    }
    //– Mount
    module Mount() {
    difference() {
    hull()
    if (RoundedTop) {
    for (i=[-1,1], j=[-1,1])
    translate([i*(MountBlock[0]/2 – CornerRadius),j*(MountBlock[1]/2 – CornerRadius),0]) {
    translate([0,0,-MountBlock[2]/2])
    rotate(180/CornerSides)
    cylinder(r=CornerRadius,h=MountBlock[2]/2,$fn=CornerSides,center=false);
    translate([0,0,MountBlock[2]/2 – CornerRadius])
    rotate(180/CornerSides)
    sphere(r=CornerRadius,$fn=CornerSides,center=true);
    }
    }
    else {
    for (i=[-1,1], j=[-1,1])
    translate([i*(MountBlock[0]/2 – CornerRadius),j*(MountBlock[1]/2 – CornerRadius),0])
    rotate(180/CornerSides)
    cylinder(r=CornerRadius,h=MountBlock[2],$fn=CornerSides,center=true);
    }
    for (j=[-1,1]) // screws into bandsaw case
    translate([0,j*MountScrewOC/2,-(MountBlock[2]/2 + Protrusion)])
    rotate(180/8)
    PolyCyl(Clear10_32,(MountBlock[2] + 2*Protrusion),8);
    for (i=[-1,1], j=[-1,1]) { // clamp screws
    translate([i*MountBlock[0]/4,j*MountScrewOC/2,-MountBlock[2]])
    PolyCyl(Insert[ID],2*MountBlock[2],6); // clearance
    translate([i*MountBlock[0]/4,j*MountScrewOC/2,-(MountBlock[2]/2 + Protrusion)])
    PolyCyl(Insert[OD],Insert[LENGTH] + Protrusion,6); // inserts
    }
    rotate([0,90,0]) // gooseneck flexy cable
    rotate(180/6)
    PolyCyl(GooseneckOD,MountBlock[0],6);
    translate([USBPlug[0]/2,0,0] + USBMating – [Protrusion/2,0,0]) // USB plug outline
    cube(USBPlug + [Protrusion,0,0],center=true);
    translate([-USBSocket[0]/2,0,0] + USBMating) // USB socket outline
    cube(USBSocket,center=true);
    translate([(Foam[0]/2 + 5*ThreadWidth),0,-(Foam[2]/2 + USBPlug[2]/2)] + USBMating – [Protrusion,0,-Protrusion]/2) // foam padding recess
    cube(Foam + [Protrusion,0,Protrusion],center=true); // foam packing
    translate([(Foam[0]/2 + 5*ThreadWidth),0, (Foam[2]/2 + USBPlug[2]/2)] + USBMating – [Protrusion,0, Protrusion]/2) // foam padding recess
    cube(Foam + [Protrusion,0,Protrusion],center=true);
    render(convexity=5)
    translate([0,0,MountBlock[2]/2 – LegendDepth])
    linear_extrude(height=LegendDepth + Protrusion) {
    translate([0,5,0])
    text(text="KE4ZNU",size=8,spacing=1.10,font="Bitstream Vera Sans:style=Bold",valign="center",halign="center");
    translate([0,-5,0])
    text(text="4 Feb 2017",size=6,spacing=1.05,font="Bitstream Vera Sans:style=Bold",valign="center",halign="center");
    }
    }
    }
    //———————-
    // Build it
    if (Layout == "Mount") {
    Mount();
    }
    if (Layout == "Show") {
    translate([0,0,-Gap/2])
    difference() {
    Mount();
    translate([0,0,MountBlock[2]])
    cube(2*MountBlock,center=true);
    }
    translate([0,0,Gap/2])
    difference() {
    Mount();
    translate([0,0,-MountBlock[2]])
    cube(2*MountBlock,center=true);
    }
    }
    if (Layout == "Build") {
    translate([0,0.6*MountBlock[1],MountBlock[2]/2])
    difference() {
    Mount();
    translate([0,0,MountBlock[2]])
    cube(2*MountBlock,center=true);
    }
    translate([0,-0.6*MountBlock[1],MountBlock[2]/2])
    rotate([180,0,0])
    difference() {
    Mount();
    translate([0,0,-MountBlock[2]])
    cube(2*MountBlock,center=true);
    }
    }
  • Proto Board Holders: 80×120 mm

    Another stack of proto boards arrived, this time 80×120 mm, and I ran off another pair of holders:

    Proto Board Holder - 80x120 - tooling
    Proto Board Holder – 80×120 – tooling

    Not wanting to, ahem, screw around with the lathe, the screws got themselves shortened the old-fashioned way: by hand, with the screw cutter, then filed and passed through a 4-40 die to clean up the threads.

    Bah!

  • Bandsaw Worklight

    Having hacked back the end of the USB gooseneck extension, a tweak of the COB LED heatsink mount for my desk lamp produces a smaller version for a 1.8 W LED:

    Chip On Board Heatsink Mount - Bandsaw Lamp - solid model
    Chip On Board Heatsink Mount – Bandsaw Lamp – solid model

    That fits half of a random heatsink, bandsawed just to the far side of the middle fin and milled flat.

    Ream out the 5 mm hole with a #8 drill for a snug fit around the gooseneck, jam gooseneck in place, dab epoxy on the corners of the recess, mash the heatsink in place, solder wires to LED, smear epoxy on the aluminum backplate, clamp while curing:

    USB Gooseneck - LED assembly
    USB Gooseneck – LED assembly

    And it looks pretty good, if I do say so myself:

    USB Gooseneck - on bandsaw
    USB Gooseneck – on bandsaw

    The hook-n-loop tape holding the cable to the bandsaw gotta go, but should suffice until I conjure a better mount.

    The alert reader may wonder how a 9 V COB LED runs from a 5 V USB cable with nary a trace of a voltage booster to be seen. Well, that’s not really a USB cable any more; I paralleled the red+white and black+green wires for lower resistance, then hacked a 9 VDC power supply into an old USB hub:

    Hacked USB hub - PCB mods
    Hacked USB hub – PCB mods

    I ripped out the upstream USB plug, hotwired the 9 V supply where the 5 V USB wires used to be, soldered jumpers on the downstream sockets to short the outer two pin pairs together, razor-knifed the power leads going into the epoxy-blobbed USB controller, and declared victory:

    Hacked USB hub - in use
    Hacked USB hub – in use

    Admittedly, that “In Use” LED runs a bit brighter now.

    I have a few other tools on that bench in need of LED lights; when I build ’em, they can all plug into this hub. No reason to invent new connectors & cables & all that. It may need a power switch.

    Turns your stomach, eh?

    The OpenSCAD source code as a GitHub Gist:

    // 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") {
    }

     

  • Screw Cutting Fixture: Not Quite Right

    A stack of PCB proto boards arrived from halfway around the planet and, in a rare preemptive strike, I made some holders before I need them:

    PCB Protoboard - in holder
    PCB Protoboard – in holder

    That called for trimming eight 4-40 screws, so I also tried a first pass at a screw cutting fixture:

    Screw cutting fixture - 4-40 insert
    Screw cutting fixture – 4-40 insert

    That’s an ordinary 4-40 brass insert epoxied inside a drilled hole, with a snug 4-40 clearance hole on the other side.

    If I needed slightly longer screws, they’d get a jam nut on the inside, but in this case I just tightened it firmly, ran the lathe in reverse, and cut against the far side to keep the screw from working loose:

    Screw cutting fixture - in use
    Screw cutting fixture – in use

    The insert is on the left side of the fixture, just under the screw head.

    Unfortunately, my faith in epoxy bonding led me astray: there’s just not enough griptivity to lock the insert inside that drilled aluminum hole. Despite my taking sissy cuts, the cutting forces pushed the insert out of its hole. I completed the mission by cutting the last four screws by hand.

    The original idea for the fixture would have me turning the fixture from steel and tapping the screw hole. That puts a lot of labor into something that may get chewed up fairly quickly, so I wondered if a brass insert would suffice.

    Not in that orientation, it doesn’t. Putting the insert on the other side of the fixture (to the right, away from the chuck) would have the cutting forces pushing it into the fixture, which should have been obvious from the start. So it goes.

    When I must cut a larger screw, I’ll redrill that fixture, put the insert on the other side, and see how that plays.

    If I turned the fixture from steel with similar drilled similar holes, I could braze / silver solder the insert into the hole: that would prevent it from turning, even if the jam nut wasn’t quite up to the task.

  • Kenmore 158 Foot Pedal: Fine Tuning

    After a week of use, Mary decided the single additional graphite disk in each stack produced a too-high initial speed when the sewing machine started up; this being a matter of how it feels injects some of trial-and-error into the repair.

    Shaving a graphite disk down from 0.8 to 0.4 mm seemed entirely too messy, so I snipped squares from 0.40 mm = 16 mil brass shim stock, nibbled the edges into a polygon, and filed the resulting vertexes to produce a (rough) circle:

    Kenmore 158 Foot Pedal - 0.40 mm brass shims
    Kenmore 158 Foot Pedal – 0.40 mm brass shims

    Each stack looks like this:

    • 1.5 mm graphite disk (double-thick)
    • 0.30 mm brass (original part)
    • 0.79 mm graphite disk
    • 0.40 brass (new part)
    • The rest of the stack

    Protip: dump those shards onto a strip of wide masking tape, fold gently until it’s all corners, and drop in the trash. Otherwise, you’ll pull those things out of your shoes and fingers for months…

    You can get cheaper nibbling tools nowadays; I’ve had mine for decades.

  • 60 kHz Preamp: Board Holder

    A cleaned up version of my trusty circuit board holder now keeps the 60 kHz preamp off what passes for a floor in the attic:

    Preamp in attic
    Preamp in attic

    The solid model became slightly taller than before, due to a serious tangle of wiring below the board, with a narrower flange that fits just as well in the benchtop gripper:

    Proto Board - 80x110
    Proto Board – 80×110

    Tidy brass inserts epoxied in the corners replace the previous raw screw holes in the plastic:

    Proto Board Holder - 4-40 inserts and screws
    Proto Board Holder – 4-40 inserts and screws

    The screws standing on their heads have washers epoxied in place, although that’s certainly not necessary; the dab of left-over epoxy called out for something. The screws got cut down to 7 mm after curing.

    The preamp attaches to a lumpy circle of loop antenna hung from the rafters and returns reasonable results:

    WWVB - morning - 2017-01-16
    WWVB – morning – 2017-01-16

    The OpenSCAD source code as a GitHub Gist:

    // Test support frame for proto boards
    // Ed Nisley KE4ZNU – Jan 2017
    ClampFlange = true;
    Channel = false;
    //- Extrusion parameters – must match reality!
    ThreadThick = 0.25;
    ThreadWidth = 0.40;
    function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
    Protrusion = 0.1;
    HoleWindage = 0.2;
    //- Screw sizes
    inch = 25.4;
    Tap4_40 = 0.089 * inch;
    Clear4_40 = 0.110 * inch;
    Head4_40 = 0.211 * inch;
    Head4_40Thick = 0.065 * inch;
    Nut4_40Dia = 0.228 * inch;
    Nut4_40Thick = 0.086 * inch;
    Washer4_40OD = 0.270 * inch;
    Washer4_40ID = 0.123 * inch;
    ID = 0;
    OD = 1;
    LENGTH = 2;
    Insert = [3.9,4.6,5.8];
    //- PCB sizes
    PCBSize = [110.0,80.0,1.5];
    PCBShelf = 2.0;
    Clearance = 2*[ThreadWidth,ThreadWidth,0];
    WallThick = 5.0;
    FrameHeight = 10.0;
    ScrewOffset = 0.0 + Clear4_40/2;
    ScrewSites = [[-1,1],[-1,1]]; // -1/0/+1 = left/mid/right and bottom/mid/top
    OAHeight = FrameHeight + Clearance[2] + PCBSize[2];
    FlangeExtension = 3.0;
    FlangeThick = IntegerMultiple(2.0,ThreadThick);
    Flange = PCBSize
    + 2*[ScrewOffset,ScrewOffset,0]
    + 2*[Washer4_40OD,Washer4_40OD,0]
    + [2*FlangeExtension,2*FlangeExtension,(FlangeThick – PCBSize[2])]
    ;
    echo("Flange: ",Flange);
    NumSides = 4*5;
    WireChannel = [Flange[0],15.0,3.0 + PCBSize[2]];
    WireChannelOffset = [Flange[0]/2,25.0,(FrameHeight + PCBSize[2] – WireChannel[2]/2)];
    //- Adjust hole diameter to make the size come out right
    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() { // body block
    translate([0,0,OAHeight/2])
    cube(PCBSize + Clearance + [2*WallThick,2*WallThick,FrameHeight],center=true);
    for (x=[-1,1], y=[-1,1]) { // screw bosses
    translate([x*(PCBSize[0]/2 + ScrewOffset),
    y*(PCBSize[1]/2 + ScrewOffset),
    0])
    cylinder(r=Washer4_40OD,h=OAHeight,$fn=NumSides);
    }
    if (ClampFlange) // flange for work holder
    linear_extrude(height=Flange[2])
    hull()
    for (i=[-1,1], j=[-1,1]) {
    translate([i*(Flange[0]/2 – Washer4_40OD/2),j*(Flange[1]/2 – Washer4_40OD/2)])
    circle(d=Washer4_40OD,$fn=NumSides);
    }
    }
    for (x=[-1,1], y=[-1,1]) { // screw position indexes
    translate([x*(PCBSize[0]/2 + ScrewOffset),
    y*(PCBSize[1]/2 + ScrewOffset),
    -Protrusion])
    rotate(x*y*180/(2*6))
    PolyCyl(Clear4_40,(OAHeight + 2*Protrusion),6); // screw clearance holes
    translate([x*(PCBSize[0]/2 + ScrewOffset),
    y*(PCBSize[1]/2 + ScrewOffset),
    OAHeight – PCBSize[2] – Insert[LENGTH]])
    rotate(x*y*180/(2*6))
    PolyCyl(Insert[OD],Insert[LENGTH] + Protrusion,6); // inserts
    translate([x*(PCBSize[0]/2 + ScrewOffset),
    y*(PCBSize[1]/2 + ScrewOffset),
    OAHeight – PCBSize[2]])
    PolyCyl(1.2*Washer4_40OD,(PCBSize[2] + Protrusion),NumSides); // washers
    }
    translate([0,0,OAHeight/2]) // through hole below PCB
    cube(PCBSize – 2*[PCBShelf,PCBShelf,0] + [0,0,2*OAHeight],center=true);
    translate([0,0,(OAHeight – (PCBSize[2] + Clearance[2])/2 + Protrusion/2)]) // PCB pocket on top
    cube(PCBSize + Clearance + [0,0,Protrusion],center=true);
    if (Channel)
    translate(WireChannelOffset) // opening for wires from bottom side
    cube(WireChannel + [0,0,Protrusion],center=true);
    }