Skip to content

Instantly share code, notes, and snippets.

@ednisley
Created July 8, 2023 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ednisley/cc7e1aa8d3da1273921943e55c22d1a1 to your computer and use it in GitHub Desktop.
Save ednisley/cc7e1aa8d3da1273921943e55c22d1a1 to your computer and use it in GitHub Desktop.
LinuxCNC G-Code: pocketing operation for mini-lathe chuck stops
(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
@ednisley
Copy link
Author

ednisley commented Jul 8, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment