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.

Author: Ed

  • Snowthrower Shear Bolts

    The snowthrower (I’ve always called it a snowblower, but that’s just me) ate a ski pole (*), handle-tether-end first, and the right-side shear bolt worked perfectly when the right-hand auger slammed to a stop. A bit of drift punch rapping extracted the sorry lump at the bottom:

    Sheared MTD Snowthrower Bolts
    Sheared MTD Snowthrower Bolts

    The missing nut and bolt head may eventually surface, but I’m not losing any sleep over them.

    I popped a replacement shear bolt from the heap (thank you, Aitch!) and thought the nut went on rather stiffly. The nuts have a crimp in the middle to make them vibration-proof, but this one seemed stiffer than usual and, lo and behold, the bolt snapped just before I thought the nut had gotten far enough.

    The nut on the second replacement shear bolt required much less torque, didn’t (let me) snap the bolt, and I finished the mission. That’s the third or fourth shear bolt I’ve used since getting the thrower in 2007, so there’s a package of six in transit.

    Part Number 710-0809A, 5/16-18 x 1.5 inch.

    (*) One of Mary’s gardening cronies works for a sporting goods store, has access to an unlimited supply of slightly bent ski poles, and shares the bounty for use as garden stakes.

  • Raspberry Pi: Forcing VNC Display Resolution

    You can use VNC with a headless Raspberry Pi, but, absent a display with which to negotiate the screen resolution, X defaults something uselessly small: 720×480. To force a more reasonable resolution, edit /boot/config.txt and set the framebuffer size:

    framebuffer_width=1920
    framebuffer_height=1280
    

    You can use a nonstandard resolutions, as with the 1920×1280 that fits neatly on my 2560×1440 landscape monitor, but getting too weird will surely bring its own reward. When you plug in a display, X will ought to negotiate as usual for the highest resolution the display can handle.

    The System Configuration dialog has a “Resolution” button offering standard resolutions:

    RPi display resolution configuration
    RPi display resolution configuration

    The shiny RPi Pixel UI bakes the RealVNC server directly into whatever handles the startup process these days, rendering all previous recommendations about forcing VNC resolutions inoperative. I found the trick of editing the config file on StackExchange after the usual flailing around.

    Memo to Self: Remmina (the VNC client I use in XFCE on my desktop PC) doesn’t respond well to having the VNC server shut down while it’s connected. Fire up a command prompt, enter this:

    sleep 10 ; sudo reboot
    

    Then, quick like a bunny, disconnect the VNC session.

  • Blog Backup

    Recent news about Dropbox removing its Public folder feature reminded me to do my every-other-month blog backup. Wordpress provides a method to “export” the blog’s text and metadata in their XML-ish format, so you can (presumably) import your blog into another WordPress instance on the server of your choice. However, the XML file (actually, ten of ’em, all tucked into a paltry 8 MB ZIP file) does not include the media files referenced in the posts, which makes sense.

    Now, being that type of guy, I have the original media files (mostly pictures) tucked away in a wide variety of directories on the file server. The problem is that there’s no easy way to match the original file to the WordPress instance; I do not want to produce a table by hand.

    Fortunately, the entry for each blog post labels the URL of each media file with a distinct XML tag:

    		<wp:attachment_url>https://softsolder.com/wp-content/uploads/2008/12/cimg2785-blender-bearings.jpg</wp:attachment_url>
    

    Note the two leading tabs: it’s prettyprinted XML. (Also, should you see escaped characters instead of < and >, then WordPress has chewed on the source code again.)

    While I could gimmick up a script (likely in Python) to process those files, this is simple enough to succumb to a Bash-style BFH:

    grep attachment_url *xml > attach.txt
    sed 's/^.*http/http/' attach.txt | sed 's/&lt;\/wp.*//' > download.txt
    wget --no-verbose --wait=5 --random-wait --force-directories --directory-prefix=/where/I/put/WordPress/Backups/Media/ -i download.txt
    

    That fetches 6747 media files = 1.3 GB, tucks them into directories corresponding to their WordPress layout, and maintains their original file dates. I rate-limited the download to an average of 5 s/file in the hope of not being banned as a pest, so the whole backup takes the better part of ten hours.

    So I wind up blowing an extra gig of disk space on a neatly arranged set of media files that can (presumably) be readily restored to another WordPress instance, should the occasion arise.

    Memo to Self: investigate applying the -r option to the base URL, with the -N option to make it incremental, for future updates.

  • Under-cabinet Lamp Brackets: Close-fit Power Plug

    Adding a little tab to the angled brackets prevents them from pivoting while you’re tightening the mounting screw into the brass insert:

    Kitchen Light Bracket - angled lip - Slic3r preview
    Kitchen Light Bracket – angled lip – Slic3r preview

    The trick with those tabs is to chop ’em off halfway to the tip, because there’s no point trying to print a wedge that ends with a sharp edge:

    Kitchen Light Bracket - angled - tab cutoff - solid model
    Kitchen Light Bracket – angled – tab cutoff – solid model

    Generating & positioning that block goes a little something like this:

    translate([0,
               2*MountBlock[1] - LEDEndBlock[2]*sin(StripAngle),
               MountBlock[2]/2 + MountHeight - 0.5*LEDEndBlock[2]*cos(StripAngle)])
        cube(2*MountBlock,center=true);
    
    

    As a rule of thumb, there’s no point in fussing with smaller shapes when a big one will suffice…

    This LED strip fits under the cabinet over the butcher block countertop next to the stove, which turns out to be Just Barely longer than the strip itself:

    Under-cabinet light - cramped power plug
    Under-cabinet light – cramped power plug

    The OEM straight-on coaxial plug (near the bottom of the picture) attached to the wall wart cable obviously wouldn’t fit in the available space, so I gimmicked up a right-angle adapter by the simple expedient of shortening the solder lugs of a plug from the heap (which, admittedly, doesn’t quite fully seat in the socket), bending them sideways, soldering a pair of wires, heatshrinking appropriately, then coating wires + plug with JB Kwik epoxy. The other end of the wires gets a coaxial jack that miraculously fits the OEM plug, styled up with more heatshrink tubing. Not pretty, but nobody will ever see it.

    Unlike the LED strip under the other cabinet, this IR proximity sensor doesn’t mind having a wood edge next to it and, thus, didn’t need a strip of tape to keep it happy.

  • Under-cabinet Lamp Brackets: Angled Edition

    The LED strip lights have a reasonably diffuse pattern with an on-axis bright area that puts more light on the rear of the counter than seems strictly necessary. Revising the original brackets to tilt the strips moves the bright patch half a foot forward:

    Kitchen Light Bracket - angled - solid model
    Kitchen Light Bracket – angled – solid model

    For lack of anything smarter, the angle puts the diagonal of the LED strip on the level:

    Kitchen Light Bracket - angled - Slic3r preview
    Kitchen Light Bracket – angled – Slic3r preview

    The translucent block represents the strip (double-thick and double-wide), with a peg punching a hole for the threaded brass insert.

    Although the source code has an option to splice the middle blocks together, it can also build them separately:

    Kitchen Light Bracket - angled - LED block
    Kitchen Light Bracket – angled – LED block

    Turns out they’re easier to assemble that way; screw ’em to the strips, then screw the strips to the cabinet.

    I moved the deck screw holes to the other end of the block, thus putting the strips against the inside of the cabinet face. It turns out the IR sensor responds to the DC level of the reflected light, not short-term changes, which meant the reflection from the adjacent wood blinded it to anything waved below. Adding a strip of black electrical tape killed enough of the reflected light to solve that problem:

     

    Under-cabinet light - IR sensor shield
    Under-cabinet light – IR sensor shield

    The tape isn’t quite as far off-center as it looks, but I’m glad nobody will ever see it …

    The before-and-after light patterns, as viewed on B-size metric graph paper centered on the left-hand strip and aligned with the belly side of the countertop:

    Under-cabinet light - straight vs angled patterns
    Under-cabinet light – straight vs angled patterns

    Those look pretty much the same, don’t they? So much for photography as evidence for anything.

    The OpenSCAD source code as a GitHub Gist:


    // Mounting brackets for eShine under-counter LED lights
    // Ed Nisley KE4ZNU December 2016
    Layout = "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
    MountHeight = (1 + 0*3/16) * inch; // distance from cabinet bottom
    THREADOD = 0;
    HEADOD = 1;
    LENGTH = 2;
    WoodScrew = [4.0,8.3,41]; // 8×1-5/8 Deck screw
    WoodScrewRecess = 3.0;
    WoodScrewMargin = 1.5 * WoodScrew[HEADOD]; // head OD + flat ring
    Insert = [3.9,4.6,5.8 + 2.0]; // 4-40 knurled brass insert
    JoinerLength = 19.0; // joiner between strips
    LEDEndBlock = [11.0,28.8,9.5]; // LED plastic end block
    LEDScrewOffset = [1.0,8.2,0]; // hole offset from end block center point
    StripAngle = atan2(LEDEndBlock[2],LEDEndBlock[1]);
    echo(str("Strip angle: ",StripAngle));
    MountBlock = [WoodScrewMargin,(WoodScrewMargin + LEDEndBlock[1]*cos(StripAngle)),MountHeight];
    //———————-
    // 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(d=(FixDia + HoleWindage),h=Height,$fn=Sides);
    }
    //—–
    // LED end block with positive insert for subtraction
    // returned with mounting hole end of strip along X axis
    // ready for positioning & subtraction
    module EndBlock(Side = "L") {
    LSO = [((Side == "L") ? 1 : -1)*LEDScrewOffset[0],LEDScrewOffset[1],LEDScrewOffset[2]];
    rotate([-StripAngle,0,0])
    translate([0,LEDEndBlock[1]/2,LEDEndBlock[2]])
    union() {
    cube(LEDEndBlock + [LEDEndBlock[0],0,LEDEndBlock[2]],center=true);
    translate(LSO + [0,0,-(LEDEndBlock[2] + Insert[2])])
    rotate(180/6)
    PolyCyl(Insert[1],2*Insert[2],6);
    }
    }
    //—–
    // End mounting block with proper hole offsets
    module EndMount(Side = "L") {
    translate([0,0,MountBlock[2]/2])
    difference() {
    translate([0,MountBlock[1]/2,0])
    cube(MountBlock,center=true);
    translate([0,WoodScrewMargin,MountBlock[2]/2])
    EndBlock(Side);
    translate([0,WoodScrewMargin/2,-MountBlock[2]])
    rotate(180/6)
    PolyCyl(WoodScrew[THREADOD],2*MountBlock[2],6);
    translate([0,WoodScrewMargin/2,(MountBlock[2]/2 – WoodScrewRecess)])
    rotate(180/6)
    PolyCyl(WoodScrew[HEADOD],WoodScrewRecess + Protrusion,6);
    translate([((Side == "L") ? 1 : -1)*MountBlock[0]/2,3*MountBlock[1]/4,-MountBlock[2]/4])
    rotate([90,0,((Side == "L") ? 1 : -1)*90])
    translate([0,0,-2*ThreadThick])
    linear_extrude(height=4*ThreadThick,convexity=3)
    text(Side,font=":style=bold",valign="center",halign="center");
    }
    }
    module MidMount() {
    XOffset = (JoinerLength + MountBlock[0])/2;
    BridgeThick = 5.0;
    union() {
    translate([XOffset,0,0])
    EndMount("L");
    translate([0,MountBlock[1]/2,BridgeThick/2])
    cube([JoinerLength,MountBlock[1],BridgeThick] + [2*Protrusion,0,0],center=true);
    translate([-XOffset,0,0])
    EndMount("R");
    }
    }
    //———-
    // Build them
    if (Layout == "EndBlock")
    EndBlock("L");
    if (Layout == "EndMount")
    EndMount("R");
    if (Layout == "MidMount")
    MidMount();
    if (Layout == "BuildJoined") {
    translate([-(JoinerLength + 2*MountBlock[0]),0,0])
    EndMount("L");
    MidMount();
    translate([(JoinerLength + 2*MountBlock[0]),0,0])
    EndMount("R");
    }
    if (Layout == "Build") {
    translate([-MountBlock[0],0,0])
    EndMount("L");
    translate([MountBlock[0],0,0])
    EndMount("R");
    }

  • Quilt Blocks: Scan and Montage

    Mary has been working on the Splendid Sampler project, with 56 completed blocks (*) stacked on her sewing table. We agreed that those blocks would make a nice background for our Christmas Letter, but the labor involved to photograph all the fabric squares and turn them into a page seemed daunting.

    Turned out it wasn’t all that hard, at least after we eliminated all the photography and hand-editing.

    The 6½x6½ inch blocks include a ¼ inch seam allowance on all sides and, Mary being fussy about such things, they’re all just about perfect. I taped a template around one block on the scanner glass:

    Quilt block in scanner template
    Quilt block in scanner template

    Then set XSane to scan at 150 dpi and save sequentially numbered files, position a square scan area over the middle of the template, and turn off all the image enhancements to preserve a flat color balance.

    With “picture taking” reduced to laying each square face-down on the glass, closing the lid, and clicking Scan, the scanner’s throughput became the limiting factor. She scanned the blocks in the order of their release, while tinkering the auto-incremented file number across the (few) gaps in her collection, to produce 56 files with unimaginative auto-generated names along the lines of Block 19.jpg, thusly:

    Block 19
    Block 19

    The “square” images were 923×933 pixels, just slightly larger than the ideal finished size of 6 inch × 150 dpi = 900 pixel you’d expect, because we allowed a wee bit (call it 1/16 inch) on all sides to avoid cutting away the sharp points and, hey, I didn’t get the scan area exactly square.

    With the files in hand, turning them into a single page background image requires a single Imagemagick incantation:

    montage -verbose B*jpg -density 150 -geometry "171x173+0+0" -tile "7x" Page.jpg
    

    I figured the -geometry value to fill the 8 inch page width at 150 dpi, which is good enough for a subdued background image: 8 inch × 150 dpi / 7 images = 171 pixels. Imagemagick preserves the aspect ratio of the incoming images during the resize, so, because these images are slightly higher than they are wide, the height must be slightly larger to avoid thin white borders in the unused space. With all that figured, you get a 1197×1384 output image.

    Bumping the contrast makes the colors pop, even if they’re not quite photo-realistic:

    Quilt block montage - contrast
    Quilt block montage – contrast

    I’ll lighten that image to make the Christmas Letter text (in the foreground, atop the “quilt”) readable, which is all in the nature of fine tuning.

    She has 40-odd blocks to go before she can piece them together and begin quilting, with a few other projects remaining to be finished:

    Mary quilting
    Mary quilting

    (*) She’s a bit behind the block schedule, having had a year of gardening, bicycling, and other quilting projects, plus whatever else happens around here. Not a problem, as we see it.

  • Left on Maloney Rd from Rt 376: Eyes Right!

    We’re waiting for oncoming traffic to clear before making the left turn from Rt 376 onto Maloney, on our way to the rail trail:

    Maloney Rd Intersection Conflict - 2016-12-07 - waiting
    Maloney Rd Intersection Conflict – 2016-12-07 – waiting

    Traffic’s clear, we have the green, we’re turning, and the car exiting the gas station starts accelerating directly at us:

    Maloney Rd Intersection Conflict - 2016-12-07 - turning
    Maloney Rd Intersection Conflict – 2016-12-07 – turning

    Mary shouts, I jam to a stop, the driver jams to a stop, I proceed, the driver then proceeds to turn in front of the truck behind us:

    Maloney Rd Intersection Conflict - 2016-12-07 - rear view
    Maloney Rd Intersection Conflict – 2016-12-07 – rear view

    There’s no signal aimed into the gas station, so you must use your best judgement to determine when to enter the intersection. I’m not in enough of a hurry to (try to) ace out a truck, but ya never know …