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.

Category: Software

General-purpose computers doing something specific

  • Improved Cable Clips

    Those ugly square cable clips cried out for a cylindrical version:

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

    Which prompted a nice button:

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

    Which suggested the square version needed some softening:

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

    Apart from the base plate thickness, all the dimensions scale from the cable OD; I’ll be unsurprised to discover small cables don’t produce enough base area for good long-term foam tape adhesion. Maybe the base must have a minimum size or area?

    I won’t replace the ones already on the saw, but these will look better on the next project…

    The OpenSCAD source code as a GitHub Gist:

    // Cable Clips
    // Ed Nisley – KE4ZNU – October 2014
    // February 2017 – adapted for USB cables
    Layout = "Show"; // Show Build
    Style = "Button"; // Square Round Button
    //- 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
    CableOD = 3.8; // cable jacket
    Base = [4*CableOD,4*CableOD,3*ThreadThick]; // overall base and slab thickness
    CornerRadius = CableOD/2; // radius of square corners
    CornerSides = 4*4; // total sides on square corner cylinders
    NumSides = 6*3; // total sides for cylindrical base
    //– Oval clip with central passage
    module CableClip() {
    intersection() {
    if (Style == "Square")
    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] + CableOD/2,$fn=CornerSides,center=false);
    translate([0,0,Base[2] + CableOD/2])
    sphere(d=CableOD,$fn=CornerSides);
    }
    else if (Style == "Round")
    cylinder(d=Base[0],h=Base[2] + 1.00*CableOD,$fn=NumSides);
    else if (Style == "Button")
    resize(Base + [0,0,2*(Base[2] + CableOD)])
    sphere(d=Base[0],$fn=NumSides);
    union() {
    translate([0,0,Base[2]/2]) // base defines slab thickness
    cube(Base,center=true);
    for (j=[-1,1]) // retaining 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("Green",0.2)
    translate([0,0,Base[2] + CableOD/2])
    rotate([0,90,0])
    cylinder(d=CableOD,h=2*Base[0],center=true,$fn=48);
    }
    //———————-
    // Build it
    CableClip();

     

  • Blog Backup: Incremental Media

    The recipe for incrementally copying media files since the previous blog backup works like this:

    grep attachment_url *xml > attach.txt
    sed 's/^.*http/http/' attach.txt | sed 's/<\/wp.*//' > download.txt
    wget -nc -w 2 --no-verbose --random-wait --force-directories --directory-prefix=Media/ -i download.txt
    

    The -nc sets the “no clobber” option, which (paradoxically) simply avoids downloading a duplicate of an existing file. Otherwise, it’d download the file and glue on a *.1 suffix, which isn’t a desirable outcome. The myriad (thus far, 0.6 myriad) already-copied files generate a massive stream of messages along the lines of File ‘mumble’ already there; not retrieving.

    Adding --no-verbose will cut the clutter and emit some comfort messages.

    There seems no way to recursively fetch only newer media files directly from the WordPress file URL with -r -N; the site redirects the http:// requests to the base URL, which doesn’t know about bare media files and coughs up a “not found” error.

  • 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);
    }
    }
  • NESDR Mini 2+ vs. Input Terminator

    A tiny handful of known-good-quality SMA terminators arrived from eBay:

    KDI T187GS - 50 ohm 1 W SMA attenuators
    KDI T187GS – 50 ohm 1 W SMA attenuators

    They’re described as KDI Triangle T187GS SMA Female Terminator, 50Ω, 1W, 0-4GHz. A bit of searching suggests MCE (whoever they are) borged KDI quite a while ago (their website, last updated in 2003, has been lightly vandalized) and a datasheet won’t be forthcoming.

    In any event, a NooElec NESDR Mini 2+ radio connected to a dual-band VHF-UHF antenna perched near a window shows this for a local FM station:

    FM 101.5 NESDR - direct
    FM 101.5 NESDR – direct

    Zooming to 5 dB/div:

    FM 101.5 NESDR - 5 dB steps
    FM 101.5 NESDR – 5 dB steps

    Installing the terminator at the end of an MCX-to-SMA adapter cable:

    FM 101.5 NESDR - 50 ohm terminator
    FM 101.5 NESDR – 50 ohm terminator

    Haven’t a clue about those tiny little spikes with the terminator in place, but they don’t line up with any of the high-energy inputs and are, most likely, junk brewed up within the radio. That’s with the RF gain set to 49.6 dB and AGC turned off.

    The hardware looks like this:

    NESDR with SMA attenuators
    NESDR with SMA attenuators

    The MCX connector on the radio isn’t the most durable-looking thing I’ve ever seen, so strapping the adapter cable to the case seems like a Good Idea. You can get an NESDR radio with an SMA connector for about the same price, which I’d have done if were available a while ago.

    The terminated input looks to be about -75 dBFS, about 15 dB below the between-station noise, and the carrier tops out around -25 dBFS, for a “dynamic range” of 50 dB. Oddly, that’s just about dead on the maximum dynamic range you can get from the 8 bit RTL2832U demodulator / ADC stuffed inside the NESDR: 8 bits × 6 dB/bit.

    It is not obvious to me the signal from a randomly chosen (albeit powerful) FM station should exactly fill the receiver’s dynamic range, particularly without AGC riding herd on the RF gain. Some hardware tinkering seems in order.

    The GNU Radio flow graph:

    FM Broadcast - GNU Radio flow
    FM Broadcast – GNU Radio flow

     

  • Unicode Keyboard Flameout and Workaround

    For unknown reasons, probably having to do with the unmitigated disaster of trying to get an SDRPlay radio working with GNU Radio (about which, more later), Unicode keyboard input stopped working. This is not to be tolerated, because engineering notation requires a lot of Greek letters.

    Unicode support seems to be baked into the lowest levels of the Linux operating system, although it’s not clear to me whether it’s in X, QT, GTK, or somewhere else. Googling the obvious keywords was unavailing; evidently this feature never ever fails or, more likely, very few people use it to any extent.

    Note that I already have the Compose key set up, but Compose sequences don’t include Greek letters.

    After considerable flailing, I added the Simple Greek keyboard layout and defined the (otherwised unused) Menu key as the keyboard layout switcher. That’s a pretty big hammer for a rather small problem; I devoutly hope Unicode mysteriously starts working again.

    For reference, the Greek keyboard layout looks like this:

    Greek keyboard layout
    Greek keyboard layout

    I’d have put Ω on the W key, rather than V, but that’s just because so many fonts do exactly that.

  • 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);
    }