You are on page 1of 13

Guide on How to Mill PCBs with Roland MDX-40A

Jan Ray C. Rulida © 2017


jrcrulida@gmail.com

Introduction
Needed software:

 FlatCAM (at least 8.5 from the FlatCAM repository)


 VPanel for MDX-40A
 Electronics CAD Program for schematic capture and PCB layout (KiCAD, Eagle, etc.)
 Windows 7 or higher for VPanel
 Ubuntu, Mac OS, or Windows for the CAD program and FlatCAM (Windows 8.1 is being
used in this guide)
Needed hardware:

 Roland MDX-40A
 Blank PCBs
Workflow Overwiew:

Generate the Load gerber & Load g-code into


Gerber & drill drill files into VPanel to mill the
files of PCB FlatCAM to board.
design. generate G-code.

Section 1. Preparing…
Part 1. Generating Gerbers and Drill files
1. This guide assumes that the PCB design is already done and that it is ready for the generation
of the gerbers and drill files. For this tutorial, the CAD program being used is Eagle. Figure 1
below is the example design used in this guide.
Figure 1.
2. While in Eagle, open the CAM processor and click File Open  Job and then select
gerb274x.cam. You can generate the Gerber files using the default settings. Just remember
to adjust the layers that you need to process. If your design is in the bottom layer, check the
Mirror option in the Style block. Once you are satisfied, you may now click the “Process Job”
button and close the dialog box.

3. To generate the drill holes, click File Open  Job but this time select excellon.cam. In the
“Output” block, choose EXCELLON_24 in the “Device” option as shown in Figure 2 below. If
your design is in the bottom layer, check the Mirror option in the Style block. If you’re
satisfied, click “Process Job”.

Figure 2.
4. If you didn’t change anything in the settings of the CAM jobs, then you should have many files
being generated on your Eagle project folder. Just take note of the files with the .cmp and .drd
extensions. You can now move on to the next part.
Part 2. Installing and Setting Up FlatCAM
1. Head over to http://www.flatcam.org and download the latest version of FlatCAM. In this
guide, I am are using FlatCAM 8.2. After finished downloading, install FlatCAM.

Figure 3
2. After installing, start FlatCAM and click the FlatCAM Shell icon to start the FlatCAM Shell.

Figure 4

When the FlatCAM Shell opens, type the following set_sys excellon_zeros T into the
command prompt, then press the Enter key. This command sets the excellon zeros to
trailing which is the setting necessary in order to align the holes in the drill files generated
by Eagle. Once, that’s done, you may now close the shell.
Figure 5

3. After the steps above, you are now ready to open our gerber and excellon drill files. Creating
PCBs using CNC machines uses a method called isolation routing. With FlatCAM, you can
create single-sided and double-sided PCBs. In this guide, I will be focusing on creating single-
sided boards.

Section 2. Generating G-Code files


Part 1. Generating Gerber G-code with FlatCAM
1. Open a Gerber file: File  Open Gerber… . Locate the .cmp file that you generated in Part 1
and then you should see something like below.

Figure 6
2. Double click on the Gerber file name in the Project tab. You will be presented with the
Selected tab. In the Selected tab options, you can enter the tool diameter for the isolation
routing. In this example, I am using a 0.016” diameter tool. If you are using a V-bit routing
tool, like Figure 7 below, then you can use 0.010” for the diameter tool.

Figure 7

A tool with a small diameter is fairly easy to break and that is why if you not using any
surface mount components, you can use a larger diameter tool like a 0.032” diameter tool.
If you want a cleaner finish, you can put 2 in the Width. Once that’s done, hit the Generate
Geometry button.

Figure 8
Clicking the Generate Geometry button creates a new geometry object listed under
“Project” with the same name as the Gerber object with an “_iso” postfix. If you entered 2 in
the Width field, then there will be two files with “_iso” aptly numbered. The options are
shown in the Selected tab when you double-click the _iso file.

3. Select one of the .cmp_iso (in this case, the first file is .cmp_iso1) file and in the the “Create
CNC Job” block, place the the following values:
Cut Z: -0.007
Travel Z: 0.1
Feed Rate: 3.0
Tool dia: 0.016 (You should use the same values for the
diameter of the tool you chose in step 2 above.)
Figure 9
Once this is done, click “Generate” and then a CNC job with a “_cnc” extension should be
added in the Project tab. Repeat this step for the other cmp_iso file. After this, tool paths
will appear. Blue tool paths are copper cuts, while yellow tool paths are travelling (no
cutting) motions.

Figure 10

4. Double click on a CNC Job object in the Project tab to open the Selected tab. Then click on
the “Export” button under “Export G-Code”. This will open a dialog box for you to save to a
file. I like to name my files in such a way that I wouldn’t have difficulty locating them and
sorting them later for milling so I append the word “traces” to the file name if the file is for
milling traces. Save this file with a “.nc” file extension. This is the file that you will supply to
your CNC router.
Part 2. Creating CNC Jobs from Excellon drill files.
This part is needed only if you have through-hole components. If you are not using any through-
hole components, you can skip this part.
1. Open a drill (Excellon) file: File  Open Excellon. Choose the .drd file you created in
Section 1. You should see the holes aligned with pads where the holes are supposed to go
(see Figure 1). If you wish to remove the traces tool paths for visibility, you can do so by
deleting them in the Project tab. Just leave the original .cmp Gerber file for reference.

Figure 11
2. Double click on the .drd file in the Project tab to go to the Selected tab with the options
available. The following is an excerpt from the FlatCAM manual at
http://flatcam.org/manual/procedures.html:

