Torch control g-code: need deactivated torch to activate and deactivate automatically

@Mike7 ,
I’ll add that normally the post flow air is intended to cool the torch tip so consider that aspect before making the change.

based on your controller, you should be using ‘GRBL plasma.scpost’ or ‘GRBL plasma no Z.scpost’. In either case, if you desire to ‘double trigger’ the torch at end of cut, then make this change to the post processor…

in OnPenUP() function…
change:
function OnPenUp()
post.Text (“M5\n”)
to:
function OnPenUp()
post.Text (“M5\nM3 S1000\nM5\nM3 S1000\nM5\n”)

btw…
Since you are using an Arduino board, IF it is Uno model and IF you have XYZ limit switches, then pin D11 is likely firing the torch. D11 is a PWM signal which is controlled by ‘M3’ AND ‘S’ (spindle speed or laser power) gcode word, so you should also make the following change…

in OnPenDown() function…
change:
post.Text (“G0”)
post.NonModalNumber (“Z”, pierceHeight * scale, format)
post.Text (“\nM3\n”)
to:
post.Text (“G0”)
post.NonModalNumber (“Z”, pierceHeight * scale, format)
post.Text (“\nM3 S1000\n”)