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

  • Inkjet Refilling: Economics of the Empire

    A year ago I bought an Epson R380 printer along with a $10 piece-of-crap digital camera for 90 bucks, then got a $75 rebate. I figure the printer cost 15 bucks and the camera was free.

    cimg2863-continuous-ink-for-epson-r380
    Continuous inking system for Epson R380 printer

    I also bought a $55 continuous flow ink system from a place that no longer sells them. Turns out that Epson won a patent lawsuit that forced most of those vendors out of the reinking business and made the remaining systems staggeringly expensive.

    Well, maybe not.

    I print a bunch of text (I hate reading long documents on the screen), plenty of schematics & diagrams, low-quality pictures (webbish junk), relatively few photo-quality pictures, and the Annual Christmas Letter. The printer spends an inordinate amount of time blowing its nose and clearing its throat at the start of each session, so I suspect most of the ink goes directly into the diaper inside the printer.

    Genuine Epson 78-series cartridges contain 11 ml of ink and cost $20: $1.80 / ml or, in US terms, $2k per quart. In the last year, I’ve used about 200 ml of black and 110 ml of each of the five colors: $360 + 5 * $200 = $1360, if I were stupid enough to pay full price for 68 cartridges.

    That makes the $150-ish I actually paid for seven 8-ounce (250 ml) bottles of ink a downright bargain: $0.09 / ml.

    No, the color isn’t the same as the Epson inks and I’m certain it won’t last as long on the page, but that’s not what I’m using this printer for. When I need long-lasting, high-quality prints, I send ’em to an online service… which right now is running a sale on 4×6″ prints at $0.09 each. What’s not to like?

    When I hear printer companies boast about how ecological their printers are, I say bad things. If they wanted to be green, they’d make it trivially easy to connect bulk-ink tanks to their printers.

    I’ll put up with a few colorful spots on my fingers and the occasional sploosh on the table to save that much coin o’ the realm…

  • Kubuntu Remote Desktop via SSH Tunnel

    In the process of setting up a new PC for my mother, I finally figured out how to get remote desktop sharing in Kubuntu Hardy working. You’d think the bog-standard (and default) krfb would work, but it crashed every time. Come to find out, after much searching, the solution boils down to this…

    Shoot krfb in the head, use vnc4server and x11vnc.

    Use synaptic or apt-get to install those and all their dependencies on the remote machine (i.e., the one that will become my mother’s PC). While you’re at it, uninstall krfb: good riddance.

    Run vncpasswd and feed in an appropriate password that you’ll use to authorize yourself to the vnc session.

    Log out, restart X (with Ctrl-Alt-Backspace, perhaps), log back in again to get all the X11 infrastructure up to speed.

    On your local machine (i.e., mine), use SSH to sign in to the remote box:

    ssh -p unusual-port -L 5900:localhost:5900 remote.PC.ip.addr

    The -L creates a tunnel from your local machine’s port 5900 to the remote machine’s port 5900, through the authorized SSH session.

    I use an unusual port because running SSH on port 22 on an internet-facing machine (even behind a firewall router) is just plain dumb. I doubt the unusual port provides much protection, but it should shake off a few script kiddies.

    [Update: Just in case you regard shared-key authorization and a nonstandard port as evidence of clinical paranoia, read that. One of the comments notes that using a nonstandard port gets rid of all the low-speed zombies…]

    Incidentally, the firewall router must forward the unusual port directly to the PC’s local IP address, which requires a bit of tweakage all by itself; that depends on which router you have. Word to the wise: do not use DHCP to get the PC’s IP address. Think about it.

    That PC is also set up with my RSA keys, so that the kiddies can’t brute-force a username / password login attack. And, yes, I regenerated the keys after the Debian goof.

    This is still on my LAN, so I use a dotted quad IP address (being too lazy to tweak /etc/hosts for a temporary machine), but you can use the host name maintained by DynDNS or their ilk for a truly remote box. See this post for the straight dope on making that work.

    Then fire up a remote-desktop client like, for example, krdc on your local PC, with the “remote desktop” address aimed at:

    localhost:5900

    That’s the local end of the SSH tunnel to the remote PC. It won’t work if you aim it at the remote machine’s IP address, because it’s not watching for incoming connections (nor is the router forwarding them).

    Type in the password and shazam you should see whatever’s appearing on the remote desktop. Mouse & keyboard control should work just fine, too. Word to the wise: make sure your local monitor is bigger than the remote monitor; while you can scroll around or scale what you see, that’s icky.

    It should be obvious that you cannot “switch users” to a different X console on the remote box and expect it to work. I tried it, just for grins, and it doesn’t. You could probably tunnel another session in through port 5901 (or 5900 + whatever the X11 console might be), but I haven’t tried that.

    Last year I set my mother up with Verizon’s cheapest DSL service: 768 kb/s down and 16 kb/s up, all for a whopping 15 bucks plus tax a month. Yes, that’s 16 kb/s: slower than old-school dial-up modems. Sheesh & similar remarks. So all this fancy remote-desktop GUI stuff won’t work for diddly with the PC in her apartment.

    SSH and the command line rule!

  • Ed’s High-traction Multi-grain Bread

    I bake a loaf of this every few days…

    Dump in a 4.5-quart mixer bowl:

    • 1/2 Tbsp dry yeast
    • 2 Tbsp brown sugar
    • 1/2 cup dried milk
    • 1-1/2 cup warm water

    I find it’s easiest to mush the three dry ingredients together so the brown sugar coats everything, then stir in the water. Let it sit for ten minutes or so if you have the patience, then, with the yeast up & running, add the goodies:

    • 1/2 cup flax seed meal
    • 1/2 cup bread flour
    • 1/2 cup rye flour
    • 1/2 cup wheat flour
    • 3 cups wheat flour (easier to measure that way)
    • 1 tsp salt
    • 2 Tbsp canola oil

    Put the dough hook on the mixer, screw down the bowl, and let ‘er grind on lowest speed until the dough gets nice & cohesive. Dump out the dough, oil the bowl, throw the lump back in, and roll it around to coat all sides.

    Put a lid on the bowl and let it rise overnight; perhaps in the oven after warming. If your yeast is more enthusiastic than ours it’ll take less time, but this is bread of unparalleled density.

    I’ve been baking this bread in a classic Pyrex Bake-A-Round that we’ve been toting unused from house to house ever since we got it as a wedding present. Turns out it’s really slick for this purpose. You can certainly use an ordinary loaf pan.

    Whatever you use to contain the dough: butter it thoroughly, pop in the dough without mushing it too much, and let it rise for another hour or two. If you’re using a B-A-R tube, push-and-hold the ends to plump up the middle just before you pop it in the oven. Best if you add aluminum foil caps to the end to keep ’em soft.

    Bake at 325 F for maybe 50 minutes. Cool on a rack while you get the peanut butter out of the refrigerator. Slather with PB, give thanks to the yeasty-beasties, eat.

    Speaking of which, it’s worth noting that our tap water now comes with chloramines that seem to kill yeast stone cold dead. We run the water through a Brita filter, but it’s not clear how much that helps; our yeast seems rather dispirited even in filtered water.

    [Update: A new batch of yeast reveals that we were using dead yeast. I’d bought several pounds of the stuff, as we use a lot of it, but evidently it aged out. Now we know.]

    This recipe started life as the Fundamental Tassajara Whole-Wheat Bread recipe, but has mutated over the years. The flax seed meal adds a surprisingly good taste.

    Update: if you’re in a hurry, dump the just-mixed dough out of the bowl, roll it into a log that barely fits into the B-A-R tube, slide it to the middle, cap the ends, and pop the B-A-R into a warm oven (ours hits 170, more or less). Let the yeasty beasties fart for an hour or two, then fire up the oven with the B-A-R inside; you can even use the Automatic Oven setting. Works like a champ!

  • Syncing Zire 71 in Kubuntu Hardy

    I have a somewhat antique Palm Zire 71 that has, periodically, synced perfectly with various flavors of GNU/Linux. On the other hand, sometimes a new release / kernel / version prevents it from syncing at all.

    My life is simple enough that I really don’t need to actively sync it with an online calendar, which is a damn good thing. Back when I needed to do hotsyncing, it always came heartbreakingly close to working; apparently that’s still the case. Having to comb out a complete set of duplicate addressbook entries pretty much soured me on futher experimentation.

    Currently, the Zire on the outs with Ubuntu / Kubuntu Hardy. The hack that makes it work goes a little something like this:

    The file /etc/modprobe.d/libpisock9 blacklists the visor module, which allegedly lets all the pilot-* programs connect using libusb, but that flat-out doesn’t work for me.

    Replace this stanza inside /etc/udev/rules.d/60-symlinks.rules:

    #KERNEL=="ttyUSB*", ATTRS{product}=="Palm Handheld*|Handspring *|palmOne Handheld", \
    #                                       SYMLINK+="pilot"
    
    With this one:
    BUS=="usb", SYSFS{product}=="Palm Handheld*|Handspring *|palmOne Handheld", \
    KERNEL=="ttyUSB*", NAME="ttyUSB%n", SYMLINK+="pilot", GROUP="dialout", MODE="0666"

    Make sure you’re in the dialout group. If you’re not, add yourself, log out, then log back in again.

    I back the Zire up once a month, which is rarely enough that I just load the visor module by hand:

    sudo modprobe visor

    Create a directory for backing up into:

    cd ~/Zire71
    mkdir 2009-01-03

    And then backing up the Zire is easy enough. Pop the thing in the cradle, poke the hotsync button, and quick like a bunny whack Enter on this:

    pilot-xfer -p /dev/ttyUSB1 -b 2009-21-03/

    The ttyUSB1 device will, of course, vary depending on whether you have any other USB-serial gizmos plugged in at the time.

    Frankly, the utter unreliability and instability of this whole USB PDA mess is one of the reasons why, IMHO, GNU/Linux really isn’t “ready for the desktop” despite the fact that all our boxen here run it. I don’t particularly want a phone / camera / PDA / ebook reader / pocketwarmer, but I can see I’ll wind up with one some day just to get a USB interface that actually works.

    Memo to self: remember to modprobe visor

    Update: Xubuntu 8.10 fixed all that, so USB hotplugging seems to work right out of the box. Install pilot-link, then just:

    pilot-xfer -p usb: -b /path/to/backups

    Now, whether syncing to contacts & calendars works correctly, I cannot say.

  • Fairing Arcs

    In CNC machining, at least the kind I do on my Sherline CNC mill, you can’t mill around acute inside corners: a round milling bit doesn’t fit into a straight-sided angle. You must add a fairing arc that smoothly connects the two sides; the catch is that “smooth” means it’s tangent to the sides. And EMC2 is really, really fussy about smooth, to the point where you can’t just wing it with a calculator and type in the numbers.

    Fairing arc doodles
    Fairing arc doodles

    There are nice analytic geometry methods for finding the intersection of two line segments, then laying in the arc that connects them, but this example weighs in at over two pages of G-Code. Mostly, what I need is an arc that connects a vertical or horizontal edge to an angled edge, so some simplification is in order.

    Herewith, the quick-and-dirty…

    The cutter enters from the left side, moving horizontally to the right, and will depart along the line toward P1, which might be the next corner of the part. The two material edges meet at P0, the vertex of the angle. The fairing arc is tangent to the two edges at PA and PB, centered at PC, and with a radius R.

    We know the coordinates of P0 and P1 and the arc radius. That radius must be larger than the cutter radius, as you can’t tuck a fat cutter into a narrow corner.

    The problem is to find PA, PB, and PC, so that we can write the G-code commands that travel along the sides & the arc.

    The first step is finding Φ (Phi), the angle between the outgoing edge and the X axis:

    Φ = arctan Δy/Δx = arctan (P1y – P0y) / (P1x – P0x)

    I’m pretty sure if you use a 4-quadrant arctan, as shown in the doodle, all the angles will work out perfectly on either side of the axis, but it’s easy enough to fake the signs to get the right answer in any specific case. If you wanted a general solution, you’d have a two-page subroutine, right?

    You’ll need the complement of that angle, hereinafter known as Theta:

    Θ = 90 – Φ

    Find the distances between various points using good old trig and right triangles:

    • CBx = R · sin Φ
    • CBy = R · cos Φ
    • P0PBy = R · (1 – cos Φ)
    • P0PBx = P0PBy · tan Θ

    Then the coordinates fall out thusly:

    Plastic Spring with Faired Corners
    Plastic Spring with Faired Corners
    • PCy = P0y + R
    • PBy = PCy – CBy
    • PBx = P0x + P0PBx
    • PCx = PBx – CBx
    • PAx = PCx
    • PAy = P0y

    Remember, you do not figure all this out with your calculator and plug the numbers into the G-code, not if you have any sense. If you have just a few corners, write the commands directly, otherwise gimmick up a little subroutine. Earlier versions of EMC2 used numbered parameters (#100), but now that you can have named parameters (#<_Fairing_Radius>), what’s holding you back?

    For example:

    #<_CBy>	= [#<_Fairing_Radius> * COS [#<_Phi>]]	(Y distance PC to PB)

    If your edge doesn’t come in from the left, then manual 90 degree rotations apply.

    0: (x,y) -> (x,y)
    90: (x,y) -> (y,-x)
    180: (x,y) -> (-x,-y)
    270: (x,y) -> (-y,x)

    If you’re using a CAD program to lay out your parts, all this is largely irrelevant. I hammer out the G-code for the simple 2-1/2-D parts I make by hand, so rounding off a few corners comes in handy.

    Because the lines & arc define the material edge contour, you can mill on either side of it and use cutter radius compensation to make the answer come out right. Works like a champ!

    For what it’s worth, the arc is tangent at PA and PB, making the line from PC to the corner (a.k.a. vertex) P0 the bisector of angle Φ. That’s not directly useful here, but keep it in mind when you solve similar problems.

    Update: As of mid-January, the newest trunk version of EMC2 can automagically insert fillets when cutter comp is turned on. That’ll be in the stable version in a while, after which I’ll need this math only for decorative fillets. That’s fine with me!

  • Fluorescent Shop Lights, Early Failures Thereof

    A decade ago I installed a few dozen two-tube fluorescent fixtures (a.k.a. “shop lights”) throughout the basement. Visitors always say something like “Wow, I can actually see what I’m doing!” That was the whole point, of course.

    Being that sort of bear, I write the date on one end of a fluorescent tube when I replace it. Tubes seem to last 3-5 years, which is short compared to the 20k power-on hours touted on the carton: 5 years * 300 days/yr * 6 hr/day = 9 k hours. That’s an overestimate, as I don’t spend all my time crouched in my basement laboratory, honest.

    It turns out that there’s also a spec for the number of lamp turn-ons (“starts”) hidden deep in the lamp datasheets. For example, if you manage to browse the current Lamp and Ballast catalog at http://www.sylvania.com/ProductCatalogs/, you’ll find that a 20k hour rated life comes at “3 hr/start”, which works out to a mere 6.7k starts over the expected life.

    More starts = shorter life.

    I tend to turn the lights off if I think I’ll be upstairs for a few hours, which happens a lot during the winter.  My back of the envelope says that the tubes fail right around the expected value: 5 years * 300 days/yr * 4 starts/day = 6 k starts.

    Lately I’ve had a rash of early lamp failures and it seems the fixtures are failing after a decade; nothing lasts any more. I’m now installing electronic-ballast fixtures that fire right up in the winter and don’t have that annoying subliminal flicker. At a cost of $20 each, I’m not replacing all of them at once, I assure you.

    The only real problem with fluorescent lamps is that they make white people look dead. I managed to buy a contractor pack of warm-white tubes at the local Lowe’s, but they’re hard to find around here. Go for the lowest color temperature bulbs you can find.

  • Sunglass Repair

    Making the fixture
    Making the fixture

    One of the screws on Mary’s sunglasses came apart. Wonder of wonders, the nut fell off in the kitchen, made a click when it hit the floor, and we managed to collect all the pieces.

    The temples attach to the lens frame with two tiny screws apiece. The screw heads are slightly embedded in the temples, but you can see why this didn’t work nearly as well in practice as it did in the design studio.

    The trick is to align the screw properly so it fits through the lens and frame after the adhesive sets up. The holes are 6 mm on center and more-or-less 55 mils in diameter (obviously, they’re metric screws, but this is the US and we do the best we can with antique units).

    Clamping and curing
    Clamping and curing

    That’s what CNC is all about: making it trivial to poke holes exactly 6 mm apart on center. I drilled two holes in some scrap acrylic sheet using Manual mode on my Sherline / EMC2 mill:

    g83 z-7 r1 q0.5 f100
    g0 x6
    g83 z-7 r1 q0.5 f100
    g0 z100

    I have it set to start up in metric units, which still seems to be legal here.

    cimg2858-sunglass-repair-success
    Success!

    Add a teeny dab of JB Weld, hold everything together overnight with a clothespin, and it’s all good in the morning.

    The trick is to check the leftover epoxy first to see if it’s fully cured before you move the actual piece.

    Memo to self: epoxy takes forever to cure at 55 F.

    Update: Pretty much as expected, that little dot of epoxy didn’t hold nearly as well as the original brazing. I tried a somewhat larger dot, but Mary was unhappy with the glasses anyway and we finally tossed ’em out.

    Of course I salvaged the screws & nuts & suchlike: you gotta have stuff!