g code out of range

More
10 years 4 months ago #76720 by clayton cramer
I am getting this message with LinuxCNC stopped on

G01 z#5 F#7

in a subroutine. Any idea why?

%
( Mill a hole with the center at x,y and diameter d, diameter of mill Md and depth z )
( Parameters: x y d Md z vfeed cfeed)
( #1 #2 #3 #4 #5 #6 #7)
O100 sub
#8 = [#3 - #4] ( Diameter of circle to mill )
#8 = [#8 / 2] ( Radius of circle to mill )
G00 z2
G00 x [#1 - #8] y #2
G01 z#5
G17 G2 x [#1 - #8] y #2 i #8 j 0 z #5
O100 endsub
O100 call [0.5000] [0.5000] [0.6110] [0.2500] [0.0000] [0.5000] [0.0500]

Please Log in to join the conversation.

More
10 years 4 months ago #76724 by Rick G
Replied by Rick G on topic g code out of range
Looks like you need to set the feed rate.
Code:
% ( Mill a hole with the center at x,y and diameter d, diameter of mill Md and depth z ) ( Parameters: x y d Md z vfeed cfeed) ( #1 #2 #3 #4 #5 #6 #7) f100 O100 sub #8 = [#3 - #4] ( Diameter of circle to mill ) #8 = [#8 / 2] ( Radius of circle to mill ) G00 z2 G00 x [#1 - #8] y #2 G01 z#5 G17 G2 x [#1 - #8] y #2 i #8 j 0 z #5 O100 endsub O100 call [0.5000] [0.5000] [0.6110] [0.2500] [0.0000] [0.5000] [0.0500] %


runs

Rick G

Please Log in to join the conversation.

More
10 years 4 months ago #76725 by clayton cramer
Replied by clayton cramer on topic g code out of range
%
( Mill a hole with the center at x,y and diameter d, diameter of mill Md and depth z )
( Parameters: x y d Md z )
( #1 #2 #3 #4 #5 )

O100 sub
#6 = [#3 - #4] ( Diameter of circle to mill )
#6 = [#6 / 2] ( Radius of circle to mill )
G00 z 2 F 0.5
G00 x [#1 - #6] y #2
G01 z #5 F 0.05
G17 G2 x [#1 - #6] y #2 i #6 j 0 z #5
O100 endsub
O100 call [0.5000] [0.5000] [0.6110] [0.2500] [0.0000] [0.5000] [0.0500]

No change. Does the feed rate need to be outside the subprogram?

Please Log in to join the conversation.

More
10 years 4 months ago #76726 by Rick G
Replied by Rick G on topic g code out of range
Actually the feed rate is set in the call line.
Code:
O100 call [0.5000] [0.5000] [0.6110] [0.2500] [0.0000] [0.5000] [0.0500]
But the lines you posted start with a % but do not end with one, I assumed there was more...

Try adding a % to the bottom. Or get rid of the starting % and end with a M2
and edit the call line to...
Code:
% ( Mill a hole with the center at x,y and diameter d, diameter of mill Md and depth z ) ( Parameters: x y d Md z i f ) ( #1 #2 #3 #4 #5 #6 #7 ) O100 sub #6 = [#3 - #4] ( Diameter of circle to mill ) #6 = [#6 / 2] ( Radius of circle to mill ) G00 z 2 F #7 G00 x [#1 - #6] y #2 G01 z #5 F #7 G17 G2 x [#1 - #6] y #2 i #6 j 0 z #5 O100 endsub ( x y d Md z i f ) O100 call [0.5000] [0.5000] [0.6110] [0.2500] [0.0000] [0.5000] [0.5] %

Rick G

Please Log in to join the conversation.

More
10 years 4 months ago #76730 by BigJohnT
Replied by BigJohnT on topic g code out of range
The following runs for me after adding M2 and dropping the unmatched % but takes forever to move from Z2 at F0.05
Code:
( Mill a hole with the center at x,y and diameter d, diameter of mill Md and depth z ) ( Parameters: x y d Md z ) ( #1 #2 #3 #4 #5 ) O100 sub #6 = [#3 - #4] ( Diameter of circle to mill ) #6 = [#6 / 2] ( Radius of circle to mill ) G00 z 2 F 0.5 G00 x [#1 - #6] y #2 G01 z #5 F 0.05 G17 G2 x [#1 - #6] y #2 i #6 j 0 z #5 O100 endsub O100 call [0.5000] [0.5000] [0.6110] [0.2500] [0.0000] [0.5000] [0.0500] M2

You might want to look at some of the G code generators on the wiki
wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple...NC_G-Code_Generators

JT

Please Log in to join the conversation.

More
10 years 4 months ago #76731 by BigJohnT
Replied by BigJohnT on topic g code out of range

clayton cramer wrote: I am getting this message with LinuxCNC stopped on

G01 z#5 F#7

in a subroutine. Any idea why?

Code:
% ( Mill a hole with the center at x,y and diameter d, diameter of mill Md and depth z ) ( Parameters: x y d Md z vfeed cfeed) ( #1 #2 #3 #4 #5 #6 #7) O100 sub #8 = [#3 - #4] ( Diameter of circle to mill ) #8 = [#8 / 2] ( Radius of circle to mill ) G00 z2 G00 x [#1 - #8] y #2 G01 z#5 G17 G2 x [#1 - #8] y #2 i #8 j 0 z #5 O100 endsub O100 call [0.5000] [0.5000] [0.6110] [0.2500] [0.0000] [0.5000] [0.0500]


Running your original example I get "File ended with no percent sign" is there more?
JT

Please Log in to join the conversation.

More
10 years 4 months ago #76748 by clayton cramer
Replied by clayton cramer on topic g code out of range
Yes, the whole file is 8 MB. I put % at the end, no change. It still stops on G01 z #5 f0.5. The error message makes no sense so I rebooted and started over. Next step is drop the subprogram and have the program I've written to produce this file generate every circle cut directly.

Please Log in to join the conversation.

More
10 years 4 months ago #76791 by andypugh
Replied by andypugh on topic g code out of range
Here is what causes that error:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...1c1f51c330148ca#l464

The error means that the intepreter is seeing a letter G followed by a number greater than 99.9 or is fractional by less than a than a tenth.

I confess I can't see anything meeting those criteria in your G-code snippet.

But, the error refers to an invalid G-code, not any sort of limit error.

I wonder if there is some sort of invisible character lurking in the file?

Please Log in to join the conversation.

More
10 years 4 months ago #76797 by Clive S
Replied by Clive S on topic g code out of range
Just my 2 cents worth.

Could this just be an embedded control code in there because the files say was moved from a windows machine to linux

Please Log in to join the conversation.

More
10 years 4 months ago #76803 by BigJohnT
Replied by BigJohnT on topic g code out of range
Open the file in Gedit and select SaveAs and Line Ending: Unix/Linux.

Edit: thanks Andy that error actually makes sense to me now. I perceived the error was trying to say a move was out of range not invalid G code used... the error could be a bit more informative if it actually printed the invalid G code.

JT

Please Log in to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum