FlatCAM practical tutorial: gcode and PCB milling – Part 6

Spread the love

Finally, we are going to create a gcode for our machine.

Tools normalization

First, we “normalize” all tools and depth, open all geometry to transform in gcode, and set all tools to C1 so you can set depth to 0.07mm (or other depth if you prefer).

FlatCAM Geometry Object set tool panel
FlatCAM Geometry Object set tool panel.

Join geometry

Another operation to get better readability of the project is to join the geometry with Edit --> Conversion --> Join Geo/Gerber/Exc -> Geo

FlatCAM Beta join geometry
FlatCAM Beta join geometry

Now I’m going to Join like so:

PCB_PCF8574_03_copperBottom.gbl_iso2 02-LastPass

Generate GCode

Now we will open all geometry files in sequence and click on Generate CNCJob object, but pay attention!!! You must select all Tools of Joined geometry to simplify. Click on the grid of tools and click “Crtl-A” first.

FlatCAM Geometry Object Panel select all and generate gcode
FlatCAM Geometry Object Panel select all and generate gcode

So now you have generated five gcode files:

  • 01-First2Passes.nc
  • 02-LastPass_cnc.nc
  • 03-RemoveIslands_cnc.nc
  • 04-SilkScreen.nc
  • 05-Countour_cnc.nc

Drill gcode files

Now are missing only the gcode files to drill the PCB.

It would be best if you had bits like this.

PCB drill bits
PCB drill bits
You can find here AliExpress

Click on the excellon file and choose a group of tips to use; I usually use 0.8 mm and 1 mm. I use the 1mm tip above 9.5mm, then set the depth (Cut Z) to -1.9mm I select the first three tools in the table (below 9.5mm) and generate the GCode file.

FlatCAM Excellon Object Panel tools selection
FlatCAM Excellon Object Panel tools selection

So you can create two gcode files: one 0.8mm bit one for the 1mm bit.

  • 06-Drill_08_Bit.txt_cnc.nc
  • 07-Drill_09_Bit.txt_cnc.nc

Now we have covered all the milling parts, as you can see on the screen.

FlatCAM completed project with GCode
FlatCAM completed project with GCode

Mill the PCB

I started a tutorial on bCNC, and I used all these files as a demonstration; I began with probe and auto level and then all the milling files.

Final result

After cleaning It with sandpaper, the result is here. In this case, I use a 0.07mm depth, but when 0.07 is not sufficient, I raise the deep and redò the work.

FlatCAM PCB pcf8574 result
FlatCAM PCB pcf8574 result


  1. FlatCAM practical tutorial: introduction, installation and import
  2. FlatCAM practical tutorial: copper traces geometry
  3. FlatCAM practical tutorial: clean non copper area
  4. FlatCAM practical tutorial: silkscreen geometry
  5. FlatCAM practical tutorial: contour
  6. FlatCAM practical tutorial: gcode and PCB milling

You can find Gerber, fritzing, images, and FlatCAM project files here.

Spread the love

2 Responses

  1. gmusojjang says:

    Hi. Thanks to your Tutorial for me as newbee in CNC world.
    I really want to know the miiling method to make a larger hole bigger than drilling bite.
    Its a basic operation for CNC machine. But FlatCam did not support the milling. Need not to say the with polygon we could make the large hole but it is so complex to make a hole with polygon.
    Would you let me know the way of milling the larger hole with smaller milling bite ?

Leave a Reply

Your email address will not be published. Required fields are marked *