18 x 24 Limit Switch Housings

Overview and G-Codes

Mounted Limit Switch
Z roller lever limit in housing.
The limit switches on the 18 x 24 machine are all secured in CNC cut housings.
The housings are made from 3/8 inch thick plastic.

The housings allow each of the switches to be mounted to the machine with a single #8 screw. The screw slots in the housings permit the switches to be aligned.

A plastic kitchen cutting board works well enough for this stock.

The g-codes for the housings are linked at the bottom of this page.
The housings are designed to hold miniature snap switches that are 0.78 inch long and 0.25 inch thick. This is a common size sold by Mouser, etc.

The X and Y switches can have straight levers as shown in the second photo.

A roller lever, as shown in the first photo, works better with the Z axis since it is triggered by the rounded stop, which is shown at the bottom of this page.
Limit switch in housing
Limit switch in housing.
Holes of 9/64 inch are drilled and tapped into the machine for the #8 mounting screws. Third image.

A 1/4 inch hole is drilled near the tapped screw hole for the wires.

This wire hole should be aligned with the recesses in the housing so the wire will not be crimped when the housing is installed.
Mounting holes for mounting limit switch
Holes in metal with housing.
The rack axis' limit switches' housings are spaced away from the vertical leg of the 2 x 3 angle on the 18 x 24 machine with a section of 3/8 inch thick block.

This can be cut from the same stock as the switch housings.

The screw slot is CNC cut. The wire recess is hand drilled to match the wires' size and orientation.
Limit switch block
The Z limit switch is triggered by a CNC cut stop that is screwed to the Z channel. The stop has a slot to permit adjustment on its attachment screw. This stop can be cut from the same stock as the switch housings.
Stop for limit switch
Z Stop
The codes are all for a 3/16 inch diameter straight router bit. A low cost single flute bit will work.

The bit may melt the plastic and make a gummy mess. This is resolved by slowing the rpm of the trim router.

An inexpensive speed control as shown on the Spindle Page has served well in this shop.

Take care to not slow the router too much or it may stall while cutting.

Keeping the chips out of the cuts will help to prevent the plastic from melting. A vacuum or blower can be used to keep the area clear.
The g-codes are all for 3/8 inch thick stock. Slightly thicker stock will work. Thinner stock will not.

Each of the pieces has tabs that hold the work in place.

X zero, Y zero is off of the lower left hand corner of the cut.
Z zero is the top surface of the stock.

The lowest part of the cut is −0.4 (negative 0.4 inch), so the bit will cut into the bed with 3/8 inch thick stock.

A spoil board underneath the stock is recommended.
The codes have been simplified to only use G01 moves. All arc and circular motion is broken into short line segments. This is done so the codes can be used with basic controller software.

These short segments will cut more smoothly with constant contour activated. (G64 in Mach)
The first few lines of the code may need to be deleted with TurboCNC.

Disclaimer: These codes have been tested on my CNC systems and have worked well.

You assume all risk and responsibility when using them.
G-Codes           Limit Switch Housing      Limit Switch Block      Z Stop