grblHAL / core

grblHAL core code and master Wiki
Other
320 stars 84 forks source link

G2/G3 Error 32: No axis words in plane (too strict rule) #222

Open kimstik opened 1 year ago

kimstik commented 1 year ago

I found potential issue in vanilla GRBL https://github.com/gnea/grbl/issues/1178

grblHAL have similar in gcode.c

                    if (!(axis_words.mask & (bit(plane.axis_0)|bit(plane.axis_1))))
                        FAIL(Status_GcodeNoAxisWordsInPlane); // [No axis words in plane]
terjeio commented 1 year ago

Change to

                    if (gc_block.words.r && !(axis_words.mask & (bit(plane.axis_0)|bit(plane.axis_1))))
                        FAIL(Status_GcodeNoAxisWordsInPlane); // [No axis words in plane]

to fix?

kimstik commented 1 year ago

your fix will make sense for R-mode only ? original check is correct in Arc mode and non-valid in helix mode where in-plane begin and end coordinates is same .

terjeio commented 1 year ago

your fix will make sense for R-mode only ?

No, the check will only be performed for R format arcs, from LinuxCNC specs:

"It is an error if:

For center format arcs the check is not required as error 33 will be reported if parameters are incorrect?

terjeio commented 1 year ago

Ref 3.5.3.2 Center Format Arc in NIST RS247NGC:

"It is an error if: • X and Y are both omitted, • I and J are both omitted."

etc...

Thus Grbl and grblHAL is compliant with the NIST spec, LinuxCNC is not? I do not have LinuxCNC instance to check with so cannot verify this. So for now I will leave the code as-is.

kimstik commented 1 year ago

it seems you are right. Following case is not compliant with "NIST RS274NGC Interpreter" specs:

G17
G2 X7 Y0 Z-1 I-7 J0
Z-2 I-7 J0

In terms of NIST interpreter this code is erroneous.

another point is: What is reason to not execute code if is [logic, complete and comprehensive] but not NIST compliant ? Do I missing something?

Actually i do not see reason to do exception for arcs, and specify coordinate words which not changes. Sounds like useless code noise.