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

  • Same Content, Different Theme: Redux

    This theme (Rubric) seems less glaring than Shocking Blue Green, it’s flexible-width, and the fonts seem fine.

    A bit heavy on the Javascript that nails that gradient to the screen. Ain’t it amazing how software eats up all the performance of the hardware?

    Heck, it even has a customized header image!

  • Bad Gas!

    No, not that kind!

    Over the last several years, more or less coincident with the switch from MTBE to ethanol, all of my small internal-combustion engines have stopped working with stored gasoline, even when it’s treated with StaBil, even for just a few months.

    After plenty of putzing around, pouring in fresh gasoline has solved the problem in every engine.

    For example, I’d left the snow thrower’s tank empty after tracking down the bad gas problem in 2007. I filled it with gas from about November when we did the last of the leaf shredding; I think I’d dosed it with Sta-Bil, but in any event that’s relatively young gas by my standards.

    The blower didn’t even cough when I leaned on the starter button; not a single pop. I fired a dose of starting fluid up its snout and it still didn’t fire. At all. Period. As a friend puts it, starting fluid should wake the dead.

    Pulled the plug, blew compressed air into the cylinder to dry it out, went out for a can of New Gas, drained the Old Gas, filled the tank, and it fired right up. Surges a bit at idle with no choke, but I can deal with that.

    Lessons learned:

    • You cannot store ethanol-treated New Gas for more than a month or maybe two, tops, at least for use in small engines.
    • Sta-Bil doesn’t work on New Gas. I’d love to be proven wrong, but this whole bad running thing began with well-treated gasoline stored in a closed container.
    • There is no longer any way to have an emergency gasoline stash on hand so you don’t have to go out in the FFC (that’s Freezing obscene-gerund Cold) dawn for a fresh tank.

    Even with fresh gas, the engines surge under light load, which is a classic symptom of an air leak around the carburetor: lean running. But in all the engines? And with no detectable leaks? Even after replacing the gaskets?

    As nearly as I can tell, the problem stems from the 10% ethanol added as an oxygenate. The additional oxygen reduces pollution in modern engines, but causes small engines (at least the ones without electronic mixture control, which are all of mine) to run very very lean.

    The cheap solution seems to be setting the engine at about 1/3 choke for normal running. That richens the mixture enough to make the engine happy, but without farting black smoke out the muffler.

    Although I no longer keep a 5-gallon can of gas for emergencies (which I’m sure will come back to haunt me one of these days), I do keep a gallon with dose of StaBil for the yard equipment.

    Update: As of late-Feb 2009, that entire Cornell website has been dead since I posted the link. If it never comes up again or the link stays broken, here’s the punchline. The link pointed you to their evaluation of Cherokee Trail Of Tears beans, with this review from someone with *cough* experience:

    This is my favorite dry bean for black bean soup. It’s not called “Trail of Tears” for nothing. If you walk behind someone who’s eaten a mess of these beans, your eyes will be burning. It’s a very gassy bean.

    This Internet thing isn’t ready for prime time; stuff just softly and suddenly vanishes away.

    Update 2: Cornell is back online again. It seems their servers got pwned… after their desktops got infected. But, eh, they’re running Windows, what do they expect?

  • Transformer Parameter Extraction & BH Curve Plotting

    In addition to building a Spice model for a transformer, it’s also important to know whether the core can support the flux generated by the primary winding. This is similar to the inductor problem I mentioned there.

    Small HV transformer with test winding
    Small HV transformer with test winding

    Measure the core’s area and path length. One  can reasonably expect all cores to have hard metric measurements these days: Yankees set those calipers to millimeters and get over it. Besides, you need metric units for everything that follows.

    This transformer has two E-shaped core halves, so the center leg (the one with the windings on it) has twice the area of the outside legs, which are 7 mm thick and 5 mm wide. The central leg is twice that width: 10 mm.

    Figure the stacking factor for a ferrite core is, oh, say, 0.9, making the effective core are:

    Ac = 0.9 · 7 · 10 = 63 mm^2 = 0.63 cm^2

    You need cm^2 here to get gauss later on.

    The core is square, 30 mm on each side. Divide it in half, right down the middle of the center leg, then figure the mean path length around the middle of that rectangle:

    MPL = 2 · (30 – 5) + 2 · (15 – 5) = 70 mm = 7 cm

    Again, you need cm here to get oerstead down below.

    Put a few turns Nt of fine wire around the core, outside all the other windings. This particular transformer has three small imperfections where the varnish / sealant didn’t quite bridge from the bobbin to the outer core legs, so I managed to sneak 20 turns of wire through the holes. Call this the test winding: Nt = 20.

    Incidentally, that’s why you should always buy at least three units from surplus outlets: one to sacrifice, one to use, and one for a spare. I usually get five of anything.

    Connect the transformer primary to a signal generator & oscilloscope Channel 1, connect the test winding to Channel 2, set the channels to maybe 100 mV/div. Set the signal generator for sine wave at maybe 1 kHz, crank on a few hundred millivolts, then read RMS voltages from both channels: Chan 1 = Vp, Chan 2 = Vt.

    Knowing Vp and Vt and the number of turns Nt in the just-added extra winding, find the number of primary turns Np:

    Vp / Vt = Np / Nt

    136 / 40 = Np / 20

    So Np = 68

    Repeat that exercise, stuffing voltage into the transformer’s actual secondary winding (the HV winding):

    4000 / 46 = Ns / 20

    So Ns = 1739

    Comfortingly, the turns ratio works out to what you’d expect from the voltage ratio measured while extracting those pi model parameters:

    N = Np / Ns = 68 / 1739 = 0.039 = 1/25.6

    (You may want the turns ratio as Ns/Np = 25.6. Either will work if you make the appropriate adjustments in the equations.)

    Having measured the primary inductance as about 15 mH, the reactance at 60 Hz is:

    5.6 Ω = 2 · π · 60 ·15e-3

    So it’s reasonable to use a 100 mΩ current sensing resistor.

    Plug a 6 VAC (not DC!) wall wart into the Variac and wire it to the primary through the resistor. Connect the oscilloscope X axis across the resistor, set the gain to maybe 10 mV/division.

    Connect a 220 kΩ resistor in series with a 1 μF non-polarized capacitor, connect that to the normal HV secondary winding, connect the Y axis across the capacitor, set it for maybe 50 mV/div.

    The capacitor voltage is the integral of the secondary voltage, scaled by 1/RC. The RC combination has a time constant of 220 ms, far longer than the 16.7 ms power-line period, so it’s a decent integrator.

    Small HV transformer BH curve
    Small HV transformer BH curve

    Fire up the scope, set it for XY display, turn on the Variac, slowly crank up the voltage, and see something like this on the scope:

    Tweak the offsets so the middle of the curve passes through the center of the graticule, maybe turn on the bandwidth limiting filters, adjust the gains as needed, then measure the point at the upper right at the end of the straightest section in the middle.

    That point, as marked by the cursors, is more or less:

    X = 6.5 mV

    Y = 100 mV

    Now plug all those numbers into the equations and turn the crank…

    The magnetizing force H in oersteads:

    H = (0.4 · π · Np · Ip) / MPL = (0.4 ·3.14 · 68 · Ip) / 7

    H = 12.2 · Ip

    Because the 100 mΩ current sensing resistor scales the current by 10 A/V, the scope X-axis calibration is:

    H = 122 · Vsense

    The core flux density B in gauss (noting that the turns is Ns and converting the peak Vcap voltage to RMS):

    B =(0.707 · Vcap) · (R · C · 10^8) / (Ns · Ac) = Vcap · (220e3 ·1e-6 ·1e8) / (1739 · 0.63)

    B = 14e3 · Vcap

    Finally, at that point where the cursors meet in the upper right part of the curve:

    H = 122 · 6.5e-3 = 0.8 Oe

    B = 14e3 · 0.1 = 1400 G

    Assuming there’s a straight line from the origin to that point (which is close to the truth), the B/H ratio gives the slope of the line and, thus, the core’s permeability:

    µ = B / H = 1400 / 0.8 = 1700

    It’s allegedly a ferrite core, so that’s in the right ballpark given the rough-and-ready approximations in the measurements.

    The answer to the key question comes right off the scope without any fancy math, though. Just beyond the upper-right point the BH curve becomes horizontal, which means the slope is zero, which means the core is saturated, which means the circuit stops working.

    Sooo, the maximum value of the primary current is pretty nearly:

    Imax = 6.5 mV ·10 A/V = 65 mA

    My back of the envelope for the high-voltage DC supply is that a peak of 30 mA will pretty much do the trick, so I’m in good shape. Might be a bit higher during startup, but it’ll sort itself out in short order.

    Whew!

    Correction: I did a total arithmetic faceplant in the previous version. I think this is now correct, but you should always cross-check anything you find on the InterWeb, fer shure!

  • A Thorough Job of Hard Drive Data Destruction

    Scrubbed hard drive platters
    Scrubbed hard drive platters

    What’s wrong with this picture?

    A friend rides herd on a college data center and reports that one of the hot spares in a drive array started complaining about errors. By the time he got to it, things had gone from bad to worse to worst: the drive was spinning, but its data was gone.

    He removed all the head frippery before giving me the carcass, but the platters are exacty as they were when he ripped through those “Warranty Void If Removed” stickers.

    Even though disk platters are now made of glass in order to achieve adequate flatness tolerances, you’re not supposed to be able to see through the things. There’s a bare millimeter of untouched plating on the inner and outer rims; everything else is finely ground glass.

    Evidently the drive suffered a head crash or some part of the plating peeled off, after which the debris acted as grinding compound under the heads on the rest of the platters. Eventually the internal filters clogged and the ensuing dust storm scrubbed the glass platters clean.

    He said the inside of the drive was filled with impalpable silvery dust. Another friend deadpanned “Oh, so all the data was still in the drive, right?

    We decided that sorting all those dust grains into the right order would tax even Iranian “students”.

    More than you likely want to know about hard drive platters resides there.

  • Vanquishing the Power Vampires

    Every gadget comes with its own battery charger wall wart, every single one of which dissipates a watt or two even when it’s not charging. Add ’em up, multiply by $2 per watt per year (check your electric bill; that’s closer than you think!), and realize that you could afford some nice new tools just by unplugging the things between charges.

    But that’s too much trouble and, really, AC outlets aren’t meant for that many mate/unmate cycles. I had one contact fall loose inside a power strip a while ago and the carnage was spectacular.

    What to do?

    Recharging Corner
    Recharging Corner

    Find an otherwise unoccupied flat spot (or build a shelf near an outlet), buy two or three Power Squid adapters (you don’t need surge suppression for this assignment, so get ’em on sale cheap), plug all your chargers into the Squids, and turn everything off with a single switch when you’re not charging anything.

    Bonus: You certainly have some low duty cycle power tools that always have dead batteries when you need them. Plug ’em into the Squid you use most often for other batteries. That way, they’ll get a boost whenever you charge something else, which should keep ’em up to speed.

    I set this tangle up before Power Squids existed, so I just plugged a bunch of Y-splitters into an ordinary power strip. It makes for a fearsome tangle of cords, but at least it’s out of the way atop the never-sufficiently-to-be-damned radon air exchanger in the basement.

  • Finding Transformer Pi Model Parameters

    Given a random transformer, create a decent Spice model… I have to do this rarely enough that I’d better write it down so it’s easy to find. There’s no magic here; it’s all described in ON Semi (nee Motorola) App Note AN-1679/D. See page 4 for the grisly details; I’ve reordered things a bit here.

    Go to the basement lab and measure:

    1. Primary & secondary voltages with a sine-wave input: Vp & Vs.
    2. Primary inductance with secondary open: Lps(open)
    3. Primary inductance with secondary shorted: Lps(short)
    4. DC resistance of primary & secondary: Rp & Rs

    Then return to the Comfy Chair and calculate:

    1. Turns ratio N = Vp/Vs.
    2. Coupling coefficent k = sqrt(1 – Lps(short)/Lps(open))
    3. Primary leakage inductance LI1 = (1 – k) · Lps(open)
    4. Secondary leakage inductance LI2 = (1 – k) · Lps(open) / N^2
    5. Magnetizing inductance Lm = k · Lps(open)

    To wit…

    A quick trip to the basement lab produces these numbers for this small high-voltage transformer:

    Small HV Transformer
    Small HV Transformer
    Primary Secondary
    Voltage 1.08 27.32
    DC resistance 2.03 349
    L other open 15.5 mH 9.68 H
    L other short 45.0 uH 31.3 mH

    You don’t actually need the secondary inductances, but while you have the meter out, you may as well write those down, too. Maybe someday you’ll use the transformer backwards?

    And a session with the calculator produces a Spice model:

    1. N = 1.076 / 27.32 = 0.0394
    2. k = sqrt(1 – 45.0 uH / 15.5 mH) = 0.998
    3. LI1 = (1 – 0.998) ·15.5 mH = 22.5 uH
    4. LI2 = (1 – 0.998) ·15.5 mH / 0.0394^2 = 20.0 mH
    5. Lm = 0.998 ·15.5 mH = 15.48 mH

    Note: the value of (1 – k) is the small difference of two nearly equal numbers, so you wind up with a bunch of significant figures that might not be all that significant. The values of LI1 and LI2 depend strongly on how many figures you carry in the calculations; if you don’t get the same numbers I did, that’s probably why.

    The coupled inductors L1 & L2 form an ideal transformer with a primary inductance L1 chosen so that its reactance is large with respect to anything else. I picked L1 = 1 H here, which is probably excessive.

    The coupling coefficient would be 1.0 if that were allowed in the Spice model, but it’s not, so use 0.9999. Notice that this is not the k you find from the real transformer: it’s as close to 1.0 as you can get. [Update: either I was mistaken about 1.0 not being allowed or something’s changed in a recent release; 1.0 works fine now.]

    Spice transformer pi model
    Spice transformer pi model

    The primary inductance and turns ratio determine the secondary inductance according to:

    Vp / Vs = N = sqrt(L1 / L2)

    So:

    L2 = L1 / (N^2) = 1 / 0.0394^2 = 644 H (!)

    The models for LI1 and LI2 include the DC resistance, so that’s not visible in the schematic.

    And now you can model a high-voltage DC supply…

    Memo to Self: It’s G16821 from Electronic Goldmine

    • Primary on pins 2 & 10
    • HV secondary on pin 8 & flying wire
    • Electrostatic shield on pin 3

    Note: You can compute the turns ratio either way, as long as you keep your wits about you. With any luck, I’ve done so… but always verify what you read!

  • KDE Window Behavior Tweakage

    My mother does email and not much else, so I set up her PC to power on in the morning, shut down in the evening, sign her in automatically, fire up Kontact (which starts in Kmail mode), and (oh by the way) let me do remote admin via SSH from 250 miles away.

    Works like a champ.

    I’ve tweaked the KDE Window Behavior settings for Kontact so that it runs full-screen (with no border), thus eliminating a bunch of clutter and many opportunities for things to go wrong. To do this, click the small icon on the far left of the window’s title bar and select Configure Window Behavior.

    You can also fire up System Settings -> Window Behavior -> Window-Specific Settings, then use the Detect button to load the window ID stuff from the window you’re tweaking. Then select

    • Geometry tab, Fullscreen -> Force -> checkmark

    This differs in some subtle ways, which I don’t understand, from the combination of

    • Geometry tab: Maximize horizontally -> Force -> checkmark
    • Geometry tab: Maximize vertically -> Force -> checkmark
    • Preferences tab: No Border -> Force -> checkmark

    Remember this magic keystroke: Alt-F3. This pops up the same menu you get from the small icon in the far left of the title bar, which just ain’t there for borderless windows. You can also wade through System Settings, but Alt-F3 is faster.

    I also set the Kontact Composer (why not Komposer?) window to behave the same way, so that the only obvious way out is to either send the message or close the window using the toolbar icons.

    Now, I wanted to set up Firefox similarly and it looked like it should work fine.

    Alas, there’s a non-obvious interaction with new windows triggered by Javascript. If they’re the sort of pesky windows that suppress the Firefox menu & tab bar, then there’s no way out unless you happen to remember Ctrl-W or Alt-F4 will close the current window. Maybe you know that and use it every day, but it’s not reasonable to expect my mother to remember such trivia.

    So I set up Firefox thusly:

    • Geometry tab: Maximize horizontally -> Force -> checkmark
    • Geometry tab: Maximize vertically -> Force -> checkmark

    By not selecting the No Border option, Firefox and all its subsequent pop-ups fill the screen, but each window also has a normal border with the all-important Close button in the upper-right corner. Thus (desired) popups, like video players, can be killed when they’re done, even if they lack a separate Close This Window option.

    Yes, Firefox is running Adblock Plus and all the usual extensions…