How To Create PCB Using MDX-40A and Fab Modules
How To Create PCB Using MDX-40A and Fab Modules
How To Create PCB Using MDX-40A and Fab Modules
th
First edition published in 6 May, 2014.
1
Table of Contents
1. Requirements
2. Install software
6. Configure CUPS
9. Troubleshooting
2
1. Requirements
PCB milling with MDX-40A and Fab Modules was tested in the
following environment.
It means you need two PC to run MDX-40A. After setting the origin
point on Windows, you will switch to Ubuntu to send RML data.1
1 I tested using Ubuntu on virtual machine, however, the print command didn’t
run on Ubuntu on virtual machine.
3
2. Install software
Windows
Install a driver for MDX-40A and VPanel software from an install disk.
Ubuntu
1. Fab Modules
Go to CBA-MIT website and get the latest copy of the source code.
http://kokompe.cba.mit.edu
Extract the .zip files. Open terminal and go to the location.
$ cd /path/to/fab_src
3. Python
Python is already installed in the process above.
4
3. Create PNG image with EAGLE
We are going to create a PNG image for milling and cutting outline.
5
In this case we selected “layer1: Top” layer.
6
Go to File>Export>Image.
Name a file to output. Don’t for get to check “Monochrome”. Set the
7
resolution high enough (for example, 2000 dpi).
You get a PNG image as below.
8
Secondly, we create an image for cutting outline. We draw a
rectangle to indicate the area of PCB.
Click a rectangle button as shown below.
9
Select “Document” layer. (Actually whichever layer will work)
Draw the rectangle to include whole area of the circuit. Click to put an
origin point, and click again after you move cursor to other end of the
rectangle.
10
Select only Document layer we created now (by clicking “display”
button as mentioned above). You just see the rectangle as shown
below.
11
Repeat the above process to create the monochrome image.
Finally, you will get a PNG image as below.
12
4. Create RML with Fab Modules
Open a terminal on Ubuntu. Type “fab” and hit enter.
Select .png for format and .rml for process. Click make_png_rml
program.
13
Click “load” to load png image.
14
The PNG image loaded.
15
The default preview is complex, so let’s switch to simple view. Select
“segments” in the dropdown menu.
speed(mm/s) 2.0
jog(mm) 1.0(default)
xmin(mm) 0
ymin(mm) 0
16
Go to the directory where you typed “fab” command.
(It’s your home directory in Ubuntu by default: /home/<username>/)
You can see there is a file generated, whose extension is “.rml” .
This file is a data to send to MDX-40A.
Repeat the process again for another PNG image to create the RML
for cutting outline. In this case, select outline PNG image and use
“cut out board(1/32”)”.
17
Change parameters. Set “bottom Z (mm)” and “cut depth (mm)” to
-5.0 and 1.2 respectively.
NOTE: DON’T CHANGE THE VALUE if you are using MDX-15/20
speed(mm/s) 1.0
jog(mm) 1.0(default)
xmin(mm) 0
ymin(mm) 0
Now let’s quit Fab Modules. Pressing <Control>+C kills the current
process of Fab Modules.
18
5. Set origin of MDX-40A
Use VPanel on Windows to set the origin. After you set the origin,
unplug the USB and connect it to Ubuntu.
We set the spindle speed as 10,000 RPM.
19
6. Configure CUPS
CUPS (Common Unix Printing System) is an open source printing
system for UNIX-like OS. We use CUPS for communicating
MDX-40A, since it doesn’t support serial USB. CUPS can be also
used for MDX-540 and iModela.
20
Click “Adding Printers and Classes”. If you are prompted to enter
your username and password, enter it according to your system
information. (it is login information of your account.)
21
Select “Roland Modela MDX-40A” and click “Continue”.
22
Select “Raw” and click “Continue”.
23
Click “Set Default Options”. You don’t have to change the default
values.
24
7. Change scale of RML with Python script
The RML files we created in the previous section work fine for
MDX-15/20. However, we found out that we have to modify the
values of X, Y and Z in the RML files, when we use these files with
MDX-40A.
For this, I created the Python script. Save the following text and
name it as “scale.py”.
(Make sure that the indentation is complete the same as the text
shown below. Python language is sensitive for indentations).
scale.py
#!/usr/bin/env python
import re
import math
print """
###########################################
###########################################
"""
#scale = 2.3
if scale == "":
scale = 2.48
else:
try:
scale = float(scale)
25
except:
exit()
pu = re.compile("^PU")
z = re.compile("^Z")
if input == "":
exit()
fin = open(input)
if output == "":
fout = open('out.rml','w')
else:
fout = open(output,'w')
newline = -1
lat = line.split('PU')[1]
x = lat.split(',')[0]
y = lat.split(',')[1].split(';')[0]
sx = int(int(x) * scale)
sy = int(int(y) * scale)
newline = "PU"+str(sx)+","+str(sy)+";¥n"
lat = line.split('Z')[1]
x = lat.split(',')[0]
y = lat.split(',')[1].split(';')[0]
depth = lat.split(',')[2].split(';')[0]
sx = int(int(x) * scale)
sy = int(int(y) * scale)
26
print 'Convert x:'+str(x)+"->"+str(sx)+", Convert y:"+str(y)+"->"+str(sy)
newline = "Z"+str(sx)+","+str(sy)+","+depth+";¥n"
if newline == -1:
fout.write(line)
else:
fout.write(newline)
fout.close()
Open a terminal and change directory to the folder you put the
scale.py script.
$ cd /path/to/file_location
$ python scale.py
27
Then you will be prompted to input some information.
By default, just put the values as shown in the figure.
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
28
Hit enter, and the dimension will be magnified 2.48 times as large as
the original size.
Make sure you have two modified RML files now. You are ready to
print them with MDX-40A.
29
8. Send RML data to MDX-40A
Attach 1/64” end mill to the spindle and set X,Y,Z origin using
VPanel.
Disconnect USB cable of MDX-40A from Windows PC and connect it
to Ubuntu PC.
You can check if your PC is recognizing your MDX-40A with
following command. Open terminal and type “lpstat -s”.
$ lpstat –s
> device for Roland_MDX-40A: usb://Roland/MDX-40A?serial=A
30
After milling the PCB layout, change the end mill to 1/32” and set the
Z origin. You should not change the X and Y origin at the moment.
Send the RML data to cut out the board, in the same way.
31
9. Troubleshooting
1. Cancel job
If you want to cancel a job, you can do it from CUPS.
Go to the following location and click “cancel job”.
http://localhost:631/printers/Roland_MDX-40A
32
2. Printer is paused
lpr command doesn’t run if the printer status is “Paused”.
This usually occurs after you push emergency stop of MDX-40A.
To resume printer, go to CUPS configuration page. Open following
URL in your web browser:
http://localhost:631/printers/
Click Roland_MDX-40A.
33
If the printer state is “Paused”, you have to resume it.
(Otherwise it is no problem.)
Select “Resume printer”. You will be promted to enter your user
name and password. Enter the information and the printer will be
resumed.
34
Check if the printer is “Idle” now.
35