Question about G-Code

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
falviani
Posts: 253
Joined: Tue May 07, 2019 8:49 pm

Question about G-Code

Post by falviani »

Hello all,

I downloaded a program called DMap2gcode to see about trying 3D carving. After generating a grayscale image to work with, I looked at the generated gcode to see what it produced. What I saw puzzled me:

G17 G90 G64 P0.001 M3 S3000
G21
G0 Z6.3500
F381.0000
F25.0000
G0 X100.0000 Y100.0000
F381.0000
G1 Z-1.5657
X99.8435 Z-1.7331
X99.6870 Z-2.2948
X99.5305 Z-2.5829
X99.3740 Z-2.2124
X99.0610 Z-1.7809
X98.9045 Z-1.2789
X98.7480 Z-1.8048
...
Y100.0000 Z-2.3785
G0 Z6.3500
M5
M2


Is this actually valid gcode? Everything I've seen generated had the G1 command on each line, generally along with the feed rate. I'm not yet an expert in gcode programming, so I thought I'd ask those folks who are :)

Thanks in advance,
Frank
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Question about G-Code

Post by chrisb »

It is valid GCode. There are so called modal commands like G0, G1, G2, G3, which can be omitted for further command lines. So from the line
G1 Z-1.5657
on the following commands are all G1 commands.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
falviani
Posts: 253
Joined: Tue May 07, 2019 8:49 pm

Re: Question about G-Code

Post by falviani »

Thanks. I'm just getting into this :)
Russ4262
Posts: 953
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Question about G-Code

Post by Russ4262 »

Post Reply