THC(9)
π thc β Torch Height Control π
okay bestie, welcome to the thc page from the HAL Component section (that's a section 9 page, kernel/HAL girlies rise π«Ά). Sit down, hydrate, and let's talk torch height control because this one literally controls a plasma torch's Z height in real time and it's giving main character energy π₯
β¨ SYNOPSIS β¨
loadrt thc
That's it. That's the whole vibe. Just load the realtime component and go π
π¦ DESCRIPTION π¦
Torch Height Control Mesa THC > Encoder > LinuxCNC THC component β like, that's the whole pipeline, chain of custody, the way that the signal travels through the system π
So here's what's happening: the Mesa THC sends a frequency based on the voltage it detects over to the encoder. Then the velocity coming from the encoder gets converted into volts using the velocity scale parameter that lives inside the THC component. That's the glow-up: frequency in, volts out β¨
The THCAD card sends a frequency at 0 volts, which is lowkey annoying, so the scale offset parameter is there to zero out the calculated voltage. Rude of it, but the fix is built in π
π Component Functions π
- If it's enabled and the torch is on and the X + Y velocity is within tolerance of set speed, allow the THC to offset the Z axis as needed to maintain voltage. Bestie is literally doing the work to keep that voltage steady, periodt.
- If it's enabled and the torch is off and the Z axis is moving up, remove any correction β but at a rate not to exceed the rate of movement of the Z axis. Respectful, no fighting the Z, we don't do that here π
- If it's enabled and the torch is off and there is no correction, pass the Z position and feed back untouched. Zero drama, zero interference β¨
- If it's not enabled, pass the Z position and feed back untouched. It literally does nothing and honestly? Iconic of it πΈ
π§ Physical Connections π§
Plasma Torch Arc Voltage Signal => 6 x 487k 1% resistors => THC Arc Voltage In
THC Frequency Signal => Encoder #0, pin A (Input)
Plasma Torch Arc OK Signal => input pin
output pin => Plasma Torch Start Arc Contacts
Yes, 6 x 487k 1% resistors β careful, do not improvise on that part, the resistors are not a suggestion π
π HAL Plasma Connections π
encoder.nn.velocity => thc.encoder-vel (tip voltage)
spindle.0.on => output pin (start the arc)
thc.arc-ok <= motion.digital-in-00 <= input pin (arc ok signal)
β HAL Motion Connections β
thc.requested-vel <= motion.requested-vel
thc.current-vel <= motion.current-vel
π₯ FUNCTIONS π₯
thcβ requires a floating-point thread. Float thread only, no cap. Do not try to put it in a non-float thread, it will simply not eat π
π PINS π
thc.encoder-velfloat in β connect tohm2_5i20.0.encoder.00.velocitythc.current-velfloat in β connect tomotion.current-velthc.requested-velfloat in β connect tomotion.requested-velthc.volts-requestedfloat in β Tip Voltscurrent_vel >= min_velocityrequestedthc.vel-tolfloat in β Velocity Tolerance (Corner Lock)thc.torch-onbit in β connect tospindle.N.onthc.arc-okbit in β Arc OK from Plasma Torchthc.enablebit in β Enable the THC; if not enabled Z position is passed throughthc.z-pos-infloat in β Z Motor Position Command in fromaxis.n.motor-pos-cmdthc.z-pos-outfloat out β Z Motor Position Command Outthc.z-fb-outfloat out β Z Position Feedback to Axisthc.voltsfloat out β The Calculated Voltsthc.vel-statusbit out β When the THC thinks we are at requested speed (its little confidence flag π₯Ή)thc.offset-valuefloat out β The Current Offset
πΈ PARAMETERS πΈ
thc.vel-scalefloat rw β the scale to convert the Velocity signal to Voltsthc.scale-offsetfloat rw β the offset of the velocity input at 0 voltsthc.velocity-tolfloat rw β the deviation percent from planned velocitythc.voltage-tolfloat rw β the deviation of Tip Voltage before correction takes placethc.correction-velfloat rw β the amount of change in user units per period to move Z to correct
Reminder bestie: those parameter names are exact. Type them wrong and you'll get nothing, and the nothing will be your problem π
π AUTHOR π
John Thornton β we stan π«Ά
π LICENSE π
GPLv2 or greater β share it, remix it, credit it, slay responsibly β¨
Okay that's the whole page, no skips, no summarising, every single pin and parameter present and accounted for π
This cutie was brought to you by LinuxCNC Documentation, dated 2026-03-17, and the manual section is THC(9). Go forth and control that torch height, bestie, you've got this ππ
π¦ where this page comes from
- ubuntu resolute: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms