This documentation is no longer maintained. For documentation of the current version of emc2, please see




thc − Torch Height Control


loadrt thc [count=N|names=name1[,name2...]]


Torch Height Control using a Mesa THC-AD board. The voltage signal from the plasma torch is converted to a frequency by the THC-AD board. This frequency is fed to an encoder. The velocity output from the encoder is fed into the THC component.

The tip voltage rises as the distance increases.

While testing no change is made to z_pos_out it is just passed through

While enabled and torch is on when x+y velocity is above minimum add correction to current z position.

While enabled and torch is off and z is raising up remove any correction as the torch moves up.


thc.N (uses floating-point)


thc.N.volts-setting float in

Torch Volts Set Point (SP)

thc.N.p-gain float in

The Proportional Gain (Kp)

thc.N.i-gain float in

The Integral Gain (Ki)

thc.N.d-gain float in

The Derivative Gain (Kd)

thc.N.enable bit in

Enable the THC, if not enabled Z position is passed through

thc.N.chl-enable bit in

Enable the Corner Height Lock

thc.N.vel-tol float in

Percent of Velocity Deviation 0.00-1.00

thc.N.spindle-on bit in

Motion Spindle On

thc.N.arc-ok bit in

Arc OK from Plasma Torch

thc.N.encoder-vel float in

Velocity Output in User Units per Second from Encoder

thc.N.set-vel float in

the commanded velocity of XY

thc.N.x-vel float in

Used to compute velocity

thc.N.y-vel float in

Used to compute velocity

thc.N.z-pos-cmd float in

Z Motor Position Command In

thc.N.z-pos-out float out

Z Motor Position Command Out

thc.N.x-y-velocity float out

The X + Y velocity

thc.N.volts float out

The calculated Volts

thc.N.vel-out float out

The velocity reading from the THC

thc.N.p-out float out

the Proportional Term correction

thc.N.i-out float out

the Integral Term correction

thc.N.d-out float out

the Derivative Term correction

thc.N.correction float out

the total correction

thc.N.smoothed float out

the Input after smoothing bit out

On when within tolerance of speed

thc.N.test float out

used for testing


thc.N.vel-scale float rw

The scale to convert the Velocity to Volts

thc.N.scale-offset float rw

The offset of the velocity input at 0 volts

thc.N.volt-dist-scale float rw

The Voltage Distance Scale

thc.N.volts-tol float rw

The Voltage Tolerance.

thc.N.i-cap float rw

The maximum Integeral error.

thc.N.input-gain float rw

The maximum change between inputs


John Thornton