Keyhole Slot G Code

Don’t know if this will be helpful, but I searched all over for a way to cut t-hole slots for hanging pictures and frames. It needs to plunge to a quarter of an inch, and then nibble forward, back up, nibble forward, back up, etc. This is if you don’t want the hassle of first cutting a quarter inch pocket, then following up with the keyhole bit. This code is for 1/8" depth of cut slot cutters. The bottom of the cut is only .25" deep so this is safe for .5" material.

This code slows the plunge to 5 ipm, and overrides the feed rate to 10 ipm. It goes .1" forward, goest back to zero, and creeps forward another .1" until a 1" slot is created. It then returns to zero and lifts out the bit.

Worked great for me. You just zero out right over where you want the circular hole to be. The slot will be cut up (away from you) from there. My machine is set for inches. You may need to do a little translating. And you’ll need to secure your material a little better than double sided tape.

GCODE:

T1M6
G17
G0Z1.1000
G0X0.0000Y0.0000S12000M3
G0X0.0000Y0.0000Z0.2000
G1Z-0.2500F5.0
G1Y0.1000F10.0
Y0.0000
Y0.2000
Y0.0000
Y0.3000
Y0.0000
Y0.4000
Y0.0000
Y0.5000
Y0.0000
Y0.6000
Y0.0000
Y0.7000
Y0.0000
Y0.8000
Y0.0000
Y0.9000
Y0.0000
Y1.0000
Y0.0000
G0Z0.2000
G0Z1.1000
G0X0.0000Y0.0000
M30

6 Likes

I also use a router. I would not attempt this with any of the spindles (unless VFD powerful spindle). This code sets the RPMS to 12,000, I certainly would not go slower - perhaps a little faster.

This is great! I was just thinking about this exact operation the other day! Thanks for doing the leg work!

Just used this and it worked great, thanks for providing the code.

I’m new to GCode and was curious, why does the bit travel 1.10" in the +Z at this beginning? Is this good practice or just your own personal preference? @Earwigger

YES - the slot is too damn long. Painstaking. Especially since I am usually physically holding the piece down throughout the process. Yet, I still have not edited mine.

I know it is a simple cut copy and paste… but… well… OK. I will use your code next time, not matter what kind of hurry I am in. Can’t cut that deep though - some of my projects are pretty thin.

1 Like

Does anyone have g-code that will work through Universal G-Code Sender? I know this may be sacrilegious but I almost never use easel. I have vcarve and use UGS to send the code to my X-Carve. None of the above code will work with UGS. Anyone have an alternative?

Easle has never congealed in my brain and confuses me every time I have messed with it.(all me not inventables fault) I also run vcarve pro and ugs If I have time I will try this one out this evening with an air cut and see if I can make it go. then maybe I will need to buy an 1/8" slot cutter!

Well JK if you work it out, pass it on. :slight_smile:

This code is untested on an actual machine, but the simulation looks good. It will drill peck to 3/8th inch (.1, .2, .3, .375 returning to z0 after each peck to clear chips) then move half an inch at 30/ipm (Again, change this to a slower setting if you don’t feel sure). Finally it moves back to x/y 0.0 and retracts at 9/ipm.

If anyone tries it out before I get home, let me know. I’ll update this post after I test it myself.
Again, this code was written entirely in Camotics and simulated, It may not be a bad idea to dry run it first.

G20
G90
G1 Z0.15000 F9.0
G0 X0.00000 Y0.0
G1 Z-0.1 F9.0
G1 Z-0.0 F9.0
G1 Z-0.2 F9.0
G1 Z-0.0 F9.0
G1 Z-0.3 F9.0
G1 Z-0.0 F9.0
G1 Z-0.37500 F9.0
G1 X0.00000 Y0.5 F30.0
G20
G90
G0 X0.00000 Y0.0
G1 Z0.15000 F9.0
G4 P0.1

His is also for a keyhole slot.

Better? As stated, G-code can be changed, if someone is unsure if how to change a 30 to another number, probably best to stick with what easel can do by itself.
Hope this help out. It now drill pecks in both directions at 9/ipm.

