Plasma CNC and THC with PlanetCNC TNG

Plasma CNC cutting machine is one of the most commonly used types of CNC machine.

It’s used mostly for cutting Steel, aluminium and other conductive materials.

Like any other type of CNC machine, plasma machine has it own specifics. Machine should be properly designed for such type of machining, considering slag, steel dust, high temperatures, moisture, grease etc..

For plasma CNC machine we recommend using Mk3 controller for its Ethernet support. Ethernet protocol is more robust than USB and therefore more suitable for industrious environments.

Plasma cutter is a great source of electromagnetic interference. So special care should be taken into account when wiring machine electronics.
Be sure to use shielded cables for motors, limit switches. External power supply for motion controller is very recommended. Plasma cutters itself sometimes do not satisfy standards of electromagnetic compatibility (EMC), so make sure that your plasma cutter is within EMC regulations.

Special approach should be considered when designing toolpath program for plasma CNC machines. The reason for this is when plasma ignites and arc pierces trough material, this leaves a mark on material. So your work-piece could be well off from specified dimensions. For this purpose toolpath should include lead in and lead out moves. User should also pay attention to ignition delays, pierce heights etc..
You can use special CAM software intended exclusively for plasma cutting. SheetCAM software offers wide range of plasma toolpath options and it is very user friendly. PlanetCNC post processor is available.

Heat emitted from plasma could deform workpiece material, usually metal sheet, in such case plasma cutter would not cut at constant height which could result as a faulty workpiece or could damage plasma cutter in the process. This is usually solved with THC device. THC stands for Torch Height Control.

THC device measures arc voltage. Bigger the distance between the plasma torch and material higher the voltage and vice versa. So based on the voltage value we can maintain constant height of plasma torch above the material. THC device sends control signals to motion controller which then dynamically compensates Z axis and thus maintains constant cutting height.

Parameters related to THC are located in: File/Settings/Control/THC

Select Machine axis that would perform THC compensation moves. Usually this is Z axis

Dec Pin:
Select decrease input pin of controller. Pin is located at Input header. This pin will receive compensation signal for axis movement in negative direction.
Inc Pin:
Select increase input pin of controller. Pin is located at Input header. This pin will receive compensation signal for axis movement in positive direction.
OK Pin:
Select OK Arc input pin of controllers. Pin is located at Input header.
Range Min:
Minimal height compensation value oppose to relative Z0.
Range Max:
Maximal height compensation value oppose to relative Z0.
Speed is step/cycle time. This should be set by testing, try finding value that suits your machine. Recommended values are from 1-10.


PlanetCNC TNG software uses dedicated g-code to enable and disable THC device. G-code M54 P1 enables THC, M54 P0 disables it.

M3 (turn plasma on)
G04 P.2 (delay for 0.2 seconds)
M54 P1 (turn THC on)
G01 X10 Y10
M54 P0 (turn THC off)
M5 (turn plasma off)

Floating Z axis

Sometimes we need to modify our CNC machine in order to achieve our machining goals as quickly and as efficiently as possible. CNC machines such as plasma, plotter cutters, lasers need mechanism that helps with measuring of material surface.

Good example of such modification is Floating Z axis.

The concept is pretty straight forward:  Z axis has its own movable unit which is able to move when tool encounters with material surface.

Floating Z axis on a plasma machine is a safety feature that prevents any serious damage of your plasma torch, in case of hitting any obstacles on located on machine table.

For plotters and drag knife cutters,   floating effect comes handy because it is much easier to apply pressure of the pen or  knife onto material surface (paper, carton, vinyl etc) without the frustrating trial and error procedure.

Floating Z axis can also be used for measuring material top surface. In such case, floating z axis unit uses limit switch. When Z axis moves down towards the material, activated switch signals controller that surface of material was detected and zero work position of Z axis can be set.

This procedure is similar to movable tool sensor, except that thickness value is negative. See bottom of this page for more details.


Example of floating Z axis:


Example of floating Z axis on plasma machine using limit switch:


Obtaining thickness value on plasma machine with floating Z axis:

Full tutorial about movable tool sensor can be found here:

Slowly jog Z axis towards the material surface, so that the nozzle of plasma torch is just barely touching the surface of material. You can help yourself by adding a sheet of paper between torch nozzle and the surface of material. Start moving the paper and when you are not able to move paper anymore, set work position Z to Zero.


