So I edited my GCode from above to make use of the G91 (Incremental movement) instead of the G90 absolute. I also decided to emulate an adaptive clear operation instead of the pecking used previously. This is not tested yet as that will be later today but looking for some GCode guru’s out there (as I’m just starting to know enough to be dangerous) to maybe take a look and comment before I go do something bad.
Basically no need to zero XYZ but as I’m using G91 to movements will be incremental so just position the router with keyhole bit 0.5mm above where you want it to enter the stock and make sure the router is turned on before running it because once you hit go it’s straight to business. Also the measurements are in mm due to G21
(EDIT: REPLACED .nc FILE WITH CHANGES TO THE GCODE FOR THE ADAPTIVE CLEAR PART)
Enhanced Adaptive Keyhole - 10mm Deep x 15mm Slot.nc (4.3 KB)
(ATTENTION: - This program is for a keyhole slot using a keyhole bit, use at your own risk so review using software like NC Viewer and test before using on a project)
(SETUP: -Start 0.5mm above project at the disired postion XY where you want the keyhole bit to enter the stock)
(DESCRIPTION: - Slot depth will be 10mm deep Z-axis)
( - Slot length will be 15mm long Y-axis)
( - The program does not prompt for tool change or to start the router/spindle)
( - The program will end where bit was before running the program.)
G91 (G91 Incremental movement so no need to Zero XYZ)
G21 (G21 metric so in mm)
(No tool changes and router/spindle should be running)
I then start the pecking/plunging operation in the Z-Axis direction using a feed/plunge rate of 200mm/min (adjust to your settings as needed). Basically the bit will drop 2.5mm and rise to the top, drop another 2.5mm so now 5mm and rise to the top… until you get to a 10mm depth taking into account the 0.5mm above the stock to start.
(Start Plunge/Pecking operation in the Z direction in 2.5mm increments starting 0.5mm above stock 0,2.5,5.0,7.5,10.5 with a feedrate of 200mm/m. Tune Feedrates to your liking/tools)
G1 Z-2.500 F200.0
Z2.500
Z-5.000
Z2.5.000
Z-7.500
Z7.500
Z-10.50
(End of Plunge/Pecking operation in the Z axis)
I then proceed to emulate a poor mans version of an adaptive clearing toolpath using the G2 command basically doing little circles progressing in the Y+ direction until reaching the 15mm slot length.
(EDIT: CHANGED GCODE TO RUN A CLEANER ADAPTIVE CLEAR TOOLPATH)
(Start slotting using adaptive clear taking 0.500mm at a time and repeat until slot is 15mm length)
Y-0.500
G2X0.000Y0.000 I0J0.500 (G2 command to open up slot by 1mm)
G2X-0.500Y0.500 I0J0.500
G1Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
X-1.00Y0.500
Y0.500
G2X1.000Y0.00 I0.500J0.000 (G2 command to open up slot by 1mm)
G1Y-0.500
(End of slotting 15mm)
(EDIT: REMOVED THE CLEAN SAWTOOTH BECAUSE I ADJUSTED THE ADAPTIVE TOOLPATH GCODE)
Return to position to retract keyhole bit
X-0.500
Y-15.500
And finally pull the keyhole bit out of the stock returning to the original position where the setup/program should have started 0.5mm above the stock.
(Retract from the pocket in the Z direction from where the keyhole bit first entered into the stock to Z=5mm)
Z15.500
Now I’d like some advice on how to end this program, right now it uses the M02 because that’s what I saw in the GCode generated by Carbide Create but with this end with the machine going $H (home) at the back/right/top? Can I just omit this and let the machine stay just above the stock and then jog to another location and do another keyhole. Also should I have a G90 at the end to go back into absolute movements or is that up to the next .nc file/program to do that (looking for good practice)?
(EDIT: @WillAdams @Julien @neilferreri can one of you confirm if Carbide Motion or the Controller will handle the G2 and G3 commands. I’m assuming it would but just wanted to get a warm and fuzzy before running this on my machine… I’m starting to go down the GCODE editing rabbit hole as I see this as being very handy to get some things done