This guide outlines the workflow for double-sided PCB milling using the Cubiko (or similar) CNC system. It covers file preparation, precise zero-point positioning for double-sided boards, G-code generation, and the final milling process.
Shop Cubiko Desktop CNC router
1. Preparation
Before starting the machine, you need the design files for your PCB.

Option A: Create Your Own
-
Design in KiCad: Start by drawing your schematic and PCB layout in KiCad.
-
Export Files: Generate the Gerber files and Drill files.
-
Tip: Ensure your manufacturing settings match your CNC capabilities.
-
Option B: Open Source Projects
You can download existing designs from platforms like:
-
GitHub
-
Hackster.io
-
Kitspace.org
-
Open Circuits Wiki
Simply download the Gerber or PCB source files.
2. Positioning & Zero Points (Crucial Step)
Accurate alignment is critical for double-sided milling. You must mathematically determine the zero point for the back side relative to the front.
Step 2.1: Measure PCB Width
-
Open your PCB file in KiCad (PCB Viewer or Gerber Viewer).
-
Use the shortcut Ctrl + M to measure.
-
Measure the exact Width of the PCB along the X-axis (End X - Start X).
-
Record this value.
Step 2.2: Physical Marking
-
Take your copper clad board.
-
Mark the Front Zero Point (usually the bottom-left corner of your working area).
-
Mark the Back Zero Point.

Step 2.3: Calculating the Back Zero
-
Select your Front Zero Point on the machine.
-
Record the distance from the zero point to the PCB edge.
-
Flip logic: When you flip the board to the back:
-
Locate the position of the Front zero.
-
Move along the X-axis by the value of the PCB Width you measured earlier.
-
This new position is your Back Zero Point.
-
3. G-Code Generation (FlatCAM)
Use CAM software (like FlatCAM) to convert Gerber files into G-code.
Front Side
-
Import the Top Layer Gerber.
-
Generate the geometry and CNC job for the traces.

Back Side
-
Import the Bottom Layer Gerber.
-
Important: Use the "Flip X" tool to mirror the design horizontally.
-
Generate the geometry and CNC job.

Drilling
-
Import the Drill file.
-
Generate the CNC job for drilling holes.

4. CNC Operations
Phase 1: Milling the Front
-
Secure the PCB to the CNC bed.
-
Align the spindle to your marked Front Zero Point.
-
Load the Front Side G-code file.
Start milling.
Phase 2: The Flip
-
Once the front is finished, remove the board.
-
Flip the board counter-clockwise (or vertically depending on your axis setup, ensuring it matches the software "Flip X").
-
Secure the board again.
Phase 3: Milling the Back
-
Move the spindle to the calculated Back Zero Point (Front Zero X + PCB Width).
-
Reset the X/Y coordinates to 0 at this new spot.
-
Load the Back Side G-code file.
Start milling.
Phase 4: Drilling & Cutout
-
Change the bit to a drill bit if necessary.
-
Run the Drill G-code file.
-
If you have an edge cut file, run it last to release the board.
5. Important Notes & Recommendations
-
Software Mastery: It is highly recommended to read detailed tutorials for FlatCAM and KiCad to understand the specific parameters.
-
Tool Selection: For PCB trace milling, use a 3.17mm shank V-bit (engraving bit).
-
Cut Depth: Set your milling depth (Z-cut) between 0.01mm and 0.05mm. Going deeper may break thin bits or create wide, rough traces.