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: Electronics Workbench

Electrical & Electronic gadgets

  • EMC2: Ugliest Tool Length Probe Station… Ever

    Tool length probe switch
    Tool length probe switch

    Having hacked a jack in the Sherline motor driver box, this is what goes on the other end of the cable: the simplest possible tool length switch.

    I’ve seen all manner of exceedingly fancy and painstakingly constructed tool length switch stations, but it seems ordinary snap-action / tactile-feedback switches are repeatable enough for most purposes. I selected a switch from my stash with these qualifications:

    • physically small — fits on Sherline table
    • plastic button — avoid nicking the cutters
    • many more in the stash — not a special-order item
    • cheap – ’nuff said

    A few snippets of heat stink shrink tubing later…

    Switch detail
    Switch detail

    After puzzling over the mounting, I snagged a chunk of aluminum U-channel from the heap, poked a 10-32 clearance hole in one end, and held the switch in place while slobbering brown hot-melt glue over it. The glue is rigid when cool, so the switch isn’t going anywhere, but it’s mounted with some air space below to allow crushing when the probe routine screws up.

    The button stands slightly proud of the U-channel, so even wide tools have side clearance. If the tool doesn’t stop when the switch trips (it could happen!), the entire switch will bend downward until the Z-axis drive stalls as the tool crushes the rubble or snags on the side of the U-channel.

    At which point I just cut the cable, hammer the hot-melt glue and switch rubble out of the U-channel, solder up another switch, blob it in place, and continue the mission… from scratch, though, because the stored tool height reference value will be kaput.

    The U-channel can be screwed down to a T-nut, clamped directly to the table, or affixed wherever it’s needed. If the Sherline had home switches, it’d be better to mount the probe switch in a fixed location somewhere, then use a fixture offset for the part, but I’m not there yet.

    The switch doesn’t have much overtravel: when the contacts activate with a tactile click, the button is pretty much bottomed out. However, unless you’re driving the tool into the switch at a dead run, it ought to stop moving fairly quickly.

    Back of the envelope: I have the Z axis acceleration set to (a sluggish) 3.0 in/s/s. Approaching the switch at 12 in/min = 0.2 in/s , it’ll screech to a halt in 67 ms = (0.2 in/s)/(3.0 in/s/s). Assuming the average velocity while stopping is 0.1 in/s, the distance works out to 7 mils, which shouldn’t pose a problem.

    Then drive up off the switch enough to clear the backlash and drive down at nose-pickin’ speed, so the axis stops pretty much instantly when the switch clicks.

    Some not-very-exhaustive testing suggests the repeatability for a single tool is well within 0.03 mm, about 0.001 inch, which is entirely satisfactory for my purposes.

    [Update: It’s pretty good, all things considered. A simple experiment is there.]

    The overall procedure:

    • Laser align XY to the part origin, home X&Y axes
    • Execute G49 to clear any existing tool length compensation
    • Insert first tool, align to Z=0 on part, home Z axis
    • Eyeball align XY to the switch with the tool just above
    • Jog Z comfortably high, execute G30.1 to set tool change location
    • Fire up your program!

    The program probes the first tool length and saves that as the reference length. Each subsequent tool change gets probed and the tool offset becomes the difference between the new length and the reference length.

    The initial probing routine:

    O<Probe_Init> SUB
    
    G49					( clear tool length compensation)
    G30					( to probe switch)
    G91					( relative mode for probing)
    
    G38.2 Z-90 F300		( trip switch on the way down)
    G0 Z1				( back off the switch)
    G38.2 Z-10 F10		( trip switch slowly)
    
    #<_ToolRefZ> = #5063	( save trip point)
    
    G90					( absolute mode)
    G30					( return to safe level)
    
    O<Probe_Init> ENDSUB
    

    Note that the G30 coordinates are stored in native units, which are inches for my Sherline mill. To get to that Z height (for safety, before moving) while using metric units:

    G0 Z[#5183 * 25.4]

    The G38.2 coordinates are stored in whatever units the G20/G21 mode calls for, so they can be applied directly to tool length compensation. That seems odd, as EMC assumes the tool table uses native units.

    There does not seem to be any way to determine which unit mode is active, although the probe speed depends on that setting. although I suppose I could set a global variable to the desired probe speed and leave it up to the G-Code program(mer) to get it right. Yeah, like that’ll work…

    Anyhow, each subsequent tool gets probed thusly:

    O<Probe_Tool> SUB
    
    G49					( clear tool length compensation)
    G30					( to probe switch)
    G91					( relative mode for probing)
    
    G38.2 Z-90 F300		( trip switch on the way down)
    G0 Z1				( back off the switch)
    G38.2 Z-10 F10		( trip switch slowly)
    
    #<_ToolZ> = #5063				( save new tool length)
    
    G43.1 K[#<_ToolZ> - #<_ToolRefZ>]	( set new length)
    
    G90					( absolute mode)
    G30					( return to safe level)
    
    O<Probe_Tool> ENDSUB
    

    With those two routines in hand, this demo code shows how it’s done…

    G21					( metric units)
    
    (msg,Verify origin at proper location, hit Resume)
    M0
    (msg,Verify G30.1 at tool change switch, hit Resume)
    M0
    (msg,Verify first tool installed, hit Resume)
    M0
    
    O<Probe_Init> CALL
    
    G0 X0 Y0 Z0
    (msg,Verify return to origin, hit Resume)
    M0
    
    M6 T2
    O<Probe_Tool> CALL
    
    G0 X0 Y0 Z0
    (msg,Verify return to origin, hit Resume)
    M0
    
    M6 T3
    O<Probe_Tool> CALL
    
    G0 X0 Y0 Z0
    (msg,Verify return to origin, hit Resume)
    M0
    
    M6 T4
    O<Probe_Tool> CALL
    
    G0 X0 Y0 Z0
    (msg,Verify return to origin...)
    M2
    

    The M6 Tx commands make use of a

    TOOL_CHANGE_AT_G30 = 1

    line in Sherline.ini, which tells the Axis automagic manual tool changer routine to traverse to the G30 position and pop up a prompt to (manually) change the tool. When you click OK, the subsequent CALL command invokes the tool length probe routine and away it goes.

    This whole lashup doesn’t have a lot of power-on hours, but I really like how it works!

    A tip o’ the cycling helmet to the folks behind EMC2…

  • Palm Zire 71 USB Cradle Charging Current Indicator

    Modified USB cradle with bargraph
    Modified USB cradle with bargraph

    The first time my first Zire 71 crapped out, I hacked this charging current display into the cradle so I could see when the mumble thing was actually charging. It turns out that the PDA makes its happy “I’m charging!” beep and overlays the charging indicator on the battery symbol even when there’s no +5 V connection to the PDA: you can leave it in the cradle all night and wake up to a dead battery in the morning.

    I hate it when that happens…

    The charging current meter is a classic LM3914 LED display driver and a surplus HP (from back when they were HP) 10-LED bargraph module.

    Here’s the schematic, such as it is, reverse-engineered from the as-built gadget…

    Charge current bargraph circuit
    Charge current bargraph circuit

    [Update: Something went wrong with the upload for that sketch; I think it’s OK now.]

    The general idea is to insert a 1-Ω resistor in the common return from the Zire’s charging contacts. The total current through the Zire, which is mostly battery charging current when it’s off, generates a voltage across the resistor. That voltage feeds the LM3914’s input, so the LEDs directly indicate the charging current.

    Fairly obviously, that resistor drops the external voltage by a smidge. As nearly as I can tell, the drop adds up to maybe a third of a volt, so the charging voltage is a tad lower than they expect. Seems to work just fine; the maximum charging voltage for a 3.7 V Li-Ion cell is pretty close to 4.2 V, so they’ve still got half a volt to play with.

    The two resistors and the trimpot add up to 1240 Ω, which sets the LED current to about 10 mA. The trimpot sets the voltage at the top of the LM3914’s internal resistor string to about 290 mV, although I measure the all-LEDs-on current at about 380 mA.

    Current meter overview
    Current meter overview

    Here’s what it looks like inside.

    The sense resistor hangs off the power input jack’s common pin, with the common lead from the PDA contact pins and the LM3914 input lead connected to the other end. The LM3914 common goes directly to the power supply common, not the hot end of the sense resistor.

    The 5.1 V lead from the power input jack still goes directly to the PDA contact pins, as well as the LM3914. I put a 22 Ω resistor in series with the LEDs to cut their power dissipation a bit. They’re plenty bright at 10 mA, so you might want to cut that down.

    Bargraph display detail
    Bargraph display detail

    The LED bargraph module fits neatly in a rectangular hole painstakingly drilled, sawed, and filed into the case, then held in place with a generous dollop of JB Weld epoxy. I taped it in place to keep the epoxy from oozing out while it was curing.

    The LM3914 is soldered directly to the display module, with flying wires and components soldered to the remaining pins.

    If I recall correctly, I held the Zire in position on the connector strip, got it charging, and then tweaked the trimpot until the display showed full scale.

    This was done in an absolute white-heat frenzy with the PDA’s battery going dead, but at least the exterior looks pretty good. The circuitry inside is a genuine hairball that has been working fine ever since, which makes it Good Enough.

  • Replacement NP-FS11 Li-Ion Battery Pack: Plan B In Full Effect

    Rebuilt NP-FS11 battery with Kapton tape wrap
    Rebuilt NP-FS11 battery with Kapton tape wrap

    So I picked up some 4/5 AA cells from a nominally reputable supplier and popped a pair into the NP-FS11 case from the oldest pack.

    All eight cells were within 3 mV of each other, so I sorted them by voltage and picked two from the middle of the lineup. Shorting them together in parallel produced a few microamps of current, so they’re as well matched as seems reasonable.

    Rather than attempt to solvent-bond the case back together, I wrapped a layer of Kapton tape around the whole thing. The case doesn’t have quite enough meat to bond, anyway, because the width of the slitting saw turned that much plastic into dust.

    A bunch of cutouts along the bottom edge key it into the charger, so I cut out the tape over those sections. Despite what it looks like, the small metal tab between the two terminals (on the top) is not covered in tape; that’s the snazzy InfoLithium contact that tells the camera that this is a valid battery.

    The camera reported the pack had about 15 minutes of life remaining, which makes sense given that the cells spent quite a while in transit. I ran it down to empty, put it in the charger, and it seems to be perfectly happy. I’ll do a capacity test after a round or two of picture-taking.

    I doubt the tape will prove to be a permanent fix, but as far as the camera is concerned, that slick Kapton makes it go in and out like anything

  • Sherline Tool Length Probe: Adding a Jack

    Probe jack and switch
    Probe jack and switch

    I’ve been mulling over adding a tool length probe for a while and finally decided that the simplest approach might be the best: a momentary-contact pushbutton switch that pulls a parallel port input pin to ground.

    The motivation is that a simple switch seems to be repeatable enough for tool length probing and it’s cheap enough that I won’t form a deep emotional bond to it. When a probe crashes the switch, I can just pop another one in place without any heartache or putzing around for a day or three to build another over-elaborate probe station.

    The catch is that the Sherline motor driver box doesn’t include connections for any of the parallel port input pins.

    The choices seem to boil down to:

    • Adding a breakout board between the parallel port and the driver box or
    • Hacking the driver box to get access to the port pins

    Well, I’ve already pretty well hacked up my controller, as I wrote up in Circuit Cellar magazine (Aug & Oct 2004), so I don’t have much to lose… and the box is already in the shop!

    Probe to port pin 15
    Probe to port pin 15

    This picture shows the connection to pin 15 of the parallel port on the Sherline driver PCB. The driver doesn’t use that input pin (or any of the others, for that matter), which means the PCB doesn’t have a trace leading anywhere convenient. I ran the new wires through the connector mounting hole, rather than around the edge, and soldered them directly to the connector pins on the bottom of the board.

    The jack is an ordinary 1/8″ (3.5 mm, these days) stereo (3 conductor) jack, with lah-dee-dah gratuitous gold-flavored flashed plating; anything similar will work just fine.

    Connections:

    • Sleeve -> driver box
    • Ring -> circuit ground (pin 19 is convenient)
    • Tip -> pin 15, the probe input

    The cable shield connects only at the plug into the driver box, not at the switch end. That ensures there’s no current flowing through it and it can do a marginally better job of shielding the two conductors within. I’m reasonably sure that makes no difference whatsoever in this application.

    The cable got chopped out of an AV-interconnect dingus with all sorts of fancy connectors on the other end. It’s a surplus find, cost maybe a buck, and has the redeeming feature of sporting molded plugs that I don’t have to solder.

    The switch connections are soldered and insulated with heat stink shrink tubing. The general idea is that the driver box provides all the power, there’s no electrical contact with the mill table or spindle, and thus no reason to use fancy circuitry to solve a problem that’s not there.

    I did not add a capacitor across the switch contacts, figuring that I’d solve that problem when it happened. The common practice of putting a honkin’ big cap across switch contacts is bad practice: it effectively shorts the power supply across the contacts for a brief moment every time the switch closes. Some stored energy is good (it keeps the contacts clean), too much simply burns them away. ‘Nuff said.

    Probe jack - inside
    Probe jack – inside

    I marked a hole on the front panel symmetric with the LED, eased the circuit board out of the case and wrapped it in a shop rag to keep the swarf out, propped the case on the drill press table, and rammed a 1/4″ hole through the spot marked X with a step drill. Yeah, hand-held on the table, just like you’re never supposed to do.

    The force is strong with me…

    The (well, my) Sherline.hal file connects pin 15 to the probe sense input (maybe I defined that when I set things up; I don’t recall now), but it assumes the pin will be high when active. The parallel port pin has a built-in pullup resistor and a switch to ground makes it active when low. These two lines in my custom_postgui.hal file disconnect the high-active pin signal and connect the low-active pin signal.

    unlinkp parport.0.pin-15-in
    net probe-in parport.0.pin-15-in-not
    

    You do it that way to avoid changing the Sherline.hal file, which will be overwritten if you ever run the automagic configuration program again.

    If you’re doing this from scratch, just configure the whole thing using the configuration tool, it’ll set the HAL file properly and you won’t need any of that fiddling around.

    Tweak the Sherline.ini file to add support for tool changing with the G30 command:

    [EMCIO]
    TOOL_CHANGE_AT_G30 = 1
    

    Button everything up, then do a quick

    G91 G38.2 Z-10 F10

    and poke the button while the Z axis is in motion. The Z axis should stop instantly. If not, check your wiring.

    Now, some Orc Engineering is in order: I need a low-budget fixture to put the switch in harm’s way.

  • Zire 71 Battery Replacement

    I tote around an ancient Palm Zire 71, which suffices for my simple calendar & to-do lists. This is my second, as the first failed when the flexible cable connecting the guts to the charging / USB connector crapped out; turns out that the slide-to-open feature that reveals the crappy camera also stresses the flexy cable to the breaking point. Now I don’t do that any more.

    The battery (well, it’s actually a single Li-Ion cell, but let’s not be pedantic) finally stopped taking a charge, so I did a full backup, tore the thing apart, and popped in a new battery. This being my second Zire 71, things went smoothly…

    I got a stack of surplus Palm batteries some years ago, but they’re readily available from the usual suspects for prices ranging from $5 to $50. We’ll see how well mine survived their time in isolation.

    The connectors don’t match, which means you just chop off them in mid-wire, then solder the old connector onto the new battery. A few dabs of Liquid Electrical Tape and it’s all good.

    Some teardown instructions are there, with fairly small pix.

    General reminders:

    • Stick the teeny little screws on a strip of tape
    • Watch out for the tiny plastic switch fin on the side
    • Torx T06 screws on either side of the camera
    • The silver shield around the shutter button snaps under the sides with more force than you expect
    • There’s a metal strip over the connector that can be taped back in place after the plastic posts snap off
    • Gently pry the flexy cable up off the base, using the tabs on either side
    • The speaker seems to be held in with snot
    • The battery shield is not soldered in place!
    • The battery adhesive comes off with a sloooowww pull

    Although it may not be obvious, I replaced the crappy plastic window over the camera with a watch crystal. Much better picture quality, although much worse than my pocket camera.

    Backup and restore with various pilot-link utilities:

    pilot-xfer -p /dev/ttyUSB1  -b wherever
    ... hardware hackage ...
    pilot-xfer -p /dev/ttyUSB1  -r wherever
    pilot-dlpsh -p /dev/ttyUSB1 -c ntp
    pilot-install-user -p /dev/ttyUSB1 -u "Ed Nisley"
    

    The thing seems perfectly happy with a userid of 0, which is good because I haven’t the foggiest idea what else it could have been.

  • Making a Clock Colon: Post Milling

    Finished colon dots
    Finished colon dots

    I used a pair of blue LEDs for the colon in the Totally Featureless Clock. Each one has a brass tube to define the dot and a white plastic diffuser to eliminate hotspots.

    Some rummaging in the brass cutoff assortment produced a pair of tubes with a 0.300 inch ID that closely matched the width of the LED segment bars. The catch is that I don’t have a core drill that spits out 0.300 inch slugs…

    Milling the dots
    Milling the dots

    So I taped a chunk of translucent acrylic to some plywood scrap and milled the dots. Helix milling on the lesser of a 4% slope or 1/5 of the cutter diameter, 15 inches/min, no cooling, maybe 1500 rpm.

    The resulting disks were snug slip fits into the tubes, although I added a dot of cyanoacrylate to ensure they didn’t get any ideas about perpetrating an escape.

    It took two disks to remove all the hotspots, which reduced the light intensity to the point where I had to increase the LED current, which really heated up the linear regulator driving the dots. Fooey! In retrospect, I think frosting the LED lens would eliminate the need for a second diffuser without decreasing the intensity much at all.

    The code is available as an OpenOffice file there, too.

    (Post milling)
    (Ed Nisley KE4ZNU - Feb 2010)
    (Origin = center of post at surface)
    (Double-stick tape holding acrylic sheet to sacrificial plate)
    
    (-- Dimensions)
    
    #<_PostDia>	= 0.300				(post OD)
    #<_PostRad>	= [#<_PostDia> / 2]
    
    #<_Thickness>	= 0.120			(sheet thickness)
    
    #<_MillDia>	= 0.250				(cutter diameter)
    #<_MillSpeed>	= 15				(cutting speed)
    
    #<_MaxCutDepth>	= [#<_MillDia> / 5]	(max cutting depth)
    #<_MaxCutSlope>	= 0.04			(max cutting slope)
    
    #<_TraverseZ>	= 0.300				(safe travel height)
    #<_TraverseSpeed> = 25			(safe traverse speed)
    
    G20					(inches!)
    
    (-- Figure cut depth per helix pass)
    
    #<_PassCut> = [#<_MaxCutSlope> * 3.142 * [#<_PostDia> + #<_MillDia>]]		(limit max cut for each pass)
    
    O9000 IF [#<_PassCut> GT #<_MaxCutDepth>]
    #<_PassCut> = #<_MaxCutDepth>		(limit max cut for each pass)
    O9000 ENDIF
    
    (-- Set up cutter comp)
    
    G0 Z#<_TraverseZ>
    
    G0 X[0 - 3 * #<_PostRad>] Y0		(get to entry point)
    
    G42.1 D#<_MillDia>
    G2 X[0 - #<_PostRad>] I#<_PostRad> F#<_TraverseSpeed>
    
    (-- cut down through sheet)
    
    #<CurrentZ> = 0.0
    
    G0 Z#<CurrentZ>
    
    F#<_MillSpeed>
    
    O1000 DO
    
    #<NextZ> = [#<CurrentZ> - #<_PassCut>]	(figure ending level)
    
    G3 I#<_PostRad> Z#<NextZ>		(once around)
    
    #<CurrentZ> = #<NextZ>
    
    O1000 WHILE [#<CurrentZ> GT [0 - #<_Thickness>]]
    
    G3 I#<_PostRad>					(clear final ramp)
    
    G40			(comp off)		
    
    G0 Z#<_TraverseZ>
    G0 X0 Y0
    
    M2
    
    
  • Replacement NP-FS11 Li-Ion Battery Pack: Plan B

    Slitting the case
    Slitting the case

    Just for curiosity’s sake, I applied a slitting saw to the oldest defunct generic NP-FS11 battery pack, cutting carefully along the bonded joint between the two parts.

    No coolant, 1000 rpm, 200 mm/min, the saw is 22 mm diameter. Much slower than you’d use if you were in production, but I’m not.

    First cut all the way around at 0.5 mm inside the case, then another pass at 1.0 mm. The second cut went ting as it passed the tabs at the base of the cells, so I knew the halves were released.

    Inside we find a pair of 14430 Li-Ion cells, wired in parallel, with a little protection circuit board just jam-packed with teeny parts. One may reasonably assume the circuit controls over-charge and over-discharge, as well as current limiting.

    Pack opened
    Pack opened

    So a reasonable (or, perhaps, amusing) thing to do would be to buy raw cells from a nominally reputable supplier, do a heart transplant, and see if that improves the situation.

    Protection Circuit - Outboard
    Protection Circuit – Outboard

    Photos of the protection PCB, showing the cell connections. Positive end of the cells is toward the PCB. I think there’s enough clearance in the camera’s battery compartment to allow a wrap of tape around the case in lieu of re-bonding the plastic together.

    Protection circuit - inboard
    Protection circuit – inboard