CAM Workflow: PixelCNC
PixelCNC is an inexpensive but powerful program for processing images (and STL files) into toolpaths. When you first install, be sure to go to CNC/CAM Settings
under the Config
menu and select your Post-Processor
(e.g. GRBL (Metric).txt
) and your preference for Units of Measure
(e.g. Millimeters
). The Heightmap Export plugin uses millimeters, and using the same units throughout is quite nice. While you’re in there, you can also twiddle with Toolpath Simplify
and the other options if you so desire.
When you create a new project in PixelCNC, you will step through the icons on the left one after the next. Start with Project Setup
(the landscape photo) to load your heightmap and set model parameters, continue on to Cutting Tools
(the wrench/spanner) to define your carbide, move along to Project Operations
(the graph) to create your toolpaths, and then enjoy the CNC Simulation
(the film frame). Once you’ve stepped through the project icons one after the next, you return to the File
menu to export your G-code (and save your project)… and then take a quick detour through a text editor to split the G-code file by tool. So, on to the detailed steps…
Project Setup (first icon)
- Click
Load Image
and load your heightmap PNG. - Click
Input Size/Origin
to show theInput Dimensions
section on the top right of the screen. - In the
X-Width
box, enter your model width on the X axis.- In the .ini file from Heightmap Export, the value named
x_width
in the[Model]
section is the width in millimeters.
- In the .ini file from Heightmap Export, the value named
- In the
Z-Depth
box, enter your model’s depth in the Z axis.- In the .ini file from Heightmap Export, the value named
z_depth
in the[Model]
section is the to-scale depth in millimeters. To compress or exaggerate the model’s Z axis, just scale it as desired.
- In the .ini file from Heightmap Export, the value named
- Set your origin.
For terrain relief model carves, I have found I prefer to use top of stock and centered as my origin (50% for
X-Offset
andY-Offset
, and 100% forZ-Offset
). PathTracer assumes Z-zero is stock top, so if you’re going to use it to engrave trails onto a terrain model, keepZ-Offset
set to 100%. - Click
Apply
. - If you’d like, you can add a
Smooth Radius
by clickingInput Properties
and entering it on the right.
Cutting Tools (wrench icon)
- Click a tool slot (e.g.
[01] none
) to open its entry on the top right. - Give the tool a
Name
. - Choose the
Type
.- Cylinder – Flat and ball nose endmills.
- Flat: Set
Corner Radius
to zero. - Ball: Set
Corner Radius
to half the diameter. (Just type in any too-large value and it’ll conveniently round down to half the diameter.)
- Flat: Set
- Tapered – Tapered endmills.
- Set the
Tip Diameter
(not radius),Taper Angle
, andFlute Length
. The calculated shank diameter shown in the graphic should match the actual diameter. If it doesn’t, double check your numbers.
- Set the
- V-Bit – V-bits, of course.
- Cylinder – Flat and ball nose endmills.
- Click
Apply
. - Continue from step one for each additional tool.
At least as of PixelCNC version 1.33a, you cannot yet save tools. This is annoying, but the rest of the process works so well, que sera.
Project Operations (graph icon)
- Click
New Operation
to open a new entry on the top right. - Give the operation a
Name
. - Choose the
Op
.I like
Horizontal
(basically “waterline” style) for roughing andParallel
(straight in X/Y while terrain-following in Z) at a 45° angle for finishing. Generating toolpaths is so fast and the simulation so easy, experimentation is certainly encouraged. - Choose your
Tool
and settings.I do have my personal settings, which might be not dangerously bad for southern yellow pine dimensional lumber on a Shapeoko with a quarter-inch ball and a 0.5mm-radius tapered mill, but I’ll just call machining settings beyond the scope of this writeup… except to say that you probably do want to check
Rest-Machining
, one way or another. - Click
Apply
. Toolpaths will generate. - If you’re doing multiple operations (e.g. roughing, then finishing), which you obviously are, continue from step one for each additional operation.
CNC Simulation (film frame icon)
- Just play around with it, especially at very high speeds.
Exporting and manually splitting your G-code
- Click the
File
menu, then clickExport G-Code
. - Save the .nc file.
PixelCNC also does not split files by tool, so we’ll do that manually. Another annoyance, but everyone should get at least a little comfy with G-code, really.
- Open the .nc file in Notepad++ (or the text editor of your choice).
- Each operation begins with a
( Tool: 1 )
(or 2, 3, et cetera) comment line. Cut and paste the header, i.e. everything above that first( Tool: 1 )
, somewhere convenient. - Find (e.g. Ctrl-F) the next line starting with
( Tool:
If you don’t find a second line, you’re on the last tool, so just select all.
- Copy your saved header, plus everything above that second
( Tool:
line, into a new file for that tool.For completeness, you can add a line with just
M30
, i.e. “End Program” in G-code, at the bottom of each file. - Repeat from step 5 until you reach the end of the combined file PixelCNC exported.