How to Convert and Mill Your PCB Layouts on Your CNC

122,314

163

26

Posted in TechnologyCnc

Introduction: How to Convert and Mill Your PCB Layouts on Your CNC

This is a small tutorial showing how to deal with the problems converting your PCB Schematics to G-Code to be able to Mill it.

Used Software.
DipTrace : http://www.diptrace.com/
CopperCAM : http://www.galaad.net/coppercam-eng.html
Mach3 : http://www.machsupport.com/

I used DipTrace form y PCB Layouts but any software cable of saving Gerber files can be used. Its Free if you can be under 300 pins. Witch works fine for most of my projects.

To control my CNC Mill I use Mach 3, but any other software can be used such as LinuxCNC and EMC2.
But for me I think the 175$ for a Mach 3 License is well spend since it’s a great peace of software.

I also got an license for CopperCAM for 80 € which is good given out and don’t have to mangle with a lot of conversation programs and scripts. Her I gave a great GUI and can see what’s happens and change the settings easily.

I will make the Tutorial both as a Video and Images Step by Step Guide

The Video can be seen her, the Image and Text Step by Steps on the next pages.


Step 1: Exporting PCB Design

Have your PCB Design Loaded in DipTrace and go to File /Export / Gerber…

Select the Top Layer and click Export chose Yes to use the automatically apertures and save the File eg. “Top.gbr”
Select Board Outline and click Export chose Yes to use the automatically apertures and save the File eg. “BoardOutline.gbr”

Close the Export Gerber window.
Select File /Export / N/C Drill…

Check the settings and click Export chose Yes to use the automatically tools and save the File eg. “Through.drl”

Then Close DipTrace and start CopperCAM.

Step 2: Exporting G-Code in CopperCAM

Start CopperCAM

Goto Files / Open / New Circuit.. and select the file Top Layer file “Top.gbr”

Goto Files / Open / Drills.. and select the file N/C Drill file “Through.drl” and click Yes if the Drill Holes look to be placed correct.

Goto Files / Open / Additional layer.. and select the file Board Outline file “BoardOutline.gbr” and click Yes if Board Outline look to be placed correct.

Select Layer 6 (Card Cutout)

Goto Files / Offset.. set Dx = -2,5 and Dy=-2,5 and click OK, this will place the PCB Layout in the correct place in the Card Cutout.

Select the Calculate isolating toolpaths icon, select the number of extra contours the engraving bit shall run abound the tracks. I use 1 both places. And click OK

Now you should see how your PCB will look like. The view is from the Top thru the board to it have to be inverted. But we will do that under the export process.

Select Parameters / Tool library..

And set up the number of tools you are going to use.

For my example
1 : 10 degree V-Bit for Engraving
2 : 1,3 mm Drill for Cutting
3 : 0,8 mm Drill for drilling 0,8 mm holes.
4 : 1.2 mm Drill for drilling all 1,2 mm holes and those a bow. So that I don’t have to change drills too often.

And click OK

Select File / Origin

Enter the values X=2 and Y=2 and select OK

This will change the Origin Point where the CNC will start from so that the start point is where the corner of the board so that you easily can position the CNC and don’t get too much waist material.

The White Cross will mark the Start Point.

Select Parameters / Select tools.. her you can change some option on how your G-Code shall be with travel speed and use of Bits with more.

I change under Drilling Tools “Use for each drill the closest small tool, with circular boring
And “Allow circular boring for all holes over “ is set to 1 mm.

In my setup, it will then end up with one file for 0,8 mm drilling and one for 1,2 mm and it will then use the 1,2 mm drill for all holes witch is bigger, this saves me a lot of changing drills since I can do it all with only 2 drills.

Click OK

Then to the last steps exporting the G-Code for the tool’s.

Click the Mill Icon to generate the Output files.

Select Section #1 and chose “Engraving layer #1” check the Flip X box.
This will invert the design.

Select OK, this will Open a Notepad windows with the G-Code for the selected task. Save that eg. As “Engrave.txt”.

