error: Unsupported statement

luotope
Posts: 4
Joined: Thu Jan 29, 2015 1:23 pm

error: Unsupported statement

Post by luotope » Thu Jan 29, 2015 2:43 pm

I have received my Shapeoko2 a week ago and trying now the first dry tests with only Arduino, gshield and steppers connected. Manual control of motors works fine using UGS ver 1.0.7.

I followed the Gear Coaster instructions found from the forum and created a file to be sent to grbl. When I run the gcode with UGS, I can see an error line in the console every now and then. The reason for the error seems to me that some lines of code in the makercam file contains very long decimal numbers, which are truncated in UGS to four decimals (as it says in settings). But at the same time the decimal point is changed into a comma. That will generate the error in grbl.

This is a piece of code created by Makercam (see the first G1 line with a long decimal):
(Generated by PartKam Version 0.05)

G20 G90 G40

(pocket cup)
G0 Z0.15748031496062992
T0 M6
G17
M3
G0 X2.3414 Y2.3491
G1 Z-0.0591 F27.559055118110237
G3 X2.3385 Y2.3485 I0 J-0.0077 F47.24409448818898
G3 X2.336 Y2.3468 I0.0029 J-0.0071
G3 X2.3343 Y2.3443 I0.0054 J-0.0054
G3 X2.3337 Y2.3414 I0.0071 J-0.0029
G3 X2.3343 Y2.3385 I0.0077 J0
G3 X2.336 Y2.336 I0.0071 J0.0029
G3 X2.3385 Y2.3343 I0.0054 J0.0054
G3 X2.3414 Y2.3337 I0.0029 J0.0071
G3 X2.3443 Y2.3343 I0 J0.0077
G3 X2.3468 Y2.336 I-0.0029 J0.0071
and this is how it will look in the UGS console (see the same line with a comma):
**** Connected to COM5 @ 9600 baud ****

Grbl 0.8c ['$' for help]
>>> G92 X0 Y0 Z0
ok
>>> (Generated by PartKam Version 0.05)
>>> G20 G90 G40
>>> (pocket cup)
ok
>>> G0 Z0,1575
>>> T0 M6
>>> G17
>>> M3
>>> G0 X2.3414 Y2.3491
>>> G1 Z-0.0591 F27,5591
error: Unsupported statement
ok
>>> G3 X2.3385 Y2.3485 I0 J-0.0077 F47,2441
error: Expected command letter
error: Unsupported statement
>>> G3 X2.336 Y2.3468 I0.0029 J-0.0071
ok
ok
ok
error: Expected command letter
>>> G3 X2.3343 Y2.3443 I0.0054 J-0.0054
error: Expected command letter
>>> G3 X2.3337 Y2.3414 I0.0071 J-0.0029
ok
>>> G3 X2.3343 Y2.3385 I0.0077 J0
ok
>>> G3 X2.336 Y2.336 I0.0071 J0.0029
ok
>>> G3 X2.3385 Y2.3343 I0.0054 J0.0054
ok
>>> G3 X2.3414 Y2.3337 I0.0029 J0.0071
ok
>>> G3 X2.3443 Y2.3343 I0 J0.0077
ok
>>> G3 X2.3468 Y2.336 I-0.0029 J0.0071
ok
Did I understand right the cause of these errors: "Unsupported statement" and "Expected command letter"
Is there any option to say in Makercam that decimals should be printed using max four digits?
Or am I doing something wrong?

Thanks in advance.

twforeman
Posts: 1347
Joined: Tue Jan 29, 2013 4:51 pm
Location: Minneapolis, MN
Contact:

Re: error: Unsupported statement

Post by twforeman » Thu Jan 29, 2015 2:46 pm

What country are you in and what language is your computer set to?

I wonder if UGS is using commas because that's the standard for the language your PC is set for?

If so, it should probably be reported as a bug in UGS.
Ender 3 3D Printer
ShapeOko v3 serial #0004 - upgrade thread
All of my ShapeOko related blog posts

WillAdams
Posts: 8489
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: error: Unsupported statement

Post by WillAdams » Thu Jan 29, 2015 2:47 pm

Unfortunately MakerCAM doesn't have an option to trim digits.

The problem is likely that you have comma defined as a decimal separator in your localization file and UGS is using that instead of the period which Grbl expects --- file a bug report w/ UGS (and the folks behind Java) --- in the meanwhile you should be able to fix it by switching to using a period as a decimal separator or by not using a decimal point in your F settings which seems to be the only one which UGS is getting wrong.
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: error: Unsupported statement