A drill file will usually contain different tools (drill diameters). You can choose to create a CNC
job for each individual tool or bundle some of the tools together in the same job (in case you
did not intend to use drill bits of different diameters). Click on “Choose” under “Create CNC Job”
to open a selection window with the list of tools. Each has the format “id”: “diameter”, where
the diameter is in the project’s units. Check the boxes by the tools you want to include in the
job. The comma-separated list of tools should appear in the “Tools” entry box (Note: If you
know the ids of the tools you can type the list yourself).

In this tutorial’s example, I used a 0.04” diameter tool only so I only need to this step once.
3. In the Create CNC Job block, set the Cut Z value to a few points more than the thickness
of your PCB. So if you have a PCB with a thickness of 0.06 inches, then any Cut Z value
between -0.08 to -0.1 should be fine. Adjust this setting accordingly with respect to the
thickness of your PCB.
Figure 12

4. Click the Generate button and you should see the toolpaths that are generated like what’s
in Figure 13 below.

Figure 13

5. Go the the Project tab and will also be a CNC Job Object for the drd file. Double click on this
file and in the Plot Options block, change the Tool dia value to the value of the tool
diameter then click Update Plot.

Figure 14
6. While still in the Selected tab, click Export G-Code.
Figure 15.

When the dialog box opens, I usually append “drilling” to the file name to distinguish this
from the traces CNC job. Then save the file with .nc file extension. This will also be used by
the machine when drilling.

Part 3. Creating board Cutout


1. To cut the the newly milled board, you will need to create a cutout for the PCB. First, double
click on the Gerber file (remember the .cmp?) to open it in the Selected tab. You should
now focus on the Board cutout block.

2. You will be using a 0.06” diamater tool so set the Tool dia value to 0.06.

3. Next, specify the Margin. The margin will specify the distance of the rectangular cutout
from any element in the Gerber. For this tutorial, leave it at 0.1.

4. Set the Gap Size to 0.06. This will make the board easier to snap off.

5. Choose 4 from the options in Gaps. Then click Generate Geometry. You should see four red
lines like in the Figure 16 below.

Figure 16
6. Create a CNC Job like that you did in the previous parts of this tutorial. Just remember to set
the Cut Z to a depth that is the same as the thickness of your PCB and set Tool dia to 0.06
or the diameter of your cutting tool in the Cutout Geometry Object before you generate the
CNC Job Object. You should have something like the Figure 17 below where the blue cutout
toolpaths are shown

Figure 17

As I want to be consistent with the naming of my files, I would append “cutout” to the
generated G-Code when I save it.

7. Custom shapes for cutouts can also be made.

Section 3. Milling and Cutting…finally!


In this section you will be using the VPanel for MDX-40A to load the CNC files and run the MDX-40A
machine (of course). Before starting VPanel, make sure that the MDX-40A is turned on and
connected to your computer.
Prepare the end tools for the mill. You would basically need a 0.06” diameter tool, a 0.016” tool and
the tools with sizes that are the same as the holes that you have in your design.
You would also need to place your blank PCB on the MDX-40A platform. Make sure that the PCB is
as level as possible. The power of strong double-sided tapes may aid you to secure your PCB.

Part 1. Setting up VPanel


1. Don’t get excited yet. First, you will need to set up VPanel so that it can understand CNC
code. Open up VPanel and click Setup. You should see something similar like the one in
Figure 18. In the Modelling Machine tab, go to the Command Set block and select NC
Code.
Figure 18
2. Click NC Code Setting. In the NC Code block, make sure that the following values are there:
Tool-diameter Offset Type ----- A
Values with Decimal Point ------ Conventional Method
Optional Block ------ Enabled

3. Next, click on the Tool-diameter Offset tab. Make sure that all values are 0 (zero).

4. Click OK and you will be taken back into the Setup dialog box.

5. While still in the Setup box, click on the Correction tab. The values for the Distance
Adjustment should all be 100.000%.

6. Click OK.

7. Now back in the main panel, please be guided by Figure 19 below:


(a)

(b) (c)

(d)

Figure 19
(a) Select G54
(b) Set the Spindle Speed to 4500, just to be safe.
(c) Select High Speed
(d) Select G54 in the Set Origin Point.

8. Place and secure the tool in to the MDX-40A. It would be better to start with the tool that
you will be using to mill the traces.

9. Now move the spindle to the XY Origin of your choice, set the Z Origin using the sensor and
get milling and drilling and cutting!

Part 2. Milling, Drilling, and Cutting…finally.


This part of the tutorial should follow the following process:
(a) Mill the traces FIRST
(b) Drill the holes SECOND
(c) Cut the board LAST

1. In the lower left part of VPanel, click Cut… . The Cut dialog box should appear and the
Output File List should be empty. If the Output File List is not empty click Delete All.
2. Following the process outlined above, I will mill the traces first.

Click the Add button and navigate to where you saved the NC file of your first job.

If you have two or more NC files that will use the same tool diameter then you can select
them together. In this tutorial’s example, I have 2 CNC/NC files with G-Code of the traces
and, since they will be using the same tool, I added them together.

So if you have lots of drill holes sizes in your project, you will need to add and perform an
individual job for each unique drill hole size.

3. After the files are added, click the Output button to begin the milling or cutting or drilling
job. Yey!

4. Once a job is done, the spindle will return to the XY Origin and begin working on the next
queued job. If all the jobs in the current list are done, the spindle will return to the XY Origin
and stop spinning.

5. Replace the current tool with the tool for the next job.

6. Repeat Steps 1 to 5 for the drilling and cutting jobs.

References:
[1] FlatCAM. http://www.flatcam.org
[2] How to create PCB using MDX-40A and Fab Modules by Shohei Aoki.
http://modelahack.com/?p=255

You might also like