LinuxCNC for 4 Axis CNC Foam Cutters

You’ve built your 4-axis CNC Foam Cutter, and now you need some software to send the g-codes to hotwire cut your foam wing or fuselage. LinuxCNC is a great software which sends g-code to your foam cutter. For the hobbyist, you need to use the old parallel printer port. It won’t work with a USB connection, but there are several add-on cards made by MESA that will work but are a little bit pricey and not that easy to configure.

wing gcode linuxcnc

Update: I don’t use LinuxCNC or Mach3 anymore for foam cutting for two reasons:-

  • I don’t have any parallel port PC’s anymore. They were showing signs of failure and took a lot of space.
  • Since building my new machine I switched to an Arduino-based microcontroller using a laptop with USB. This takes up a lot less space. Here are all the details on the new build How to Build a $200 USB Hot Wire CNC Foam Cutter – Free eBook

Using Linux CNC with modern computers

If you want to use LinuxCNC with a modern computer the most affordable option is the Mesa Ethernet adapter. If you check the comments below a very knowledgeable guy called Andy Pugh on the LinuxCNC forums recommends two boards. So if your parallel port computer has just died this could be the answer.

Please note I have never used a Mesa adapter so your best source of information is the LinuxCNC forums.

If you have an old PC with a parallel port LinuxCNC works well for cutting foam wings. It even has special modes for 4-axis foam cutters.

How to install LinuxCNC for Hot Wire Foam Cutting

I have an article on this site explaining how to install and configure LinuxCNC for CNC routing. https://rckeith.co.uk/free-linuxcnc-openbuilds-ox-router/ I would encourage you to read this first. The only real differences are in the configuration files, all the steps up to “Stepconf for TB6560 Motion Controller” are the same for the foam cutter. Read as far as that and then come back here.

My old hotwire machine ran for several years on the TB6560 controller and NEMA23 steppers and was very reliable. It’s not in full-time operation but I did run it for several hours in one session without any issues.

The reason I mention this is that the cheap Chinese boards come in for a lot of bad press but I couldn’t fault mine. If you’re looking at this post you’re probably trying to avoid spending a lot of money on software as well, such as Mach3 at $175. You can if you follow this article get foam wing cores and many other designs all using free software. Read on to find out how.

If you want to build a hot wire CNC machine then check out my build page with an eBook and parts list. https://rckeith.co.uk/cnc-hot-wire-foam-cutter/ I also now have a USB option here https://rckeith.co.uk/how-to-build-a-usb-cnc-hot-wire-foam-cutter/ but this doesn’t work with LinuxCNC it uses 3d printer electronics and the GRBL HotWire Controller.

LinuxCNC stepper configuration

My configuration is based on the TB6560 all-in-one board but should work on many others, but the pin assignments on the parallel port may be different, so check your documentation.

If your machine doesn’t have a parallel port, the most cost-effective way to do this is with a PCI Parallel Port card.

I also used homing and limit switches and an E-stop for safety. It took me some time testing to get working, but it worked with all axes going in the right direction and home and limit switch’s triggering. My home and limits were wired in series so it only needs 1 pin.  You can wire separately and the will home altogether but that means using more input pins and wiring.

LinuxCNC has a foam option that can be specified in the configuration. The display then shows a 4 axis foam cutter, which is very good. The only caveat is that your axes must be named XYUV, not XYZA. Later we add the option foam =1 to the ini file that’s created by stepconf and some other setting.

Initially, you can use the Stepconf wizard but after that, we need to make a few changes to the ini file created by the wizard. If you re-run the wizard it removes the entries. More details later.

Step 1 – Create a new configuration

We start off using the stepconf wizard to get the initial settings, but then we need to edit the ini files in our config folder to add the necessary settings for a foam cutter

Give your machine a name I’ve called mine foam-cutter, but you can name it anything you like. Set the Axis configuration to XYZA (we change to XYUV later) and machine units to your preferred units. My settings are based on millimetres MM. Enter your Base Period Max Jitter. My post linked above shows how to get this figure and I have a video on YouTube https://youtu.be/F4xHCwtaS3w that shows the process. Don’t guess this figure or your machine may not work very well or not at all.

Step 2 – Parallel port config for TB6560

This is for a Chinese 4-axis TB6560 often called the blue board, like the ones below from Amazon. If you are using something else then check your documentation

