Hello Guest it is August 17, 2019, 07:30:23 AM

Author Topic: Rolling my own GCode  (Read 2610 times)

0 Members and 1 Guest are viewing this topic.

Rolling my own GCode
« on: December 01, 2009, 09:17:21 PM »
I only have 2D software and a buddy asked me to make a very large and shallow "dish", used for guitar building.  No problem I wrote some VB code to generate the GCode, but, I don't know what to supply it for header info.  I load it into Mach, and it stops after each line, then cuts for a bit, then stops. When it cuts it jerks. 

Its a large file, I have attached just the first portion. 

M1 G00 Z0.200
M2 G00 X0 Y0
M3 G01 Z-0.240
M4 G01 X0.000 Y0.000 Z-0.240
M5 G01 X0.050 Y0.000 Z-0.240
M6 G01 X0.100 Y0.000 Z-0.240
M7 G01 X0.150 Y0.000 Z-0.240
M8 G01 X0.200 Y0.000 Z-0.240
M9 G01 X0.250 Y0.000 Z-0.240
M10 G01 X0.300 Y0.000 Z-0.240
M11 G01 X0.350 Y0.000 Z-0.240
M12 G01 X0.400 Y0.000 Z-0.240
M13 G01 X0.450 Y0.000 Z-0.240
M14 G01 X0.500 Y0.000 Z-0.240
M15 G01 X0.550 Y0.000 Z-0.240
M16 G01 X0.600 Y0.000 Z-0.239
M17 G01 X0.650 Y0.000 Z-0.239
M18 G01 X0.700 Y0.000 Z-0.239
M19 G01 X0.750 Y0.000 Z-0.239
M20 G01 X0.800 Y0.000 Z-0.239
M21 G01 X0.850 Y0.000 Z-0.239
M22 G01 X0.900 Y0.000 Z-0.239
M23 G01 X0.950 Y0.000 Z-0.239
M24 G01 X1.000 Y0.000 Z-0.238
M25 G01 X1.050 Y0.000 Z-0.238
M26 G01 X1.100 Y0.000 Z-0.238
M27 G01 X1.150 Y0.000 Z-0.238
M28 G01 X1.200 Y0.000 Z-0.238
M29 G01 X1.250 Y0.000 Z-0.237
M30 G01 X1.300 Y0.000 Z-0.237
M31 G01 X1.350 Y0.000 Z-0.237
M32 G01 X1.400 Y0.000 Z-0.237
M33 G01 X1.450 Y0.000 Z-0.237
M34 G01 X1.500 Y0.000 Z-0.236
M35 G01 X1.550 Y0.000 Z-0.236
M36 G01 X1.600 Y0.000 Z-0.236
M37 G01 X1.650 Y0.000 Z-0.236
M38 G01 X1.700 Y0.000 Z-0.235
Re: Rolling my own GCode
« Reply #1 on: December 01, 2009, 09:25:06 PM »
Well, here are a few self correcting things already:

I should use "N" instead of "M". 
I do not need to repeat the G01. 
I don't need to repeat a coordinate if it is the same as previous
Re: Rolling my own GCode
« Reply #2 on: December 01, 2009, 09:25:58 PM »
I only have 2D software and a buddy asked me to make a very large and shallow "dish", used for guitar building.  No problem I wrote some VB code to generate the GCode, but, I don't know what to supply it for header info.  I load it into Mach, and it stops after each line, then cuts for a bit, then stops. When it cuts it jerks. 

Its a large file, I have attached just the first portion. 


You cannot use "M" in the line numbers.  Use "N" instead, or just leave out the numbers entirely.

Regards,
Ray L.
Regards,
Ray L.

Offline Chip

*
  • *
  •  2,056 2,056
  • Gainesville Florida USA
    • View Profile
Re: Rolling my own GCode
« Reply #3 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
« Last Edit: December 02, 2009, 02:33:13 AM by Chip »