g code out of range
- clayton cramer
- Offline
- Senior Member
Less
More
- Posts: 45
- Thank you received: 0
27 Jun 2016 17:19 - 27 Jun 2016 17:20 #76720
by clayton cramer
g code out of range was created 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]
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]
Last edit: 27 Jun 2016 17:20 by clayton cramer.
Please Log in or Create an account to join the conversation.
27 Jun 2016 20:54 - 27 Jun 2016 20:59 #76724
by Rick G
Replied by Rick G on topic g code out of range
Looks like you need to set the feed rate.
runs
Rick G
%
( 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
Last edit: 27 Jun 2016 20:59 by Rick G.
Please Log in or Create an account to join the conversation.
- clayton cramer
- Offline
- Senior Member
Less
More
- Posts: 45
- Thank you received: 0
27 Jun 2016 21:13 - 27 Jun 2016 22:05 #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?
( 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?
Last edit: 27 Jun 2016 22:05 by clayton cramer.
Please Log in or Create an account to join the conversation.
28 Jun 2016 07:02 - 28 Jun 2016 07:20 #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.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...
Rick G
O100 call [0.5000] [0.5000] [0.6110] [0.2500] [0.0000] [0.5000] [0.0500]
Try adding a % to the bottom. Or get rid of the starting % and end with a M2
and edit the call line to...
%
( 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
Last edit: 28 Jun 2016 07:20 by Rick G.
Please Log in or Create an account to join the conversation.
28 Jun 2016 10:41 - 28 Jun 2016 10:46 #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
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
( 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
Last edit: 28 Jun 2016 10:46 by BigJohnT.
Please Log in or Create an account to join the conversation.
28 Jun 2016 11:02 #76731
by BigJohnT
Running your original example I get "File ended with no percent sign" is there more?
JT
Replied by BigJohnT on topic g code out of range
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]
Running your original example I get "File ended with no percent sign" is there more?
JT
Please Log in or Create an account to join the conversation.
- clayton cramer
- Offline
- Senior Member
Less
More
- Posts: 45
- Thank you received: 0
28 Jun 2016 16:09 #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 or Create an account to join the conversation.
29 Jun 2016 15:05 #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?
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?
The following user(s) said Thank You: BigJohnT
Please Log in or Create an account to join the conversation.
29 Jun 2016 17:02 #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
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 or Create an account to join the conversation.
29 Jun 2016 20:26 - 29 Jun 2016 20:29 #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
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
Last edit: 29 Jun 2016 20:29 by BigJohnT.
Please Log in or Create an account to join the conversation.
Time to create page: 0.089 seconds