Now jog Z axis further more in -Z direction. When floating Z axis limit switch will activate, write down position value of Z axis. This is your thickness value.


You can make your own floating Z axis unit. 3D and STL files are published here:

How to setup CNC machine using PlanetCNC software and controller?

I will try to show you how to setup your CNC using PlanetCNC software. I will use my router machine as an example but you can do it similar way on all machine types. I use metric (millimeter) units but everything is same with imperial (inches) units except numbers are different (1mm is apporximately 0.03937in).


“Steps per unit” settings are already calculated and set. You should verify that distances in all directions are correct when machine moves. If position display changes for 100mm then machine should move 100mm.
If your SPU is not yet set please read SPU tutorial: How to set Steps Per Unit values?

First we need to set offsets to zero. Working offset should be set to zero with command “Machine/Offset/Zero”. “Empty” tool should be selected with with “Machine/Tools/Select/Empty” and tool offset should be set to zero with with “Machine/Tools/Zero Tool Offset” command. These commands will be explained later. For now it is important that everything is set to zero.

Limit switches

Machine that I will use has 5 limit switches. Two limit switches on X, two on Y and one on Z axis. To verify that all limit switches are working, trigger switch with hand and position display will become red or purple.


Triggered limit switch should stop machine. Machine should go to e-stop mode. To do this “Limit Switches Stop” checkboxes should be checked.


To verify that limit switches stop the machine, jog in direction of limit switch and trigger it with hand. Machine should stop. Be careful not to hurt yourself. Your hand near moving machine in usually not good idea so keep safe distance.


When machine stops you should be able to jog in opposite direction. All 5 limit switches should be verified like this.

Limit switches can be used as reference switches. This means that we will use them to set machine absolute coordinates. This is known as homing.


We need to choose where machine absolute zero position is. Usually machine works in relative coordinates and it is not really important where absolute zero is. What is important is, that it is always at same position. I will put some tape to mark it so that you will see it better on image.


Tool is put in spindle and machine is jogged to this position. Be careful not to crush tool into machine table when you descent Z axis. You can just loosely tighten tool in spindle and if accident happens nothing will be damaged.


This position should be machine absolute zero. Commands for changing machine absolute position are in menu “Machine/Set Position”. Because it is usually not good idea to change absolute position make sure that “Machine/Set Position/Enable” is checked to enable these commands. Later we will uncheck this to prevent unwanted absolute position change. Now we can execute “Machine/Set Position/Zero” command and set absolute position to zero.


You will notice that position display now shows all zeros.


Slowly jog Z axis up until Z+ limit switch is hit and machine stops. Position display will be purple.

9 10

Write down Z position (253.8375mm in this case). Jog in opposite direction so that limit switch is released.

Repeat this for X axis.
Slowly jog in X- direction until limit switch is hit and machine stops. Position display will be red.

11 12

Write down X position (-127.6833mm in this case). Jog in opposite direction so that limit switch is released.

And again for Y axis.
Slowly jog in Y- direction until limit switch is hit and machine stops. Position display will be red.

13 14

Write down Y position (-223.6188mm in this case). Jog in opposite direction so that limit switch is released.

We now have limit switch positions for all 3 axes and we can set homing.

Open settings, section “Axes/Homing” and check “Enable”.

Usually we want to home Z axis first so we set “Sequence” for Z axis to be “1”. Then we will home X and Y at same time so we set “Sequence” for X and Y to be “2”.

When machine triggers limit switch during homing it stops in a moment. That is why we need to approach limit switch with slow speed. In this tutorial we will set “Speed” to 500mm/min but each machine is different and you should find what works on yours.

We used Z+, X- and Y- limit switches in this tutorial. This is set with “Direction” setting.

Perhaps you noticed that when switch is triggered you need to move back short distance to release it. Some switches need longer distance, some very small, but all switches need this. For switches on this machine 3mm is good value. This is set as “Return Distance”. Switch actually requires a lot less but this is good safe value. Don’t use 0!

For “Set Position” value we will use limit switch positions that we measured earlier. We will add/subtract 3mm that we used for “Return Distance”.

