Join GitHub today
Ignore G40, fail on G41/G42 #531
I'm writing a gcode post-processor and sender, where I interpret (Which includes performing the arc calculations, and in the future also canned cycles and such), optimise and re-export the gcode, optionally sending to a CNC if requested.
Right now, I am caring the most for Grbl, as that's what my Shapeoko is running. My tool works fine with it, stuffing Grbl as full of codes as the 127 byte buffer allows, but I am having an issue that bothers my OCD. I fail loudly on code that my interpreter/vm does not support, and have therefore implemented handling of G40/G41/G42, and panic in my exporter if the state has ended up in 41/42 somehow, and simply ignoring G40.
While I am 100% okay with Grbl not handling tool compensation, it bothers my OCD that I cannot export a G40 to perform a nice reset in the general case. I have considered ways to eliminate it specifically in my GrblStreamer, but again, my OCD's for such a solution is sort of making me twitch.
I therefore had the thought: Seeing that G40 is the only state Grbl can be in, would it be highly unreasonable to have it no-op and respond with "ok", only failing on G41 and G42? That way, I would not need to special-case Grbl, and could generically export nice "reset" headers.
A comment would be nice.