Click the Mill Icon again and change the  Section #1 to Drilling (Tool #3 ø 0,8) check the Flip X box.
Select OK, this will again Open a Notepad windows with the G-Code for the selected task. Save that eg. As “drill_08.txt”.

Click the Mill Icon again and change the  Section #1 to Drilling (Tool #4 ø 1,2) check the Flip X box.
Select OK, this will again Open a Notepad windows with the G-Code for the selected task. Save that eg. As “drill_12.txt”.

Click the Mill Icon again and change the  Section #1 to Cutting out check the Flip X box.
Select OK, this will again Open a Notepad windows with the G-Code for the selected task. Save that eg. As “Cutout.txt”.

Now you have 4 files with G-Code for the necessary tasks.

You can run them in the order you like. But you should always run the Cutout as the last one.
I prefer the following order.
1 : Engrave
2 : Drill 0,8
3 : Drill 1,2
4 : Cutout

Now start your favorite Milling program and get ready to Mill.
A video of this process of my example is in the last port of the Video.

Step 3: The Finish Result

Her are 6 images showing the PCB after each step.

1. After Engraving.
2. After 0,8 mm Drill
3. After 1,2 mm Drill
4. After 1,2 mm Cutout
5. The cleaned and ready to use PCB
6. The Complete and assembled PCB

Share

    Recommendations

    • Microcontroller Contest

      Microcontroller Contest
    • Science of Cooking

      Science of Cooking
    • Pocket-Sized Contest

      Pocket-Sized Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    26 Comments

    Some body know how to put a circular card contour in coppercam ??

    Hey,
    Does anyone know how to make coppercam to put a line number (N***) in front of every line? I have a demo Mach3 and i can run only 999 line Gcodes, so I have to cut the g-code lists into 999 line pieces. Or is there any other solution?
    Many thanks

    1 reply

    Use Florian Balmer's Notepad2 and under the "view" tab, select "line numbers".

    Clipboard01.jpg

    I need control circuit diagram,please give me

    I need control circuit diagram

    Thanks for tutorial....

    HI dear centauri, thank you very much for sharing such a useful info. as i ma a layman in software part i was not able to generate g codes to run my diy cncs,finally today i could generate some n run my m/c, however request pls kindly post some info about mechanical cad cam,wit g code generation. regards n keep posting such info

    Hi, can you post the gcode files too? I want quickly check my 3040 cnc router and see how it performs with engraving pcb's. Thank you very much!

    hi I have a question, how do you control the axis z? my machine starts on and the axis z does not go up and then down instead just keep the same altitude and damage the PCB.

    thanks

    1 reply

    I zet my Z axe with a Probe witch i have made a tutorial about her

    https://www.instructables.com/id/Mach3-Zero-Probe-Tool/

    I have create PCB by dip trace and convert it to g cord by copper cam

    after that i was loaded the g code file to mach 3 and run the machine.

    but drawing scale is wrong. what is the reason my mach 3 is licence version

    please give me solution

    1 reply

    It can be if ist in mm or inches its how your pcb software export the files and how you import and export it in CopperCam again.

    How long did it take for you to receive your coppercam license once you sent payment? It's going on 5 days since I sent payment now and I don't get a response to emails from them either.

    1 reply

    I got the Licens the day after i orderd it.

    my copper-cam is not generating board outline gcode but the engraving and drilling are generating please what can cause it, i have follow the step by tutorial and video on youtube everything seems to be ok this is the code it generate for the cutting

    (( CopperCAM 3 - 17/11/2008 / ISO-Mill Output )

    ( C:\COPPERCAM\CopperCAM.iso created 29/12/2014 at 07:29 )

    ( Workpiece dimensions: 46.914 x 67.081 x 2 mm )

    G00 G90 G94 G71 G40 G54 G80

    T2 M06

    M03 S8000

    G00 F3000

    G00 Z2

    M05

    M02

    %

    with this the main gcode is not generate how can i resolve it

    thanks

    Hi everybody, FlatCAM has become the most powerful open-source PCB to G-code out there and has a new website: http://flatcam.org