11
General Mach Discussion / Re: Rolling my own GCode
« on: December 02, 2009, 02:14:58 AM »
Hi, Sixmile
The Header your referring to is sometimes refer-ed to as Pre Amble code, You may also want to have Post Amble code, As your finding out G-CODE is very simple, But very structured little beast.
Mach3 is "Control Software" and one of the biggest issues is not pre setting or dealing with the Control's State when running G-code files.
"I should use "N" instead of "M"." Yes
"I do not need to repeat the G01." No
"I don't need to repeat a coordinate if it is the same as previous" No
I think for the most part answers to the above Q's are correct.
Hear are some suggestions, Your question is a very broad one, Use the Mach3 manual and G Codes & M Code button's to look at some of the comment's below for further explanation's.
( G20 INCH Mode, G21 Set's MM Mode )
( G90 ABS Mode, G91 Set's INC Mode )
( G91.1 IJ's to INC, G90.1 Set's IJ's ABS Mode )
( Mixing or using G90'es and G91's is not allowed on the same line in G-code )
( Also read about modal/non-modal G-code in the g code section )
G20 G90
G91.1
N01 G00 Z0.200 ( "G0" User's your "Velocity" setting in Motor Tuning page.)
N02 G00 X0 Y0
N03 G01 Z-0.240 F10 ( "F1" To set a Cut speed, You pick it. )
N04 X0.000 Y0.000 Z-0.240
N15 X0.550
N16 X0.600 Y0.000 Z-0.239
N23 X0.950
N24 X1.000 Y0.000 Z-0.238
N28 X1.200
N29 X1.250 Y0.000 Z-0.237
N33 X1.450
N34 X1.500 Y0.000 Z-0.236
N37 X1.650
N38 X1.700 Y0.000 Z-0.235
G00 Z0 ( just to return cutter to start pos. )
X0 Y0
M30
%
Hope this Helps, Chip
The Header your referring to is sometimes refer-ed to as Pre Amble code, You may also want to have Post Amble code, As your finding out G-CODE is very simple, But very structured little beast.
Mach3 is "Control Software" and one of the biggest issues is not pre setting or dealing with the Control's State when running G-code files.
"I should use "N" instead of "M"." Yes
"I do not need to repeat the G01." No
"I don't need to repeat a coordinate if it is the same as previous" No
I think for the most part answers to the above Q's are correct.
Hear are some suggestions, Your question is a very broad one, Use the Mach3 manual and G Codes & M Code button's to look at some of the comment's below for further explanation's.
( G20 INCH Mode, G21 Set's MM Mode )
( G90 ABS Mode, G91 Set's INC Mode )
( G91.1 IJ's to INC, G90.1 Set's IJ's ABS Mode )
( Mixing or using G90'es and G91's is not allowed on the same line in G-code )
( Also read about modal/non-modal G-code in the g code section )
G20 G90
G91.1
N01 G00 Z0.200 ( "G0" User's your "Velocity" setting in Motor Tuning page.)
N02 G00 X0 Y0
N03 G01 Z-0.240 F10 ( "F1" To set a Cut speed, You pick it. )
N04 X0.000 Y0.000 Z-0.240
N15 X0.550
N16 X0.600 Y0.000 Z-0.239
N23 X0.950
N24 X1.000 Y0.000 Z-0.238
N28 X1.200
N29 X1.250 Y0.000 Z-0.237
N33 X1.450
N34 X1.500 Y0.000 Z-0.236
N37 X1.650
N38 X1.700 Y0.000 Z-0.235
G00 Z0 ( just to return cutter to start pos. )
X0 Y0
M30
%
Hope this Helps, Chip