Sherline CNC Mill: Adding Home Switches

Real men have real CNC milling machines and real CNC milling machines have home switches. I have an itsy Sherline CNC mill, but now my mill has home switches just like a Real Man’s mill.

Sorta, kinda.

Truth is, I really don’t need home switches for the Sherline. I haven’t done any “production” milling with fancy fixtures, so zeroing the coordinate system to the lower-left vertex of the part-to-be-milled works reasonably well. But I figured it’d be fun to see what I was missing…

The first step was to hack another jack on the Sherline controller box and connect it to parallel port bit 10. The process is pretty much the same as I used for the probe switch jack documented there. I actually put the jack in the hole used for the power LED and drilled a new hole for the LED smack in the middle above the connector.

Sherline Controller with Probe and Home Jacks

Sherline Controller with Probe and Home Jacks

The simplest way to do home switches is to wire them all in parallel using a single port pin. You can even wire the probe switch in parallel with home switches, too, but I figured it’d be nice to have separate jacks… and, besides, the controller still has a few port pins left.

Adding the home switches requires a few lines (adapted from there) in custom.hal that connect the sense inputs in parallel:

net homeswitches <= parport.0.pin-10-in-not
net homeswitches => axis.0.home-sw-in
net homeswitches => axis.1.home-sw-in
net homeswitches => axis.2.home-sw-in

Using the -not suffix flips the sense of the input so the signal is True when the buttons get pushed. I don’t know of any algorithmic way to determine the actual logic states for a given button configuration, so just try it, use Halmeter to see what happens, then flip as needed.

The catch with adding home (or limit) switches is that Sherline mills have an attentuated mechanical structure with no good places to affix switches. I figured a trio of microswitches and a few dollops of JB Quik epoxy would suffice; if I must remove the switches, a quick shot with a chisel should pop the epoxy right off the metal.

The microswitches have about 20 mils of overtravel. I located the switches so the actuator buttons are bottomed out against the cases with the axes at the far limits of their travels. The steppers are puny enough to stall when the mechanical bits hit their hard limits, so there’s no risk of wrecking the machinery or knocking the switches off.

The X-axis home switch goes on the right side of the table, where it contacts the Y-axis slide at the end of travel. Putting it there also means I can remove the table by simply running the leadscrew out of the nut and pulling the whole affair off to the right. I lashed the switch cable to the motor cable with (wait for it) cable ties, which is probably a Bad Idea for larger machines, but seems to be OK in this situation.

X Axis Home Switch

X Axis Home Switch

The Y-axis home switch goes at the rear of the machine base, aligned with the plastic bushing I put there to capture the end of the leadscrew. That’s the travel limit for the bare table, but the Sherline tooling plate sticks out another half-inch: the plate hits the column before the table hits the bushing. Alas, I use the plate a lot.

Rather than futz with an adjustable switch position, I made a removable extender. The 3 mm (1/8″ nominal) thick plastic strip has 1 mm milled off the bottom, leaving a tab on the left side that snaps over the dovetail. The screw extends down past the dovetail on the right, so the whole affair slides back & forth just enough to connect the Y-axis slide with the button. The brass tubing exactly fits the tit on the switch actuator and is urethane-glued to the strip.

It’s removable by lifting the left end and sliding the whole affair out under the leadscrew.

Y Axis Home Switch with Extender

Y Axis Home Switch with Extender

The alternative, putting the Y-axis home switch on the very front of the base, would expose the switch & cable to all the slings & arrows of outrageous fortune to be found around the area of the countertop I use most. That may still prove to be a better location: if the back doesn’t work out, it’s easy to move.

The Z-axis switch had to go at the top-of-column mechanical limit, as homing to the downward limit of travel seemed fraught with peril. I epoxied the switch in place by clamping it to a shim atop the Z-axis slide to align the switch body, then applying gentle sideways pressure with a small screwdriver.

Epoxying the Z Axis Switch

Epoxying the Z Axis Switch

This is what it looks like after the epoxy cured. The square key bar sticking out of the extender block clears the switch with plenty of room to spare, no matter what it looks like.

Z Axis Home Switch

Z Axis Home Switch

The cables from all three switches go to a common junction where they’re connected in parallel to the cable leading to the green plug in the top picture.

Tomorrow, the configuration file that makes all this work…

About these ads

, ,

  1. #1 by smellsofbikes on 2012-11-05 - 15:14

    This, and its sequels, are very useful to me. I added home switches on each axis by making a bracket with two holes at NEMA34 spacing, that screw into bushings screwed onto the ends of the stepper motor attach bolts, and a sliding bracket with the microswitch attached to it, that can be adjusted wrt the mounting bracket. Z gets hit by the top of the head, x by the x/y block, and y on the right side by the x/y block, just barely fitting under the corrugated way cover you created.
    I feel like I should have an acknowledgements plate somewhere on the mill with your name on it…
    (No laser on the ceiling, yet.)

    • #2 by Ed on 2012-11-05 - 16:58

      making a bracket

      Well, dang, that’s a whole lot classier than a blob of epoxy. I like the adjustable slide, which would have come in handy while relocating the Y and Z switches.

      I bet you’ll make a much nicer tool-height probe, too!

      Thanks for the good words…

      • #3 by smellsofbikes on 2012-11-06 - 18:36

        The first one was super-classy, milled out of a block of aluminium. Over time I got less picky; the third is a piece of 1/2″ angle iron with two holes and a ground-out bit to clear the stepper mount, and a tapped hole in the other flange that the slotted bracket goes in.

        No tool height probe yet: I’m still reading about yours and trying to figure out the hal and ini wizardry you managed.

        • #4 by Ed on 2012-11-07 - 07:18

          figure out the hal and ini wizardry

          The G-Code driving the probe is the real puzzle; what I have works, in the sense that it does what it’s supposed to, but stopping the routine in mid-probe may leave the wrong coordinate system in effect. The current LinuxCNC version can (I think) remap the functions, so you could (I think) bury all that mess inside the tool change instruction. That is not a simple matter of software…

  1. Sherline CNC Mill: Defining Home Switches « The Smell of Molten Projects in the Morning
  2. Thing-O-Matic: Z-Minimum Probe G-Code « The Smell of Molten Projects in the Morning
  3. Sherline CNC Mill Y Axis Home Switch: To The Front! « The Smell of Molten Projects in the Morning
  4. Sherline Z-Axis Home Switch Spacer « The Smell of Molten Projects in the Morning
  5. Sherline CNC Mill Z-axis Overrun Prevention Block | The Smell of Molten Projects in the Morning