Any clever people out there know how to create a looping gcode program that can work on the smoothie?
Does smoothie support loops? I was trying to do it in marlin for printer thing I was building the other day and no dice.
I know M41 exists but I dont think its supported anywhere and it does a permanent loop until reset.
Do, while and counter loops would be rad.
no they are not supported, I have only ever seen them in linuxcnc. TBH they would need to be supported by the host not smoothie as it needs to have the entire gcode file in memory
or in a file locally accessible)
Thanks for the replies.
Looks like we’ll have to stick with copy/paste, copy/paste, copy/paste…!
you could add a feature request to laserweb to add this kind of support like the linuxcnc subroutine and loop stuff. should be much easier to do there it would loop on the host and just send gcode as normal. If I didn’t hate javascript I might have considered adding it myself
I wonder if other languages are supported as plugins
I thought it just needed to run under node? isn’t most of the javascript running under node?
https://github.com/openhardwarecoza/LaserWeb4/tree/dev-es6 is the latest and cleanner
heh you can’t put lipstick on a pig and call it pretty sorry but I am not a fan of javascript in any of its forms )
A note on the loop stuff : I am in the process ( well, I started, and did not finish, a while ago. Works but bugs to fix ) of adding support for “recursive” file playing in Smoothie.
The main goal here is to have a simple/easy implementation of tool change routines, and the ability to easily map gcodes to custom files.
Technically this feature means you could have inside of a file, a “play /sd/file2.gcode” command, and that would work ( playing from inside an already playing file )
From that, we could implement a “play /sd/file2.gcode -l100” which would loop that file 100 times.
Would that do what you want ?
technically that is not looping as per the gcode spec.
@Wolfmanjm I agree, but I expect in some circumpstances recursion/repetitive-playing could do what people want.
Somebody recently ( forgot who, sorry ) asked for a way to have only one raster engraving gcode file, but have a way to engrave it many times in an array ( therefore enormously reducing file transfer times ). I think for something like that this would work. Laserweb could learn to do this ( though if Laserweb is in control it can also manually play the file multiple times itself )
It’s not adequate however for say cnc milling at different depths in a loop, or custom canned cycles etc ( what the standard gcode looping is typically used for )
FYI here is a link to the codes linuxcnc uses… http://linuxcnc.org/docs/html/gcode/o-code.html
@Arthur_Wolf It’s me, I told you about a grid function, repeating a file with an x/y offset, because the transfer by http is very slow on large files.
@Sebastien_Mischler Oh right