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: Science

If you measure something often enough, it becomes science

  • Two-Wheel Plotter

    While contemplating all the hocus-pocus and precision alignment involved in the DIY plotter project, it occurred to me you could conjure a plotter from a pair of steppers, two disks, a lifting mechanism, and not much else. The general idea resembles an Rθ plotter, with the paper glued to a turntable for the “theta” motion, but with the “radius” motion produced by pen(s) on another turntable:

    Rotary Plotter - geometry 4
    Rotary Plotter – geometry 4

    The big circle is the turntable with radius R1, which might be a touch over 4.5 inches to fit an 8.5 inch octagon cut from ordinary Letter paper. The arc with radius R2 over on the right shows the pen path from the turntable’s center to its perimeter, centered at (R1/2,-R1) for convenience.

    The grid paper represents the overall Cartesian grid containing the XY points you’d like to plot, like, for example, point Pxy in the upper right corner. The object of the game is to figure out how to rotate the turntable and pen holder to put Pxy directly under the pen at Ixy over near the right side, after which one might make a dot by lowering the pen. Drawing a continuous figure requires making very small motions between closely spaced points, using something like Bresenham’s line algorithm to generate the incremental coordinates or, for parametric curves like the SuperFormula, choosing a small parameter step size.

    After flailing around for a while, I realized this requires finding the intersections of two circles after some coordinate transformations.

    The offset between the two centers is (ΔX,ΔY) and the distance is R2 = sqrt(ΔX² + ΔY²).  The angle between the +X axis and the pen wheel is α = atan2(ΔY,ΔX), which will be negative for this layout.

    Start by transforming Pxy to polar coordinates PRθ, which produces the circle containing both Pxy and Ixy. A pen positioned at radius R from the center of the turntable will trace that circle and Ixy sits at the intersection of that circle with the pen rotating around its wheel.

    The small rectangle with sides a and b has R as its diagonal, which means a² + b² = R² and the pointy angle γ = atan a/b.

    The large triangle below that has base (R2 – a), height b, and hypotenuse R2, so (R2 – a)² + b² = R2².

    Some plug-and-chug action produces a quadratic equation that you can solve for a as shown, solve for b using the first equation, find γ from atan a/b, then subtract γ from θ to get β, the angle spearing point Ixy. You can convert Rβ back to the original grid coordinates with the usual x = R cos β and y = R sin β.

    Rotate the turntable by (θ – β) to put Pxy on the arc of the pen at Ixy.

    The angle δ lies between the center-to-center line and Ixy. Knowing all the sides of that triangle, find δ = arccos (R2 – a) / R2 and turn the pen wheel by δ to put the pen at Ixy.

    Lower the pen to make a dot.

    Done!

    Some marginal thinking …

    I’m sure there’s a fancy way to do this with, surely, matrices or quaternions, but I can handle trig.

    You could drive the steppers with a Marlin / RAMPS controller mapping between angles and linear G-Code coordinates, perhaps by choosing suitable steps-per-unit values to make the degrees (or some convenient decimal multiple / fraction thereof) correspond directly to linear distances.

    You could generate points from an equation in, say, Python on a Raspberry Pi, apply all the transformations, convert the angles to G-Code, and fire them at a Marlin controller over USB.

    Applying 16:1 microstepping to a stock 200 step/rev motor gives 0.113°/step, so at a 5 inch radius each step covers 0.01 inch. However, not all microsteps are moved equally and I expect the absolute per-step accuracy would be somewhere between OK and marginal. Most likely, given the application, even marginal accuracy wouldn’t matter in the least.

    The pen wheel uses only 60-ish degrees of the motor’s rotation, but you could mount four-ish pens around a complete wheel, apply suitable pen lift-and-lower action and get multicolor plots.

    You could gear down the steppers to get more steps per turntable revolution and way more steps per pen arc, perhaps using cheap & readily available RepRap printer GT2 pulleys / belts / shafts / bearings from the usual eBay sellers. A 16 tooth motor pulley driving a 60 tooth turntable pulley would improve the resolution by a factor of 3.75: more microsteps per commanded motion should make the actual motion come out better.

    Tucking the paper atop the turntable and under the pen wheel could be a challenge. Perhaps mounting the whole pen assembly on a tilting plate would help?

    Make all the workings visible FTW!

    Some doodles leading up to the top diagram, complete with Bad Ideas and goofs …

    Centering the pen wheel at a corner makes R2 = R1 * sqrt(2), which seems attractive, but seems overly large in retrospect:

    Rotary Plotter - geometry 1
    Rotary Plotter – geometry 1

    Centering the pen wheel at (-R1,R1/2) with a radius of R1 obviously doesn’t work out, because the arc doesn’t reach the turntable pivot, so you can’t draw anything close to the center. At least I got to work out some step sizes.

    A first attempt at coordinate transformation went nowhere:

    Rotary Plotter - geometry 2
    Rotary Plotter – geometry 2

    After perusing the geometric / triangle solution, this came closer:

    Rotary Plotter - geometry 3
    Rotary Plotter – geometry 3
  • Glass vs. Epoxy: Divot!

    The WS2812 RGB LED atop the Bowl of Fire Floodlight

    Reflector floodlight - purple phase
    Reflector floodlight – purple phase

    failed in the usual way after a bit over a year of constant use.

    I’d done an unusually good job of epoxying the ersatz heatsink in place:

    Reflector floodlight - finned LED holder
    Reflector floodlight – finned LED holder

    I wrapped the bulb in a towel with only the heatsink sticking out, whacked the side of the heatsink parallel to the glass with a plastic-face hammer, and it popped right off:

    Epoxy vs glass - divot
    Epoxy vs glass – divot

    The missing piece of the epoxy ring turned out to be a divot ripped out of the glass, which I didn’t notice until I’d chipped the fragment off the aluminum, so no pictures.

    Given the relative strengths of epoxy and glass, pulling a divot seems impossible, but folks doing 3D printing on glass platforms have been reporting exactly that failure for years. The prevailing theory seems to involve small scratches and defects in the glass surface, with subsequent weakening, and stresses applied to the epoxy perpendicular to the glass surface pulling the cracks apart.

    Replacing the RGB LED will require drilling it out and probably a complete rewiring, because I seem to have made liberal use of epoxy inside the heatsink and brass tube.

  • Pure Matte Black the Hard Way

    The best way to get a pure, non-reflective black uses optics, not pigments:

    Matte black blade edges
    Matte black blade edges

    The shiny steel blades reflect light just fine, but the reflections have no way back out of the gap between adjacent edges: the angle of reflection always points away from you and the incoming light.

    I always admire the blackness when I open that box.

    Yes, I’m a member of the Society of the Easily Amused.

  • Monthly Science: Raising a Monarch Butterfly

    A Monarch butterfly laid eggs in late July. On the 29th of July they looked like this:

    Monarch Egg - focus stacked
    Monarch Egg – focus stacked

    By August 2, a pair of caterpillars had hatched and grew to 3 mm:

    Monarch caterpillar - 3 mm - 2017-08-02
    Monarch caterpillar – 3 mm – 2017-08-02

    A day later, they were 4 mm long:

    Monarch caterpillars - 4 mm - 2017-08-03
    Monarch caterpillars – 4 mm – 2017-08-03

    They really were sort of blue-ish with green hints:

    Monarch caterpillar 1 - 4 mm - 2017-08-03
    Monarch caterpillar 1 – 4 mm – 2017-08-03

    And:

    Monarch caterpillar 2 - 4 mm - 2017-08-03
    Monarch caterpillar 2 – 4 mm – 2017-08-03

    By August 9, one had had more mature coloration:

    Monarch caterpillar - 2017-08-09
    Monarch caterpillar – 2017-08-09

    The other caterpillar had vanished; we assume it got out of the aquarium and wandered off.

    Apparently, the front end of the caterpillar (at the bottom of the picture) has a hard windshield reflecting the ring of LEDs around the camera lens. The caterpillar eats its skin after each molting, except for the windshield:

    Monarch Windshield - 2017-08-09
    Monarch Windshield – 2017-08-09

    We kept fresh milkweed branches in a vase and the caterpillar ate almost continuously:

    Monarch caterpillar - 2017-08-13
    Monarch caterpillar – 2017-08-13

    By August 15, the caterpillar was ready for the next stage in its life. At 10 in the morning it had attached itself to the screen covering the aquarium and assumed the position:

    Monarch caterpillar - starting chrysalis - 2017-08-15
    Monarch caterpillar – starting chrysalis – 2017-08-15

    It transformed into a chrysalis by 5:30 PM:

    Monarch Chrysalis - with skin
    Monarch Chrysalis – with skin

    The discarded skin remained loosely attached until I carefully removed it.

    What look like small yellow spots are actually a striking metallic gold color.

    Eleven days later, on August 26 at 9 AM, the chrysalis suddenly became transparent:

    Monarch chrysalis - ready - left
    Monarch chrysalis – ready – left

    And:

    Monarch chrysalis - ready - right
    Monarch chrysalis – ready – right

    The shape of the butterfly becomes visible in reflected light:

    Monarch chrysalis - ready - ventral detail
    Monarch chrysalis – ready – ventral detail

    The gold dots and line remained visible.

    The magic happened at 3 PM:

    Monarch chrysalis - emerging - unfolding
    Monarch chrysalis – emerging – unfolding

    The compacted wings emerge intense orange on the top and lighter orange on the bottom:

    Monarch unfolding - left
    Monarch unfolding – left

    The butterfly took most of the day to unfurl and stiffen its wings into flat plates:

    Monarch unfolding - dorsal
    Monarch unfolding – dorsal

    And:

    Monarch unfolding - right
    Monarch unfolding – right

    By 8 PM it began exploring the aquarium:

    Monarch unfolded - right
    Monarch unfolded – right

    As adults, they sip nectar from flowers, but don’t feed for the first day, so we left it in the aquarium overnight.

    At 10 AM on August 27, we transported it to the goldenrod in the garden, where it immediately began tanking operations:

    Monarch on Milkweed - left
    Monarch on Milkweed – left

    A few minutes later, it began sun-warming operations:

    Monarch on Milkweed - dorsal
    Monarch on Milkweed – dorsal

    Mary watched it while she was tending the garden and, an hour or so later, saw it take off and fly over the house in a generally southwest direction. It will cross half the continent under a geas prohibiting any other action, eventually overwinter in Mexico with far too few of its compadres, then die after producing the eggs for a generation beginning the northward journey next year.

    Godspeed, little butterfly, godspeed …

    In the spirit of “video or it didn’t happen”, there’s a 15 fps movie of the emergence taken at 5 s/image.

  • Mystery Eggs on Glass

    An array of tiny eggs appeared on the outside of our bedroom window:

    Insect eggs on glass - 2017-09-17
    Insect eggs on glass – 2017-09-17

    The patch measures 12 mm across and 14 mm tall. From across the room, it looks like a smudge, but it consists of hundreds of eggs, each on a tiny stalk glued to the glass:

    IMG_20170919 vs 0917- Insect eggs on glass
    IMG_20170919 vs 0917- Insect eggs on glass

    The bottom image is two days later than the top one, both are scaled to about the same size and contrast. The critters look about the same, although I think the lines have more prominent ripples or bumps.

    We have no idea what they’ll turn into, but they certainly look like they have two eyes and wings …

     

  • 60 kHz Tuning Fork Resonator: Maximum Overdrive

    Datasheets loosely associated with the tuning fork resonators in hand suggest 1 μW maximum drive power, which works out to maybe 100 mVrms = 150 mVpk at about 10 kΩ ESR. If you inadvertently apply 500 mVpk = 375 mVrms, the resulting 14 μW does this:

    Broken 60 kHz Tuning Fork Resonator - overview
    Broken 60 kHz Tuning Fork Resonator – overview

    I was applying a precisely tuned 60 kHz sine wave to the first pass at a crystal filter grafted onto the loop antenna preamp and wasn’t paying attention to the amplitude. For all I know, though, the poor thing died from a power-on transient. I’m pretty sure I didn’t break it during extraction, because it stopped being a resonator while in the circuit.

    The missing tine fell out of the can:

    Broken 60 kHz Tuning Fork Resonator - tine detail
    Broken 60 kHz Tuning Fork Resonator – tine detail

    Laser trim scars form a triangle near the tip, a T a bit further down, a slot just above the nicely etched gap.

    A closer look at the fractured base:

    Broken 60 kHz Tuning Fork Resonator - detail
    Broken 60 kHz Tuning Fork Resonator – detail

    The metalization appears black here and gold in person.

    So, yeah, one down and 49 to go …

  • Monthly Image: Orb-Weaving Spider

    Once again, the season of orb-weaving spiders has arrived, with this one building her web across a living room window:

    Orb Weaving Spider - with insect
    Orb Weaving Spider – with insect

    I set the Sony HDR-AS30V atop a tripod, told it to take photos at 5 second intervals, then stitched the images into a Youtube video. It won’t go viral, but watching the spider construct her web over the course of two hours was fascinating.

    She finishes the spiral at about 1 m video = 1.25 h real time, settles down for what might be a nap (it’s hard to tell with spiders), and has an insect join her for supper at 1:28, half an hour later. Spiders go from “inert” to “death incoming” almost instantly, even in real time running.

    Another orb weaver set up shop in the adjacent window, but moved out the next day. Perhaps there’s a minimum spacing requirement?

    Two more orb weavers guard windows in the kitchen and laundry room. We sometimes leave the lights on for them.

    YouTube has other web-building videos with far more detail, of course.

    The magic incantation to create the video from a directory of images in the form DSC01234.JPG:

    sn=1 ; for f in *JPG ; do printf -v dn 'dsc%04d.jpg' "$(( sn++ ))" ; mv $f $dn ; done
    ffmpeg -r 15 -i /mnt/video/2017-09-03/100MSDCF/dsc%04d.jpg -q 1 Orb-Weaving-2017-09-03.mp4