Using BoardCAD with a CNC machine

From BoardCAD

Jump to: navigation, search

Contents

Introduction

While BoardCAD v 1.0 does not support g-code export, the latest unreleased version does. Please make sure you have the latest available version of BoardCAD by checking out the svn trunk and compiling or by downloading Yesterday night's version from the download section.


Which CNC machines can used with BoardCAD?

Most three axis CNC machines can be used directly or be adapted to be used with BoardCAD. BoardCAD assumes that the board rests on two supports with fixed height, where each support consists of either a single cup in the center of a board or two cups placed at the same distance from the center. The position and radius of the cups and the coordinate system of the machine is configured in shapebot.txt as explained below.

The latest version of BoardCAD can handle any type of cutter (flat, bullnose, disc, etc) by reading the cutter geometry from as an STL-file. See below for how to model your cutter.

Image:Shapebot2.png

Configure shapebot.txt

The shapebot.txt file contains a number of parameters that allows you to control how the g-code is generated.

0.25	% length step
0.125 	% cross step
10000.0	% speed (mm/min)
1000.0	% stringer speed (mm/min) 
bullnose.stl	% tool name
1.0 1.0 1.0	% tool scale x y z
0.0	% sandwich thickness (mm) 3.0
0.0	% perimeter size (mm) 15
710.96 -427.239 202.065 20.0	% support1 x y z radius
1915.723 -427.239 202.065 20.0	% support2 x y z radius
1.0 0.0 0.0
0.0 0.0 -1.0
0.0 1.0 0.0
410.96 -427.239 202.065
1	% cut stringer
1	% cut rail

The cutting path is created from the NURBS model and the first lines in the configuration file decides the step size when generating Gcode. The cross step is probably the most interesting as it decides how many passes the machine will do. Above it is set to 1/8. This means the machine makes 8 passes between each point in a cross section. Next we set the machine speed. You can set a separate speed for the stringer cut. The stringer is cut in two steps, first the machine passes 1 cm above the final cut and then it cuts the last cm to avoid cutting too much wood at the same time.

The latest version of the g-code generator reads the tool geometry from an STL-file. Use the tool name parameter to set the name of the file. You can also scale the tool using the tool scale parameters. This provides an easy way to adapt the dimension of the standard cutters provided with BoardCAD so they fit your tool without having to create a new STL-file.

There are two parameters for sandwich boards. If you are not making a sandwich board, just make sure they are set to 0.

Next follows the machine coordinates for the supports. Note that the current CNC interface works with mm and not with inches. The coordinates are given with respect to the tool tip. Place the tool tip at the center of the cup at support 1 and read the X Y Z values of the machine. Measure the radius of the cup. Repeat for support 2.

After that we have a 3 x 3 rotation matrix that shows which axes in BoardCAD that correspond to which axes in the machine. The first row gives the X-axes of the machine. In the example above 1.0 0.0 0.0 simply means that the X-axes of the machine is equal to the X-axes of BoardCAD. If we had put 0.0 1.0 0.0 in the first row the X-axes of the machine had instead been equal to the Y-axes of BoardCAD, and 0.0 0.0 1.0 would mean that the X-axes of the machine is equal to the Z-axes of BoardCAD. If we put -1.0 it means that the axes is inverted, i.e. a positive coordinate value in BoardCAD would translate to a negative value in machine coordinates. Each machine axes should correspond to a single axes in BoardCAD. In the example above X Y Z of the machine correspondes to X -Z Y in BoardCAD.

Following the three rows of the rotation matrix is a single row translation vector. This gives the position for the center of BoardCAD's coordinate system in machine coordinates. In the example above I've put the center 300 mm behind support1.

Finally we have added two parameters that controls if we cut the stringer or not, and if we cut the bottom of the rail. Simply change the 1 to 0 if you do not want to cut the stringer or the bottom rail.

The changes done in shapebot.txt are available as soon as you save the file and will be used next time you export g-code. You do not need to restart BoardCAD.