QtyDescription
1 4 Axis TB6560 Controller Board
14 Axis TB6560 Controller Board
All in one with power supply.
Drivers all on one board are usually cheaper
4NEMA 23 Stepper Motors 57BYGH56-401A or similar.

Set the pins as below. If you’re not using home and limit switches, set pin 10 to unused.

LinuxCNC ports foam cutter
LinuxCNC ports foam cutter

Step 3 – Axis Configuration

I’m using a 10mm x 1.5 pitch threaded rod for the lead screws and have found that the Maximum Velocity set at 4.5 works well, any higher and steps get missed. But using the Test this axis button you can fine-tune your settings.

My machine has an X and U travel of 600mm and a V and Y of 300mm. Set the dimensions to suit your machine.

The settings below should be a good basis to get your machine working but you may need to fine-tune when testing your axis.

linuxcnc x axis

Set the Y-axis

LinuxCNC stepconf z axis foam cutter
LinuxCNC stepconf y axis foam cutter

The Z-axis will become the U-axis

LinuxCNC stepconf z axis foam cutter
LinuxCNC stepconf z-axis foam cutter

The A-axis in the stepconf wizard assumes you are using a rotary axis, but ignore the deg labels and set it as below. We will amend the config file to change it to a linear axis later. This becomes the U-axis.

Now we are done with the stepconf wizard. and you should have a launcher and a folder with your config.

Editing the config files for foam cutting

I’ll include my ini file which you can download and use. Use a text editor, MousePad is the LinuxCNC default application for this and works fine.

Icon

LinuxCNC foam cutter hal file 4.54 KB 974 downloads

Hal file to work with 4 axis foam cutter and TB6560 all in one board confgiured with…
Icon

LinuxCNC foam-cutter.ini 2.53 KB 895 downloads

This is the foam cutter ini file for a 4 axis TB6560 …

On the desktop, you should have an icon that corresponds to your machine name

folder icon

I called mine foam-cutter, so open this folder and double-click on foam-cutter.ini. Make a copy first just in case you need to go back.

Add the following lines to the [DISPALY] section

FOAM = 1
GEOMETRY = XY;UV
OPEN_FILE = ./foam.ngc

Find the [TRAJ] section and change to this:

AXES = 9
COORDINATES = X Y U V

It seems odd to have 9 Axes in this but it has to do with the way the axes are referenced

Now change Axis 2 and 3 to 6 and 7

Change [AXIS_2] to [AXIS_6] 
Change [AXIS_3] to [AXIS_7]

Change Axis 7 to Linear

[AXIS_7]
TYPE = LINEAR

Save this file

Now we need to make a few changes to the foam-cutter.hal. Once again make a copy and change as below. Use Find and Replace in the editor, Usually called MousePad in LinuxCNC

Change [AXIS_2]  to [AXIS_6]
Change [AXIS_3]  to [AXIS_7]
Change axis.2. to axis.6.
Change axis.3.  to axis.7.

Save your file.

Now you should be able to launch your configuration. Double-click on the Launch Foam Cutter or use the Config Picker from the CNC menu.

The image below shows how it should look with a g-code file loaded in.

wing gcode linuxcnc

Sample g-code

Here is some sample g-code to try. It uses a Clark-y airfoil and has a root chord of 250mm. This can be loaded into LinuxCNC and you should see a similar image to the one above.

Icon

G-code Clark-Y (XYUV) 250mm Root chord wing – LinuxCNC 4.28 KB 1210 downloads

This g-code accompanies the article LinuxCNC for 4 Axis CNC Foam Cutters This…

You may have to experiment with current and feed for your hot wire. I used very thin Ni-Chrome wire about 0.4mm and the iCharger 206B with a foam cut option.  All the iChargers have this option and you can you most chargers with a NiCad mode. Start at around 2 Amps and then adjust until you get a good cut without the wire dragging or burning away too much foam.

Here is the video showing all the steps above.

YouTube player

My foam-cutting playlist

Conclusion

Using LinuxCNC software to control the foam cutter is quite easy. The Axis display for foam cutting on LinuxCNC is good. I have upgraded to DevWing Foam2 for generating g-code, it’s not free but well worth the money in my opinion.

Happy foam cutting

Similar Posts