
This is a great CNC plasma resource Linux CNC Plasma Primer
Note: This is only for plasma cutters with an arc OK signal
M3 (S Values are not needed)PlasmaSpindle:
enable_pin: gpio.12
arc_ok_pin: 'gpio.36:low'
arc_wait_ms: 3000
tool_num: 0
speed_map: 0=0.00% 1=100.00%
off_on_alarm: true
atc:
m6_macro:
s0_with_disable: false
disable_with_s0: true
You could use normal probing with a floating Z or Ohmic sensor (contact)
The native analog input circuits on the ESP32 are not very good. We don't think they would work well for this. We also don't like the idea of such a direct connection to such a noisy device is a good idea.
Use an external THC that controls the height while cutting and lets FluidNC control it when not cutting.

Some THCs send up/down signals to the controller and the controller takes care of the Z motor steps. We do not support this yet.
Notes Only: This is not yet supported in FluidNC.
When the machine slows for a corner, small feature or end of cut, the plasma voltage may change due to the slower speed. To prevent the THC from incorrectly compensating for this, the controller can inform the THC of the slow down to disable the THC compensation. This is typically a digital signal.
FluidNC might be able to use the spindle rate adjusted feature, like in laser mode,to generate that signal on a pin like the standard output_pin. When rate adjustment kicks in or reaches a level, the pin could be activated.
If you want this feature be prepared to donate heavily to the project. This would be quite a bit of work and the devs do not have any plasma hardware to test on.
Here is a sample of the gcode.
G01 Y19.00 S1 ; turn on THC
G01 Y20.00 S0 ; turn off THC
The firmware would very complicated. You have gcode that says cut this path at this height. This goes into a complex motion planner to keep it smooth and fast and starts that motion.
During that motion you have a real time activity monitoring the arc voltage. If that voltage changes you need to change that plan in real time without affecting the quality of the motion.
That is a constantly changing situation and you really need a PID algorithm, like the temp on a printer hot end, to prevent overshoot and get there as fast as possible..
Unlike a hot end, you cannot just slam on the heater when you are far from the the target. The whole time you also need to respect the acceleration and speed limitations of the motor.
It is not impossible to do of course and we have discussed methods many times, but not a priority at this time. We would need a bunch of users to show they are really interested in this by sponsoring it.
This is a proposed Gcode example. is a simple job of cutting 2 squares. This assumes you have homed and set the work X0 and Y0 before starting the job.
M3 starts the plasma and waits for an arc OK signalG17 ; XY Plane
G21 ; set units
G54 ; set coordinate system
G90 ; set absolute position mode
M6 T1 ; optional. Select spindle and tool
G0 Z20 ; go to rapid move height
G0 X10.0 Y10.0 ; move to first cut
; first cut
G38.2 G91 F300 Z-100 P20 ; Floating Z. Probe in relative position and set 0 position
G90 ; set absolute position mode
G0 Z3.0 ; move to arc start position
M3 S1 ; start plasma, S value is optional and not used.
G4 P0.5 ; pierce time
; start cut
F1000 ; set cutting feedrate
G1 Y60
X60
Y10
X10
M5 ; turn off plasma
; cut done
G0Z20 ; return ro rapid height
G0X110.0 Y110.0 ; move to second cut
; second cut
G38.2 G91 F300 Z-100 P20 ; probe in relative position and set 0 position
G90 ; set absolute position mode
G0 Z3.0 ; move to arc start position
M3 ; start plasma
G4 P0.5 ; pierce time
; start cut
F1000 ; set cutting feedrate
G1 Y160
X160
Y110
X110
M5 ; turn off plasma
; cut done
G0 Z20 ; return ro rapid height
G53 G0 Z-1 ; move to top of Z
M30
This is what you will see if send M3 and the plasma cutter does not send the arc_ok signal.
Grbl 3.9 [FluidNC v3.9.4 (PlasmSpindle-ae36fe45) (wifi) '$' for help]
M3
[MSG:ERR: PlasmaSpindle failed to get arc OK signal]
ok
[MSG:INFO: ALARM: Spindle Control]
ALARM:10
This is what it should look like if you activate the arc_ok signal right after the M3.
M3
ok
This is what it should look like if you activate the arc_ok signal right after the M3 and then release the arc_ok
M3
ok
[MSG:INFO: ALARM: Abort Cycle]
ALARM:3