G20
G90
G1 Z0.15000 F9.0
G0 X0.00000 Y0.0
G1 Z-0.1 F9.0
G1 Z-0.0 F9.0
G1 Z-0.2 F9.0
G1 Z-0.0 F9.0
G1 Z-0.3 F9.0
G1 Z-0.0 F9.0
G1 Z-0.37500 F9.0
G1 X0.00000 Y0.1 F9.0
G1 X0.00000 Y0.0 F9.0
G1 X0.00000 Y0.2 F9.0
G1 X0.00000 Y0.0 F9.0
G1 X0.00000 Y0.3 F9.0
G1 X0.00000 Y0.0 F9.0
G1 X0.00000 Y0.4 F9.0
G1 X0.00000 Y0.0 F9.0
G1 X0.00000 Y0.5 F9.0
G20
G90
G0 X0.00000 Y0.0
G1 Z0.15000 F9.0
G4 P0.1

1 Like

I don’t have spindle control on mine (yet!) so yes, for those that have it, add it in.

1 Like

Helpful!

Thanks for posting this G-Code, I found it quite helpful. I didn’t tweak the code at all and made 2 carves, one through the edge of the board so I could get a nice feel for the depth of the plunge, and one “real” cut so I could see the finished product, and to see how the chips would behave in the more constrained environment - everything went fine.

End Cut

Real Cut

About the Setup

  • X-Carve w/ Dewalt 611 spindle & standard collet
  • 3/8" keyhole router bit (1/4" shank)
  • 3/4" A-C plywood (scrap from another project)
  • No finishing was done - it made a nice clean cut!
2 Likes

You guys will have to pardon my ignorance on this one, but… I’ve been doing plenty of vcarving, 3D, and stuff in V-Carve Desktop and have been wanting to add keyholes to some of my projects right on the X-Carve versus trying to freehand it afterwards - my question is how/where exactly do you set your X/Y(as in, on the material -bottom/left/corner, etc) when you are wanting to add one or two keyholes to a project?
Or do you simply position your router exactly over the spot you want it to start and then run the g-code?

1 Like

Ok, that makes sense.
Thanks!

Exactly what I did for my test carve.

After I study up on G-Code, I would like to make a modified version that starts at a different XY Zero, moves to the desired spot, and makes the KeyHole cut… until then, I am limited to the tedious, manual job of setting XY-Zero using the machine jogging buttons - easy enough to do, but time-consuming.

@GrantFarrand if you have a stop block and a constant zero set(G28) then all you need to do I know where you want you keyhole cut. For instance if I have a 10"x5" board and want it at a certain spot, I can jog it 2.5" over on x, and up 8.5" on y with a click each. Then the z is a little more time consuming, but, once set if you have several of the same piece that needs a keyhole in the same spot it’s just a matter of replacing the work piece, and then when hitting carve just “use last zero”. That’s how I did it on 125 pieces that needed a keyhole.

Another option would be to use the part Zero and use incremental programming for the local G code. Then you could use your current zero points and have very accurate slot locations.

G90 G20 G0 X2.0 Y4.0 Z1.0
Z0.15
G1 Z-.375 F5
G91 Y.1 F10
Y-.1
Y.2
Y-.2
Y.3
Y-.3
Y.4
Y-.4
Y.5
Y-.5
G90 G0 Z1.

Just change the X__Y__ Point for the starting point of the slot. The rest is local movements. Basic canned cycle. Is there a way to save this as a Macro and recall it in UGS? I’m used to using Fanuc controls on large CNC, and this is how I would have done it then. Not sure about GRBL.

So, I was thinking that you could use your part zero to position the spindle, then use incremental mode (G91) for the code to insert the keyhole. You would then switch back to Absolute mode (G90) to continue with the program. The benefit would be the ability to position the spindle to the exact XYZ coordinates you want the keyhole to be relative to your part alignment rather than having to reset the Zero point for each keyhole.

Example:

G90 G20 G0 X2.0 Y4.0 Z1.0
Z0.15
G1 Z-.375 F5
G91 Y.1 F10
Y-.1
Y.2
Y-.2
Y.3
Y-.3
Y.4
Y-.4
Y.5
Y-.5
G90 G0 Z1.
G0 X12. Y4.
Z0.15
G1 Z-.375 F5
G91 Y.1 F10
Y-.1
Y.2
Y-.2
Y.3
Y-.3
Y.4
Y-.4
Y.5
Y-.5
G90 G0 Z1.