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

  • Tiny Turtle Teleportation: Rail Trail

    This little critter was chugging across the Dutchess Rail Trail near the ponds north of Page Industrial Park, so I stopped to lend a hand:

    Tiny Turtle Dorsal - Rail Trail - 2018-05-23
    Tiny Turtle Dorsal – Rail Trail – 2018-05-23

    The plastron looked like a brightly colored jewel:

    Tiny Turtle Ventral - Rail Trail - 2018-05-23
    Tiny Turtle Ventral – Rail Trail – 2018-05-23

    Perhaps plastrons start out with all the pigment they’ll ever have, then fade from bright orange to yellow-brown as they spread out.

    If you’re not paying attention, you’d think “pebble” or “dog turd”. Neither of which you should ride over, of course, but … teleporting a tiny turtle to the drainage ditch on the far side seemed to increase the world’s net happiness.

    The pix are tight crops from the AS30V’s 170° FOV images, which means they’re way grittier than you’d expect from a “full HD” image.

  • Monthly Science: Water Bottle Refill Stations

    The O’Neill Center at WCSU has two sets of drinking fountains:

    Water bottle refill stations
    Water bottle refill stations

    The bottle shape on the back of each fountain marks the sensor for its water bottle refill spout. The small rectangular block above and right of the sensor is a virtue signalling display giving the number of disposable bottles allegedly not consigned to a landfill.

    The left fountain:

    Water bottle refill station - left
    Water bottle refill station – left

    The center fountain:

    Water bottle refill station - center
    Water bottle refill station – center

    The right fountain:

    Water bottle refill station - right
    Water bottle refill station – right

    Which looked exactly like either a test pattern or a failed display, until I waved my hand over the senor and watched it increment to 00008889. Timing is everything!

    The other trio of fountains had the same progression, so it must be a chirality thing.

    I can’t say whether you should use the left fountain to avoid some germs or the right fountain for the freshest water. Not having to maneuver our bottle under the usual arch from a drinking nozzle was a big win, though, so mad props to ’em.

  • Siglent SDS2304X Screen Shot File

    Poking the Print button on the front of the Siglent SDS2304X scope saves the screen to a BMP file (in the /BMP directory) on a USB flash drive plugged into its front-panel port:

    Siglent SDS2304X Front Panel - Print Button - USB port
    Siglent SDS2304X Front Panel – Print Button – USB port

    Which produces files like these:

    ll --block-size=1 /path-to-USB-stick/BMP/
    total 2318336
    drwxr-xr-x 2 ed ed    4096 May 23 13:13 ./
    drwxr-xr-x 4 ed ed    4096 Dec 31  1969 ../
    -rw-r--r-- 1 ed ed 1152054 May 23 13:13 SDS00001.BMP
    -rw-r--r-- 1 ed ed 1152054 May 23 13:13 SDS00002.BMP
    

    The files are 1152054 bytes long, as specified by the BMP header inside the file:

    hexdump -C /path-to-USB-stick/BMP/SDS00001.BMP | head
    00000000  42 4d 36 94 11 00 00 00  00 00 36 00 00 00 28 00  |BM6.......6...(.|
    00000010  00 00 20 03 00 00 e0 01  00 00 01 00 18 00 00 00  |.. .............|
    00000020  00 00 00 94 11 00 00 00  00 00 00 00 00 00 00 00  |................|
    00000030  00 00 00 00 00 00 01 01  01 01 01 01 01 01 01 01  |................|
    00000040  01 01 01 01 01 01 01 01  01 01 01 01 01 01 01 01  |................|
    *
    00000880  01 01 01 01 01 01 01 01  01 01 01 01 01 01 1e 1e  |................|
    00000890  1e 1e 1e 1e 1e 1e 1e 1e  1e 1e 1e 1e 1e 1e 1e 1e  |................|
    *
    00000990  1e 1e 1e 1e 1e 1e 01 01  01 01 01 01 01 01 01 01  |................|
    

    The first 14 bytes contain the Bitmap file header, with the file size in Little-Endian order in the four bytes at offset +0x02: 0x00119436 = 1152054.

    The four bytes at offset +0x0A give the offset of the pixel data: +0x36. That’s the series of 0x01 bytes in the fourth row. Unlike most images, BMP pixel arrays start at the lower left corner of the image and proceed rightward / upward to the last pixel at the upper right corner.

    The data between the Bitmap file header and the start of the pixel data contains at least a Device Independent Bitmap header, identified by its length in the first four bytes at offset +0x0E. In this case, the length of 0x28 = 40 bytes makes it a Windows (no surprise) header.

    The two bytes at +1C give the bits-per-pixel value: 0x18 = 24 = 3 bytes/pixel, so parse the pixels in RGB order.

    The four bytes at +0x12 give the bitmap width in pixels: 0x320 = 800. Each pixel row must be a multiple of 4 bytes long, which works out fine at 2400 bytes.

    The tail end of the file shows one dark pixel at the upper right:

    hexdump -C /path-to-USB-stick/BMP/SDS00001.BMP | tail
    00118330  00 cc 00 00 cc 00 00 cc  00 00 cc 00 00 cc 00 00  |................|
    00118340  cc 00 00 cc 00 00 cc 00  00 cc 00 00 cc 00 00 cc  |................|
    00118350  00 00 cc 00 00 cc 00 00  cc 0f 0f 75 1e 1e 1e 1e  |...........u....|
    00118360  1e 1e 1e 1e 1e 1e 1e 1e  1e 1e 1e 1e 1e 1e 1e 1e  |................|
    *
    00118ad0  1e 1e 1e 01 01 01 1e 1e  1e 1e 1e 1e 1e 1e 1e 1e  |................|
    00118ae0  1e 1e 1e 1e 1e 1e 1e 1e  1e 1e 1e 1e 1e 1e 1e 1e  |................|
    *
    00119430  1e 1e 1e 01 01 01                                 |......|
    

    Which looks like this, expanded by a factor of eight (clicky for more dots to reveal the situation):

    Screenshot - upper right corner - 8x expansion
    Screenshot – upper right corner – 8x expansion

    The scope can also transfer a screenshot over the network:

    lxi screenshot -a 192.168.1.42 /tmp/lxi-shot.bmp 
    Loaded siglent-sds screenshot plugin
    Saved screenshot image to /tmp/lxi-shot.bmp
    

    Which has the same header:

    hexdump -C /tmp/lxi.bmp | head
    00000000  42 4d 36 94 11 00 00 00  00 00 36 00 00 00 28 00  |BM6.......6...(.|
    00000010  00 00 20 03 00 00 e0 01  00 00 01 00 18 00 00 00  |.. .............|
    00000020  00 00 00 94 11 00 00 00  00 00 00 00 00 00 00 00  |................|
    00000030  00 00 00 00 00 00 01 01  01 01 01 01 01 01 01 01  |................|
    00000040  01 01 01 01 01 01 01 01  01 01 01 01 01 01 01 01  |................|
    *
    00000880  01 01 01 01 01 01 01 01  01 01 01 01 01 01 1e 1e  |................|
    00000890  1e 1e 1e 1e 1e 1e 1e 1e  1e 1e 1e 1e 1e 1e 1e 1e  |................|
    *
    00000990  1e 1e 1e 1e 1e 1e 01 01  01 01 01 01 01 01 01 01  |................|
    

    But the resulting file is three bytes = one pixel (!) too large:

    ll --block-size=1 /tmp/lxi.bmp
    -rw-rw-r-- 1 ed ed 1152057 May 23 19:09 /tmp/lxi.bmp
    

    The tail end of the file:

    hexdump -C /tmp/lxi.bmp | tail
    00118330  00 cc 00 00 cc 00 00 cc  00 00 cc 00 00 cc 00 00  |................|
    00118340  cc 00 00 cc 00 00 cc 00  00 cc 00 00 cc 00 00 cc  |................|
    00118350  00 00 cc 00 00 cc 00 00  cc 0f 0f 75 1e 1e 1e 1e  |...........u....|
    00118360  1e 1e 1e 1e 1e 1e 1e 1e  1e 1e 1e 1e 1e 1e 1e 1e  |................|
    *
    00118ad0  1e 1e 1e 01 01 01 1e 1e  1e 1e 1e 1e 1e 1e 1e 1e  |................|
    00118ae0  1e 1e 1e 1e 1e 1e 1e 1e  1e 1e 1e 1e 1e 1e 1e 1e  |................|
    *
    00119430  1e 1e 1e 01 01 01 01 01  0a                       |.........|
    

    Because the file header doesn’t include those three bytes, they don’t go into the image and the resulting screenshot is visually the same.

    Which looks like a picket-fence error, doesn’t it? I’d lay long odds the erroneous loop runs from 0 to NUMPIXELS, rather than 0 to NUMPIXELS-1. Raise your hand if you’ve ever made that exact mistake.

    I have no practical way to determine whether the error is inside the scope or the LXI network code, but given Siglent’s overall attention to software fit-and-finish, I suspect the former.

    One can convert BMP files to the much more compact PNG format:

    convert /tmp/lxi.bmp /tmp/lxi.png
    convert: length and filesize do not match `/tmp/lxi.bmp' @ warning/bmp.c/ReadBMPImage/829.
    

    Yes. Yes, there is a mismatch.

    The space savings is impressive, particularly in light of PNG being a lossless format:

    ll /tmp/lxi.*
    -rw-rw-r-- 1 ed ed 1.1M May 23 19:09 /tmp/lxi.bmp
    -rw-rw-r-- 1 ed ed  14K May 23 19:17 /tmp/lxi.png
    

    You can eliminate the nag by truncating the file:

    truncate --size=1152054 /tmp/lxi.bmp
    

    One could wrap it all up in a script:

    #!/bin/bash
    lxi screenshot -a 192.168.1.42 /tmp/"$1".bmp
    truncate --size=1152054 /tmp/"$1".bmp
    convert /tmp/"$1".bmp "$1".png
    echo Screenshot: "$1".png

    And then It Just Works:

    getsds2304x.sh "Test Shot Starfish"
    Loaded siglent-sds screenshot plugin
    Saved screenshot image to /tmp/Test Shot Starfish.bmp
    Screenshot: Test Shot Starfish.png
    
    Test Shot Starfish
    Test Shot Starfish

    SpaceX uses Test Shot Starfish tracks for pre-launch background music; the actual test shot was spectacular.

  • LXI-Tools for Siglent SDS2304X Oscilloscope and SDM3045X Multimeter

    For whatever reason, my Siglent SDS2304X Oscilloscope and SDM3045X Multimeter partially implement their documented command sets through partial implementations of the VXI instrumentation driver network protocol. The Linux command-line side comes from lxi-tools, which one must fetch from its repository and compile from source(do liblxi first, then lxi-tools)  through the usual ./configure - make - sudo make install process, after tediously installing whatever dependencies might be revealed by incremental progress through the configuration(s) on your system(s).

    The alternative, of course, is Labview on Windows.

    The SDS2304X scope doesn’t respond to the LXI discover broadcast, so you must know and specify its IP address in the command. It’s easiest to configure the Siglent instruments at fixed IP addresses and be done with it:

    lxi scpi -a 192.168.1.41 "*idn?"
    Siglent Technologies,SDM3045X,SDM34whatever,5.01.01.03
    lxi scpi -a 192.168.1.42 "*idn?"
    *IDN SIGLENT,SDS2304X,SDS2Xwhatever,1.2.2.2 R10
    

    Although the LXI tools also come in a Snap package, installing them that way prevents storing files outside the user’s home directory; having evolved a fairly extensive NFS filesystem, Snaps seem basically useless for my purposes. I don’t see much more security exposure from downloading and running a Snap than from downloading, compiling, and running the source code, but they obviously know what’s best for me.

  • Turtle Teleportation: Vassar Road

    As always, we knew this wouldn’t end well for the small lump just in front of the car’s rear wheel (clicky for more, albeit fuzzy, dots):

    Turtle 0134 - Vassar Rd - 2018-05-20
    Turtle 0134 – Vassar Rd – 2018-05-20

    So I stopped to lend a hand:

    Turtle 1280 - Vassar Rd - 2018-05-20
    Turtle 1280 – Vassar Rd – 2018-05-20

    A fumbling hand, as it turned out, on the turtle’s slippery shell:

    Turtle 1364 - Vassar Rd - 2018-05-20
    Turtle 1364 – Vassar Rd – 2018-05-20

    A belly-up turtle in the middle of the road knows the solution to the Halting Problem.

    I hoped a secluded spot under a pine tree was closer to its destination:

    Turtle 1724 - Vassar Rd - 2018-05-20
    Turtle 1724 – Vassar Rd – 2018-05-20

    However, if the turtle is a female in search of an egg-laying site, then she and all her progeny must cross Vassar Road in the other direction to reach the Mighty Wappinger Creek.

    We’ll teleport them if we see them, too …

  • MPCNC: Relocated Camera

    The original camera position put it close to the MPCNC’s DW660 spindle:

    MPCNC - original camera location
    MPCNC – original camera location

    Unfortunately, it sat slightly too close to the gantry roller along the X-axis for comfort.

    The effort required to pry the mount off its hot-melt glue bed showed it wasn’t ever going to shake loose, so I fired up the glue gun and stuck it to a better spot on the XY assembly:

    MPCNC - relocated camera - front view
    MPCNC – relocated camera – front view

    Seen from the side:

    MPCNC - relocated camera - side view
    MPCNC – relocated camera – side view

    Bonus: it’s now trivially easy to tweak the locking screw!

    Realigning the camera and recalibrating its offset proceeded as before.

  • Zeiss Ikon Ikoflash 4

    A flash gun is hard to beat for straight-up nostalgia:

    Zeiss Ikon Ikoblitz 4 - box
    Zeiss Ikon Ikoblitz 4 – box

    This Zeiss Ikon Ikoblitz 4 is in fine shape:

    Zeiss Ikon Ikoblitz 4 - front
    Zeiss Ikon Ikoblitz 4 – front

    And no more grubby than one might expect after all those decades:

    Zeiss Ikon Ikoblitz 4 - back
    Zeiss Ikon Ikoblitz 4 – back

    I distinctly remember Flash Guide Numbers:

    Zeiss Ikon Ikoblitz 4 - guide-number calculator
    Zeiss Ikon Ikoblitz 4 – guide-number calculator

    The red dial scale has the Guide Numbers (aperture × feet) and the lower black dial scale gives the lens apertures. The manual doesn’t mention the black figures above the red Guide Numbers; they’re metric Guide Number (aperture × meters), which would have been obvious back in the day.

    The tidy shell slides off when you release a latch in the back:

    Zeiss Ikon Ikoblitz 4 - front - stowed
    Zeiss Ikon Ikoblitz 4 – front – stowed

    Then the reflector unfurls:

    Zeiss Ikon Ikoblitz 4 - front unfurled
    Zeiss Ikon Ikoblitz 4 – front unfurled

    Mirabile dictu, the previous owner removed the 15 V “hearing aid” battery (Eveready 504, 60 mA·h in the 504A alkaline version) before storing the flash, leaving the contacts in pristine condition:

    Zeiss Ikon Ikoblitz 4 - CR123A test fit
    Zeiss Ikon Ikoblitz 4 – CR123A test fit

    A 3 V CR123A primary lithium cell snaps perfectly into the battery holder, which I define as a Good Omen: a dab of circuitry could turn this into self-powered and highly attractive Art. This would be one of the very few applications well-suited for the coldest blue-white LEDs.

    One could adapt an A23 12 V alkaline battery (33 mA·h) to the holder, at the cost of half the capacity.

    The silver shield just to the left of the battery conceals a 250 μF (!) nonpolarized capacitor.

    One could build a bayonet-base (GE #5 / Press 25) adapter or poke a doodad with a 9 mm cylindrical base into the M2 bulb adapter (unrelated to my M2 printer):

    Zeiss Ikon Ikoblitz 4 - bulb adapter
    Zeiss Ikon Ikoblitz 4 – bulb adapter

    Herewith, the Zeiss Ikon Ikoblitz 4 – Instruction Manual, should you need more details.

    This hardware may be a progenitor of Gibson’s vat-grown Zeiss Ikon eyes.