G0 G-code - Smoothieware
G0 G-code G0 means “move without activating the tool”.
On CNC mills, it is used to go to a new area without cutting, it is also called a “rapid” move.
On laser cutters, it is used the same way, and the laser is automatically turned off during the move.
On 3D printers, it is also called a “travel” move.
While traditionally on CNC mills G0 is supposed to be an “un-coordinated” move, on Smoothie it is coordinated anyway.
G0’s evil twin is G1, which means “move while using the tool”.
Format
The command is used as such:
G0 X10 Y20 F30Which means: move (without cutting) to X position 10, Y position 20, at a speed of 30 millimeters/minute.
Parameters
| Parameter | Usage | Example |
|---|---|---|
| X | Move to this position in the X axis | G0 X10 |
| Y | Move to this position in the Y axis | G0 Y10 |
| Z | Move to this position in the Z axis | G0 Z10 |
| A | Move to this position in the A axis | G0 A10 |
| B | Move to this position in the B axis | G0 B10 |
| C | Move to this position in the C axis | G0 C10 |
| F | Move at this speed in millimeters/minute | G0 Z10 F100 |
Feedrate
The F parameter behavior differs between V1 and V2:
In V1, the F parameter is modal and affects both G0 and G1 moves. The speed is remembered and each subsequent command uses it.
This means if you do:
G0 X10 F100 G0 X20 G0 X30 F200 G0 X40The first two moves will happen at 100 mm/minute, and the last two moves will happen at 200mm/minute.
In V2, the F parameter behavior can be configured using the compliant_seek_rate setting:
Default behavior (compliant_seek_rate = false): The F parameter affects both G0 and G1 moves, same as V1.
GRBL-compliant behavior (compliant_seek_rate = true): When enabled, G0 rapid moves always use the default_seek_rate and ignore the F parameter. This provides strict GRBL compliance where G0 is always rapid and G1 is always feedrate-controlled.
Independent feedrates Note that both G0 and G1 have their own modal feedrates, and setting one doesn't influence the other. This means if you do: G0 X10 F100 G1 X20 F200 G0 X30 The third move will actually move at 100 mm/minute as that is the latest feedrate set for G0 moves (in V1 or when compliant_seek_rate is false in V2).If you have just started your Smoothieboard and have never sent an F parameter, your G0 moves will move at the default “seek” feedrate.
This is set in the configuration file by setting the config option.
Default value: In V1, the default seek rate is 100 mm/minute.
Default value: In V2, the default seek rate is 4000 mm/minute (a much more practical default). This allows rapid moves to be significantly faster by default.
Modal use
The G0 command is modal, if a line doesn’t contain any gcode, it is assumed to be a G0 or a G1 command depending on the latest used.
This means if you do:
G0 X10 X20 Y10It is the same as doing:
G0 X10 G0 X20 G0 Y10Note the space character before each modal line, without that space, Smoothie will not know this is a modal command.
Absolute and relative motion
There are two ways to specify positions: absolutely or relatively.
Smoothie is in absolute mode by default.
You enter absolute mode by sending the G90 Gcode, and you enter the relative mode by sending the G91 Gcode.
In absolute mode, all positions passed to G0 are relative to the 0 position for the current work coordinate.
In relative mode, all positions passed to G0 are relative to the current position.
This means if you do:
G90 G0 X10 G0 X20Smoothie will move to the X position 10, then move to the X position 20, relative to the origin.
But if you do:
G91 G0 X10 G0 X20Smoothie will move 10 millimeters relative to the current position, then move 20 millimeters further away from that new position (moving 30 millimeters total).
Further reading
These resources are used as references for Gcode:
- LinuxCNC Gcode list
- Reprap Gcode list
Từ khóa » G0 Cnc
-
CNC G Code: G0 Or G00
-
CNC G Codes
-
SUMMARY OF G-CODES - MachMotion
-
CNC Mill G-Code | G0, G1 - YouTube
-
G00 And G01 G-Codes: CNC Linear Motion - CNCCookbook
-
List Of Most Important G-code Commands - How To Mechatronics
-
G Codes - LinuxCNC
-
G0 Cancels Canned Cycles - CNC Training Centre
-
G Code CNC Basic Programming: Mastering CNC Machines - Fictiv
-
What Is G-Code? What Is M-Code? What Do They Mean In CNC ...
-
Get To Know Your CNC: How To Read G-Code - Make Magazine
-
G0 Z-100 Bad Idea G-Code CNC Machinist Operator Funny T-Shirt