Can I set Lua variables using cut rules?
Posted: Mon Nov 28, 2022 1:24 am
I'm a bit of an impasse with my (custom) plasma setup. The controller uses GRBL and I'm using spindle speeds to control my torch height control (THC) and turn it on/off.
I thought this would be simple to set up cut rules for -- just add S400 or S800 to turn the THC off/on and I'm set, right? But it turns out that GRBL (even in laser mode) has some funny behavior with this. If the spindle speed command is on the same line as the G1, it continues motion normally (which is what I want). If the spindle command is on a new line in the G-Code then it pauses, which is what I don't want.
But I can't get SheetCAM to output this on the same line because the "code snippet" feature adds a new line. Is there any way at all to set a variable in Lua instead? If I could access the cut rules somehow in the post processor, my problem would be solved. But as far as I can tell, SheetCAM can't do this. Is there any way?
(I've tried working around this problem by setting the code snippet to "G1 S400", this doesn't work either.)
I thought this would be simple to set up cut rules for -- just add S400 or S800 to turn the THC off/on and I'm set, right? But it turns out that GRBL (even in laser mode) has some funny behavior with this. If the spindle speed command is on the same line as the G1, it continues motion normally (which is what I want). If the spindle command is on a new line in the G-Code then it pauses, which is what I don't want.
But I can't get SheetCAM to output this on the same line because the "code snippet" feature adds a new line. Is there any way at all to set a variable in Lua instead? If I could access the cut rules somehow in the post processor, my problem would be solved. But as far as I can tell, SheetCAM can't do this. Is there any way?
(I've tried working around this problem by setting the code snippet to "G1 S400", this doesn't work either.)