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

  • ID3 Tagging From File Names

    The Forester can play MP3 files from a USB flash drive and, given the utter craptitude of radio stations around here, I dumped a bunch of CD tracks onto a drive. For historic reasons, very few of the tracks had ID3 tags, so the Forester’s display showed only gnarly file names for the last few years.

    This burst of Bash line noise runs through the directory of album directories, extracts the relevant information from the directory and track names, then pops the tags in place:

    for d in * ; do for f in $(ls $d) ; do art=$(echo $d | cut -d- -f1 | tr '_' ' ' | sed 's/-/ - /g') ; alb=$(echo $d | cut --complement -d- -f1 | tr '_' ' ' | sed 's/-/ - /g') ; t=$(echo $f | cut -d- -f1) ; s=$(echo ${f%.*} | cut --complement -d- -f1 | tr '_' ' ' | sed 's/-/ - /g') ; id3tag -2 -a"$art" -A"$alb" -s"$s" -t$t $d/$f ; done ; done

    It’s (marginally) easier to see this way:

    for d in * ; do 
     for f in $(ls $d) ; do 
      art=$(echo $d | cut -d- -f1 | tr '_' ' ' | sed 's/-/ - /g')
      alb=$(echo $d | cut --complement -d- -f1 | tr '_' ' ' | sed 's/-/ - /g')
      t=$(echo $f | cut -d- -f1)
      s=$(echo ${f%.*} | cut --complement -d- -f1 | tr '_' ' ' | sed 's/-/ - /g')
      id3tag -2 -a"$art" -A"$alb" -s"$s" -t$t $d/$f
     done
    done

    What’s going on:

    • cut – extracts track number and song title
    • tr – convert underscores to spaces
    • sed – put spaces around hyphens

    The id3tag program can install either ID3V1 or ID3V2 tags on each pass, so I just recalled the command, edited the -1 to -2, and ran the whole mess again.

    After a bit of manual cleanup, things looked pretty good.

    Although the id3ren program seemed as though it could do the trick, it’s really intended to rename files from existing tags. Making it go the other way rapidly became a steel-cage death match; I gave up.

  • Manjaro Linux VNC Setup

    I installed the XFCE flavor of Manjaro Linux (beside Win 8.1 Pro) on a new-to-me Dell Latitude 7250 serving as our new Token Windows box and carry-along-able Linux laptop.

    Manjaro being an offshoot of Arch, they have plenty of guides and references, with How to Set up X11VNC Server being most useful at the moment. This box needs only a VNC server and apparently works with ‑xdamage for faster updates.

    With the laptop plugged into an external display and Manjaro set up to use both displays, the X11VNC server feeds both to the client with the proper positioning, producing a truly panoramic, albeit scaled, view:

    WinFlip - X11VNC dual screen
    WinFlip – X11VNC dual screen

    TightVNC on Windows does much the same thing, although (AFAICT) Windows doesn’t allow different background pictures on the two screens; that’s irrelevant to my mmmm use case.

  • Monthly Image: Spider vs. Marmorated Stink Bug

    Fortunately, Brown Marmorated Stink Bugs haven’t been as catastrophic as predicted when they arrived a few years ago, perhaps because native critters have learned to deal with them:

    Spider vs. Marmorated Stink Bug
    Spider vs. Marmorated Stink Bug

    Looks like a week’s worth of spider chow!

  • Pride Lift Chair Control Dimming

    For reasons not relevant here, we recently decontaminated a second lift chair, this one in bariatric size (so it doesn’t suffer from fuzz-shaving struts) with a six-switch control pod:

    Pride lift chair control - dimmed LEDs
    Pride lift chair control – dimmed LEDs

    The green LED-lit buttons were so bright I took it apart to see what could be done; the picture shows the considerably dimmed result.

    Start by prying outward on the tab at the USB charging port:

    Pride lift chair control - USB port latch
    Pride lift chair control – USB port latch

    Done right, you can then release the latches along the sides:

    Pride lift chair control - side opened
    Pride lift chair control – side opened

    It’s impossible to photograph the PCB with the LEDs active, but here’s what it looks like without power:

    Pride lift chair control - PCB overview
    Pride lift chair control – PCB overview

    The eight (!) SMD LEDs align with light pipes around the switch openings:

    Pride lift chair control - button keys
    Pride lift chair control – button keys

    The black dots come from Sharpie ink daubed in the shallow recesses intended to nestle around the LEDs. Note that the four switch caps have unique keying, so you can’t put them back incorrectly without some effort.

    While we’re inside, here’s a closer look at the cable entry point, just in case I must replace the industrial-strength coily cord:

    Pride lift chair control - cable entry
    Pride lift chair control – cable entry

    Unfortunately, it has a five-conductor cable, so a cheap phone coily cord (remember when phones had coily cords?) won’t suffice.

    The PCB sports a pair of PICs, one of which seems to handle the buttons. I betcha the cable dates back to the days of hard-wired power switches, with the PIC now handling the intricate logic of deciding which motors to actuate for each function, then controlling MOSFETs as fake switch contacts.

    The other PIC snuggles against the USB interface, which the manual describes as a charging-only port. It might also serve as a programming interface for the main PIC; admittedly the notion of a firmware upgrade for a lift chair seems far-fetched.

    Reassembly is in reverse order with a resounding snap at the conclusion. It works fine and you (well, I) can now look at the control pod without sunglasses.

  • CNC 3018-Pro: HD and CD Fixtures

    I actually had this in mind when I laid out the hard drive and CD engraving fixtures:

    CNC 3018-Pro - HD and CD fixtures
    CNC 3018-Pro – HD and CD fixtures

    The fixtures are centered at X±70.0 mm / Y=0.0 from the G54 workspace coordinate origin dead-center in the middle of the platform, with G55 centered on the HD fixture to the left and G56 on the CD fixture to the right.

    So the engraving workflow amounts to homing the CNC 3018 when I turn it on, taping a platter in a fixture, selecting the corresponding WCS, loading a suitable G-Code file, and firing it off. It seems bCNC returns to G54 after completing the file, so verifying the WCS selection every time is Very Good Practice.

    The friable lacquer coating on some CDs fills my world with glitter whenever I engrave a pattern on their label side. I didn’t plan on a dust shoe for this thing!

  • Makergear M2: Octopi Camera Mount

    Octopirint / Octopi works wonderfully well as a controller / G-Code feeder for my Makergear M2. After putting up with an ungainly mass of tape for far too long, I printed Toddman’s Pi Camera Mount:

    Pi Camera - M2 Mount - Slic3r
    Pi Camera – M2 Mount – Slic3r

    Which snapped together exactly like it should:

    Makergear M2 - Pi Camera Mount
    Makergear M2 – Pi Camera Mount

    A strip of double-sided foam tape attaches it to the Pi’s case, which is Velcro-ed to the M2’s frame. The cable may be too long, but avoids sharp bends on the way out of the case.

    The whole lashup works fine:

    Pi Camera - M2 Mount - Octopi timelapse
    Pi Camera – M2 Mount – Octopi timelapse

    That’s a second set intended for the CNC 3018-Pro, but it didn’t fit quite as well. The B brackets are slightly too long (or their pivots are slightly too close to their base) to allow the C plates to turn 90° to the mount:

    Pi Camera - M2 Mount - Config 2 diagram
    Pi Camera – M2 Mount – Config 2 diagram

    Nothing one can’t fix with nibbling & filing, but I long for parametric designs …

  • Alead Telecoil Receiver: Magnetic Field Check

    I got an Alead / Nolan HearLinks (many adjectives) Telecoil receiver to boost my ability to hear music & presentations at Vassar, because they recently slotted telecoil loops into the floors of their public venues. It took a few concerts to get the appropriate volume setting, after which I wondered how sensitive the receiver was:

    Alead T-coil receiver - test setup
    Alead T-coil receiver – test setup

    The small T in the upper right corner marks the receiving coil location, with the coil oriented parallel to the body’s long axis. It’s the secondary winding of an air-core transformer with a single-turn (perhaps using Litz wire) primary embedded in the floor, with the induced voltage obeying the usual transformer equation:

    V = 2π µ₀ µr N A f H cos θ

    Definitions:

    • µ₀ – vacuum permeability = 4π×10-7 H/m
    • µr – relative permeability
    • N – number of turns
    • A – receiver loop area, m²
    • f – signal frequency, Hz
    • H – magnetomotive force, A/m
    • θ – angle between windings

    For a given installation and receiver position, pretty much everything is fixed, with the voltage depending only on the H field caused by the primary winding current.

    The induced voltage is linearly dependent on the frequency, but the transmitter equalization filters apparently flatten the spectrum to get equal receiver amplitude between about 100 Hz and 5 kHz.

    The coil in that picture has nine turns, with four passing through the Tek current probe. Applying 10 mVpp to the winding produces a corresponding current:

    JDS6600 10mVpp 1 kHz - 4 turns - 1 mA-div
    JDS6600 10mVpp 1 kHz – 4 turns – 1 mA-div

    The scope sees 14 mVpp = 1.4 div at 1 mA/div = 1.4 mA. Dividing by 4 turns means the coil actually carryes 350 µA. The signal generator has a 50 Ω output impedance, so 10 mV should produce about 200 µA, which seems a bit low. On the other paw, the signal generator sees the coil as a dead short at 1 kHz, so I don’t trust the numbers.

    Whatever magnetic flux it may be produces a 1 kHz tone at a somewhat higher volume (for the same receiver setting) than the fancy Vassar loops, so the flux is in the right ballpark. With a bit more attention to detail, perhaps I can tinker up a current-mode loop drive amplifier.

    The Alead receiver has an internally generated tick audible at the audio volume I need for the Vassar loops, which is 5 to 7 steps down from the maximum volume at 15 steps. It seems related to the internal Bluetooth hardware, although it’s present even when the receiver is not paired with my Pixel phone and, in fact, is unchanged even when 100 feet from the nearest electronic device.

    When I reported the problem, they said:

    Yes, you can hear very minor tick sound on telecoil mode. It is caused by some electronic and current to make those tick sound. Sorry for this defective on the design.

    It had one job that it doesn’t do well, so it’s on the way back for a refund.

    Evidently, I must build an audio loop receiver to get what I want …