Mini-Lathe Chuck Stops: CNC Pocketing

With the fixture aligned and the chuck stop blank clamped down, all that’s left is to make three little pockets:

Lathe Chuck Stop - Pocketing - LinuxCNC backplot
Lathe Chuck Stop – Pocketing – LinuxCNC backplot

Although Javascript may be the gom jabbar of programming, the blinding syntactic noise of raw G-Code puts you in a similar world of hurt:

#<chuckrad>=20.000                  (radius to center of magnet)
#<chuckjaws>=3                      (number of jaws)
#<chuckang>=[360.0/#<chuckjaws>]    (angle between jaws)

#<bitrad>=[2.900/2]                 (cutter radius)

#<pocketrad>=[4.100/2]              (magnet pocket radius)
#<pocketdeep>=2.200                 ( … depth)
#<xoffs>=[#<pocketrad>-#<bitrad>]   (pocket center to cutter center)

#<safez>=20.0                   (above all the clamps & gadgets)

G21 G54 G80 G90 G94             (metric!)

F600                            (full speed for the Sherline)

G0 Z#<safez>

Obviously, those magic numbers must match the laser-cut blanks, the magnets, the cutting bit in the spindle, the clamps on the table, the speed of the machine, and everything else you overlooked.

So. Much. Pain.

Knowing the angle to the current pocket, polar coordinate notation gets to the center point, with a jaunt in relative motion to the starting point for the helix into the pocket:

#<ang>=[#<chuckang>/2]          (set starting angle)
O100 REPEAT [#<chuckjaws>]

G0 @#<chuckrad> ^#<ang>         (to hole center)
G91                             (relative motion …)
G0 X#<xoffs>                    ( … to helix start …)
G90                             ( … and done)

G0 Z0                           ( to surface)

Each pocket consists of a helix cut to the bottom, two clearing passes, and another helix back to the surface:

G2 I[-#<xoffs>] Z[-#<pocketdeep>] P[1+FUP[#<pocketdeep>]]   (into hole)
G2 I[-#<xoffs>] P2                                          (clean bottom)
G3 I[-#<xoffs>] Z0 P[1+FUP[#<pocketdeep>]]                  (shave sides)

That dance produced rounder pockets with cleaner bottoms than just a single helix down and a straight pull upward.

Then set up for the next hole and clean up after the last one:

G0 @#<chuckrad> ^#<ang>         (back to center)
G0 Z#<safez>

#<ang>=[#<ang>+#<chuckang>]     (set up next hole)
O100 ENDREPEAT

G0 Z[2*#<safez>]
G0 X0 Y0

M2

I ran the Sherline XY axes at their 600 mm/min top speed, the spindle at 10 kRPM with a shiny new 3 mm (nominal!) cutter, ramped into the helix at ≅10° (on a 1 mm circle!), and it sliced the acrylic into nice chips without getting all melty.

Unlike with Javascript, when you get something wrong in G-Code, you can hear the crash.

The LinuxCNC pocketing code as a GitHub Gist:

(Magnet pockets for laser-cut lathe chuck stops)
(2023-07 Ed Nisley)
#<chuckrad>=20.000 (radius to center of magnet)
#<chuckjaws>=3 (number of jaws)
#<chuckang>=[360.0/#<chuckjaws>] (angle between jaws)
#<bitrad>=[2.900/2] (cutter radius)
#<pocketrad>=[4.100/2] (magnet pocket radius)
#<pocketdeep>=2.200 ( … depth)
#<xoffs>=[#<pocketrad>-#<bitrad>] (pocket center to cutter center)
#<safez>=20.0 (above all the clamps & gadgets)
G21 G54 G80 G90 G94 (metric!)
F600 (full speed for the Sherline)
G0 Z#<safez>
#<ang>=[#<chuckang>/2] (set starting angle)
O100 REPEAT [#<chuckjaws>]
G0 @#<chuckrad> ^#<ang> (to hole center)
G91 (relative motion …)
G0 X#<xoffs> ( … to helix start …)
G90 ( … and done)
G0 Z0 ( to surface)
G2 I[-#<xoffs>] Z[-#<pocketdeep>] P[1+FUP[#<pocketdeep>]] (into hole)
G2 I[-#<xoffs>] P2 (clean bottom)
G3 I[-#<xoffs>] Z0 P[1+FUP[#<pocketdeep>]] (shave sides)
G0 @#<chuckrad> ^#<ang> (back to center)
G0 Z#<safez>
#<ang>=[#<ang>+#<chuckang>] (set up next hole)
O100 ENDREPEAT
G0 Z[2*#<safez>]
G0 X0 Y0
M2

3 thoughts on “Mini-Lathe Chuck Stops: CNC Pocketing

    1. I vaguely recall trying TCL and giving up immediately. Your wizardry is strong!

Comments are closed.