Choosing the correct cutter model

Having a correct model of your cutter is important in order for BoardCAD to be able to compensate for the tool geometry when generating tool paths. BoardCAD comes with models of three standard cutters: flatcutter, bullnose, and disc cutter. These are described below and should suit most users. If you want to use a different cutter you'll need to create a custom model as explained in the next section.


flatcutter.stl

This is a model of a standard flat cutter that can be bought in any hardware store. The model has a tool diameter of 20 mm and a tool length of 25 mm. You can scale it to other dimensions by using the tool scale parameters in shapebot.txt as explained above, e.g. to change the tool diameter to 30 mm and the to 50 mm set the tool scale to 1.5 1.5 2.0.

Image:Flatcutter.png


bullnose.stl

This is a model of a bullnose cutter as used by most shaping machines. The model has a tool diameter of 31 mm and tool length of 72 mm.

Image:Bullnose.png


disc.stl

Some shape machines use a large disc cutter. While standard routers usually rotates around the Z-axes, disc cutters typically rotate around the X-axes. This model is therefore symmetrical around the X. The tool diameter is 200 mm and the thickness of the disc is modelled to 5 mm. To change the tool diameter to 300 mm and the thickness to 10 mm you set the tool scale in shapebot.txt to 2.0 1.5 1.5

Image:Disc.png


Create a custom cutter

If the standard cutters provided with BoardCAD does not fit your tool you'll need to create a custom STL-file. This can be done in any CAD-software. Here I show you how I created the flat cutter described above using Rhino.


1. First I draw the profile of the cutter by using a line segment. Notice that I've chosen to slightly round off the edge of the tool. This allows BoardCAD to find a better match between the surface of the board and the surface of the cutter and makes the tool compensation more precise.

Image:Flat_cutter1.png


2. Next I create a surface by rotating the line segment around the Z-axes.

Image:Flat_cutter2.png


3. That's all there is to it. I can now export the tool model as an STL-file. Make sure to export in ASCII-format and not in binary format. I've chosen to name the file flatcutter.stl.

Image:Flat_cutter3.png


To use the new tool, put the stl-file in the same directory as BoardCAD.jar and set the tool name to flatcutter.stl in the shapebot.txt file.



Generating G-code from BoardCAD

Now we are ready to generate G-code for our machine! We assume that you have already modelled the board that you want to cut as well as the blank that is going to be used. Note that we work with NURBS-models. The current interface does not work with Bezier-models so if your boards or blanks are saved as .brd-files they should first be converted to NURBS-models and saved with .cad extension.

G-code is generated separately for the deck and for the bottom. Here we start with the bottom.


1. Load the blank file and choose "set as blank" in the 3D menu.

Image:Gcode1.png


2. Load the board file

Image:Gcode2.png


3. Right click and choose "view blank" in the popup menu

Image:Gcode3.png


4. Place the board inside the blank by using the commands "flip board", "translate x", "translate y", and "rotate" in the 3D menu

5. Choose "place blank" in the 3D menu to place the blank on the supports

Image:Gcode4.png


6. Generate G-code by choosing File, G-code, Nurbs to Gcode bottom.

Image:Gcode5.png


We can visualize the cutting paths directly in BoardCAD by choosing "View bottom cuts" in the popup menu.

Image:Gcode6.png


Next we generate G-code for the deck.

1. Choose "Flip board" followed by "Place board" in the 3D menu. This turns the board and make sure it is correctly placed on the machine supports.

Image:Gcode7.png


2. Generate G-code by choosing File, G-code, Nurbs to Gcode deck.

Image:Gcode8.png


Again we can visualize the cutting paths by marking "View deck cuts" in the popup menu.

Image:Gcode9.png


Machine the board

To machine the board all you have to do is to load the Gcode-file generated from BoardCAD into your machine controller, place the blank on the supports and press play. The result should be something like below:


Image:Gcode10.jpg

Image:Gcode11.jpg

Personal tools