I found one of my Workbooks which generates the G-code for just a hole. It is similar to read and to read the Gcode that it generates. I will attach it and it includes the macro needed so it must be a zip file to get through the HM upload gate. It is actually adapted from the workbood for various shaped hole so some of the parameters refer to them. The idea is the following. The hole can have up to 2 flats and 2 tabs for various shaped electronic devices. You only need one flat. It is written for a 2mm dia end mill size so that it can cut small holes. You can change this. You specify the hole location, the hole diameter, the radius to the center of the flat, the CCW angle of the flat from a visual x-axis, depth of cut per pass. The worksheet then computes all of the locations, angles, cuts, etc and generates the G-code. I think this must have been the workbook I used to generate the tool path shown in the previous posting. I did this cutting in Al sheet of a given thickness and so the program is set up for this . You will want to make modifications to the parameters that are shown mostly in cyan and a couple in purple.
The program leaves small pieces of material attached to the hole section to prevent the center portion from tearing out. These are called hangers. In this single flat case there is only one.
So I set the parameter to fit you hole diameter and Flat location and generated the G-code, but this is for my materials, cutter size, etc. Below is the tool path generated and a zipped copy of the workbook with parameters set for your hold and flat size. It was used to generate the gcode which I then fed into the tool path generator to obtain the picture. You will find that if you run the workbook macro it will copy the Gcode which you can then paste into any text editor to review. Otherwise if you just want to see the Gcode it is located starting at cell R197 and going down to cell R287. There are lots of comment lines so the actual code is not very long.
PS. I have learned a lot about writing Macros since I first started doing this back in 2020. I am sure that this workbook could be rewritten much better, but it seems to work to generate the Gcode so why mess with it. ....but you are free to modify it all you want.
To just generate the gcode for the single hole, you will want the attachment called: https://www.hobby-machinist.com/attachments/singlecirclehole-lc26_1447-zip.389851/I have been writing Gcode for things like this "by hand" for a while and recently made an instrument panel for my VFD converted PM1440GT lathe. (It is always a learning experience.) Then I found that I had wished I had laid out the instrument differently with switches, displays, lights in different locations. So I did it over! Then I decided I would actually like to add a digital counter display and switch to the panel and was faced with repeating the work again. The Thread on my conversion and the instrument panel installed in the lathe is HERE https://www.hobby-machinist.com/thr...tronic-components-pm1440gt-vfd-3-phase.95058/:
The program leaves small pieces of material attached to the hole section to prevent the center portion from tearing out. These are called hangers. In this single flat case there is only one.
So I set the parameter to fit you hole diameter and Flat location and generated the G-code, but this is for my materials, cutter size, etc. Below is the tool path generated and a zipped copy of the workbook with parameters set for your hold and flat size. It was used to generate the gcode which I then fed into the tool path generator to obtain the picture. You will find that if you run the workbook macro it will copy the Gcode which you can then paste into any text editor to review. Otherwise if you just want to see the Gcode it is located starting at cell R197 and going down to cell R287. There are lots of comment lines so the actual code is not very long.
PS. I have learned a lot about writing Macros since I first started doing this back in 2020. I am sure that this workbook could be rewritten much better, but it seems to work to generate the Gcode so why mess with it. ....but you are free to modify it all you want.