With “Go To” we set where we want machine to go after limit switch is hit. Machine will be at this position be after homing. Usually it is X0 Y0 and Z at some safe height. We know now that machine highest Z position is 250.84 (we measured this few steps back) so Z200 seems like a good value.

Normally machine first moves to all limit switches first and goes to “Go To” position at the end. If we want to change this order and move to final position as soon as axis triggers limit switch we can check “Go To First”. Some machines need this to avoid clamps. This machine does not need this.

Here are all these settings:


We can close settings and “Machine/Home” command will be enabled (if it is not then press E-stop twice to force display refresh).

We are ready to execute “Machine/Home” for first time. There is also button on toolbar for this. As always, be ready to hit e-stop is something goes wrong.

After homing machine is at X0 Y0 Z200. This is exactly 200mm over marking that we made.

16 17

Machine is homed and now we can use absolute coordinates. We can move machine anywhere we want and we will know exactly where it is. It is important not to change absolute position. We will uncheck “Machine/Set Position/Enable” now.


If your machine losses steps for any reason you’ll need to do homing again.

Table size

Now that we can move machine anywhere we want and we know exactly where it is we can use this to measure machine table. We will slowly jog machine to X+ and Y+ direction until limit switch is hit and then back a little so that switch is released. Write down position. It is X813.8000mm and Y460.4208mm.

19 20

Table is measured and we will use this data to set machine limits and enable soft limits. Orange box on 3D display is now accurately representing machine working space.


Soft limits

Soft limits are used to decelerate machine to stop before machine is stopped hard way at limit switch or before it crashes. I recommend “Soft Limits Decelerate” and “Soft Limits Strict” settings are also checked. Sometimes we need to disable soft limits and there is a command for this in menu “Machine/Soft Limits”. When soft limit is triggered position display will be yellow.

Measuring tool offset with fixed tool sensor

We can now set fixed tool sensor. Fixed tool sensor is usually used to measure tool length offset. We need to have machine homed so that we can use absolute positions. On machine used for this tutorial, fixed tool sensor is located in corner and connected to INPUT5 pin. In this tutorial I use switch with lever which is good for tutorial but should not be used on real machine. Switch lever is not horizontal and it will not give accurate results.


First we will enable tool sensor in settings. This will enable sensor related menus and commands. Then we need to test if it works. Trigger sensor with hand. Word “Sensor” should appear on software status bar. Now we need to test if sensor stops machine. Jog machine away from sensor and to high Z position. Then slowly jog down and trigger fixed sensor with hand. Machine should stop.

Jog machine so that tool is directly above sensor. Slowly jog down until tool triggers sensor and stops. Write down position. In this case it is X-111.6854mm, Y453.2417mm, Z34.8979mm.


Open setting again, section “Tool Sensor”, group “Tool Sensor Fixed”. We set X and Y “Location” of our sensor. We could also set lead-in “Move” but for most machines this is zero. We need to set “Speed” which should be small because of momentary stop when tool triggers sensor. “Direction” is usually set to -. Because of long lever on my sensor switch “Return Distance” is quite large. I will set it to 5mm. We also have Z position of sensor and we can set “Set Position Z” value. Usually we want to move machine around at maximum possible Z height. This machine has Z+ limit is slightly above 250mm. 250mm will be good value for “Safe Height”. “Return” checkbox enables automatic return to position before tool length measurement.


Now we can test if tool offset measuring with fixed tool sensor works.

Jog machine somewhere in the middle and execute “Machine/Tools/Measure Tool Offset”. There is also button on toolbar for this. As always when you do something for first time – be ready to hit e-stop.

If everything is correct machine should go rapidly up tu safe height, then traverse to fixed sensor location. Then it will descend at low speed until sensor is triggered. Machine will return back a distance to release sensor and use its Z position to calculate tool offset. Then it will rapidly move up to safe height, traverse back to original position and then move down until tip of your tool is at same Z height as it was before.

When tool offset is active small checkbox labeled “T”, just above position display, will be enabled. If this “T” checkbox is checked then position display will include tool offset.

It is important to get familiar with “Machine/Tools/Measure Tool Offset” command. See my video where I change tool length and it always returns to same position. Note how I’m doing this so that even if something goes wrong I still have time to press e-stop.