Post by cvoinescu » Thu Jan 29, 2015 3:09 pm

You get errors from these:

G20 G90 G40 -- unsupported statement (G40 is not supported)
G0 Z0,1575 -- expected command letter (comma can not be used as a decimal place marker in G-code)
T0 M6 -- unsupported statement (Tn is not supported)
G1 Z-0.0591 F27,5591 -- expected command letter (again, comma instead of period)
G3 X2.3385 Y2.3485 I0 J-0.0077 F47,2441 -- expected command letter (again, comma)

G40 and T0 are more or less harmless -- except that in GRBL 0.9, the entire line with G40 is ignored, so it doesn't execute G20 and G90, which is bad if the default is G21.

The others are bugs in UGS, caused by sloppy coding that allowed the locale to alter the generated code. It's a common type of bug, and it occurs when the programmers forget that, for some reason, some people prefer to have their computers configured in a language other than American.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

WillAdams
Posts: 8489
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: error: Unsupported statement

Post by WillAdams » Thu Jan 29, 2015 3:12 pm

Catalin, MakerCAM gets it right:

>G3 X2.3385 Y2.3485 I0 J-0.0077 F47.24409448818898


The problem is when UGS trims it:


>>> G3 X2.3385 Y2.3485 I0 J-0.0077 F47,2441

So it's Java or UGS which isn't taking locality into account for the F statements --- which certainly don't need a decimal value for the movement rate and could be rounded off when entering them into MakerCAM.
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: error: Unsupported statement

Post by cvoinescu » Thu Jan 29, 2015 3:15 pm

Yes, you're right, I've just fixed my post. UGS has a bug. It should not use the user's locale when formatting G-code. It should use functions that are locale-independent, or it should always use a fixed, neutral locale (i.e., "C").
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

WillAdams
Posts: 8489
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: error: Unsupported statement

Post by WillAdams » Thu Jan 29, 2015 3:21 pm

Apparently it does for the co-ordinates --- it's just the F values which slipped through as a bug.
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: error: Unsupported statement

Post by cvoinescu » Thu Jan 29, 2015 3:34 pm

No, there's the "G0 Z0,1575" that fails too (trucated from "G0 Z0.15748031496062992").
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

WillAdams
Posts: 8489
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: error: Unsupported statement

Post by WillAdams » Thu Jan 29, 2015 3:37 pm

Okay.

X- and Y- co-ordinates then.
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

luotope
Posts: 4
Joined: Thu Jan 29, 2015 1:23 pm

Re: error: Unsupported statement

Post by luotope » Thu Jan 29, 2015 4:16 pm

Thanks a lot for solving the problem.
Just changing the decimal point from comma to period in my control panel did not solve the problem. I had to change the Format from Finnish (Finland) and with the value English (United States) UGS now handles the F values right:
**** Connected to COM5 @ 9600 baud ****

Grbl 0.8c ['$' for help]
>>> (Generated by PartKam Version 0.05)
>>> G20 G90 G40
>>> (pocket cup)
ok
>>> G0 Z0.1575
>>> T0 M6
>>> G17
>>> M3
>>> G0 X2.3414 Y2.3491
>>> G1 Z-0.0591 F27.5591
error: Unsupported statement
>>> G3 X2.3385 Y2.3485 I0 J-0.0077 F47.2441
ok
ok
error: Unsupported statement
>>> G3 X2.336 Y2.3468 I0.0029 J-0.0071
ok
ok
ok
ok
>>> G3 X2.3343 Y2.3443 I0.0054 J-0.0054
ok
>>> G3 X2.3337 Y2.3414 I0.0071 J-0.0029
ok
>>> G3 X2.3343 Y2.3385 I0.0077 J0
ok
>>> G3 X2.336 Y2.336 I0.0071 J0.0029
ok
>>> G3 X2.3385 Y2.3343 I0.0054 J0.0054
ok
>>> G3 X2.3414 Y2.3337 I0.0029 J0.0071
ok
>>> G3 X2.3443 Y2.3343 I0 J0.0077
ok
>>> G3 X2.3468 Y2.336 I-0.0029 J0.0071
ok
still leaving the "unsupported statement" -errors which cvoinescu explained earlier.

Thanks again.

Post Reply