DrufelCNC Gcode
DrufelCNC Gcode
DrufelCNC, 2020
Content
Annotation .................................................................................................................. 3
G53 - Disabling the offset of the origin of the coordinate system ............................. 21
This document is a G code user guide. These G-codes can be used in the DrufelCNC
software. G-code is a programming language for numerically controlled machines
and machine tools.
Code G00 is used for faster movement. Accelerated movement is necessary for quick
movement.
The speed of the tool is too high and inconsistent!
The use of the G00 code reduces the overall processing time.
Code G01 is designed to perform tool movement in a straight line at a given speed.
The main difference between the G01 code and the G00 is that with linear
interpolation, the tool moves at a given speed. Movement speed is indicated by the F
command. Conventionally, a frame for linear interpolation is written as follows:
The speed value can be set once. You can also shorten your code. Short code will
look like this:
G00Z10
G00X0Y0
G01Z-5F50
Codes G02 and G03 are designed to perform circular interpolation. G02 command is
used to move in an arc clockwise, and G03 - counterclockwise.
The direction of movement is determined when we look at the tool from the spindle
side, in the negative direction of the Z axis. As with linear interpolation, in the
circular interpolation block, you must specify the feedrate F.
Arc with I, J, K
For a complete description of the arc, it is not enough to specify only the coordinates
of its end point. You must also specify the coordinates of the center.
Using I, J, and K, you specify the relative (incremental) distances from the starting
point of the arc to its center.
You must specify a positive value for I and a positive value for J
Arc with R
A simpler way to specify the center of the arc is based on applying the address R
(radius). To unambiguously determine the shape of the arc, you must specify the
corresponding sign in front of the numerical value of the radius R. For an arc that is
greater than 180 °, the value of R will be negative. For an arc that is less than 180 °,
the R value will be positive.
Since the arc is greater than 180 ° (its center is located inside the chord), then R will
have a negative value
G01X0Y0
G02 X8.0 Y8.0 I8.0 J0.0 F80
Since the center of the arc is at a distance of 8 mm along the X axis and 0 mm along
the Y axis relative to the starting point A, then I will be 8.0, and J is 0. The resulting
arc is only a quarter of the full circle. Let's try to describe the whole circle gradually.
The next frame moves the tool from point B (B1) to point B2. Since the feedrate does
not change, there is no need to re-specify the data F-word.
Since the center of the arc is at a distance of 0 mm along the X axis and 8 mm along
the Y axis relative to point B, then I will be 0, and J will be -8. Thus, we were able to
create a displacement along an arc from point A to point B2 using two frames.
Currently, most CNC systems allow you to perform an operation to describe the full
circle in two or even one frame. Therefore, the movement from point A to point C
can be written as follows:
G01X0Y0
G02 X8.0 Y8.0 I8.0 J0.0 F80
G02 X16.0 Y0.0 I-8.0 J0.0
Modern CNC systems allow the description of such an arc in one block
G01X-8Y0
G02 X-8.0 Y0.0 I8.0 J0.0
If the XY plane (G17) is activated and the Z word is programmed in the circular
interpolation block, then a spiral forms in the XY plane. The direction of the arc or
spiral in the XY plane can be determined visually.
An example of a spiral:
G01F800
G01X0Y0Z0
G02X0Y0Z-10I38J38
G02Z-20I38J38
G02Z-30I38J38
G02Z-40I38J38
G02Z-50I38J38
G02Z-60I38J38
G02Z-70I38J38
G02Z-80I38J38
G01X10Y10
Command G04 is used to delay control program execution or pause. This modeless
code is used in conjunction with the S- or P-address, which indicates the length of
the exposure time. Usually this time is from 0.001 to 99999.999 seconds.
Code G04, S- or P-address are programmed together in a single block that does not
contain any movements.
If P is used to determine the holding time, then the decimal point cannot be
programmed. Address P determines the holding time in milliseconds, and S in
seconds.
Example:
G04 S1.5 ;shutter speed 1.5 seconds;
G04 P200 ;shutter speed 200 milliseconds.
In the circular interpolation blocks, the words X, Y, Z, I and J. are valid. The word K is
not valid. If the Z word is programmed in a circular interpolation block, then a spiral
forms in the XY plane. The direction of the arc or spiral in the XY plane can be
determined visually: Positive direction X - to the right side, positive direction Y - up.
The XY plane has a right-handed coordinate system. In G17, the endpoint of the arc is
defined in the block by the words X and Y. The center point of the arc is defined in
the block by the words I and J.
G17 is activated by default. Code G17 is canceled by codes G18 and G19.
Example:
G17
G00X0Y0
M3 S6000
G00Z5
G01X14.1421Y-14.1421
G01Z-0.5F700
G02X14.1421Y14.1421R-20
G01X40.0Y-14.1421
G03X40.0Y14.1421R-20
G01X14.1421Y-14.1421
G00Z5
M5
G00X0Y0
XZ plane selection code G18 sets the plane to circular interpolation mode G02 and
G03. In the circular interpolation blocks, the words X, Y, Z, I and J. are valid. The word
J is not valid. If the word Y is programmed in a circular interpolation block, a spiral
forms in the XZ plane. The direction of the arc or spiral in the XZ plane can be
determined visually: The positive X direction is to the right, the positive Z direction is
up. The XZ plane has a right-handed coordinate system.
Code G18 is canceled by codes G17 and G19.
Example:
G18
G00X0Z0
M3 S6000
G00z5
G01X14.1421Z-14.1421
G01Y-0.5F700
G02X14.1421Z14.1421R-20
G01X40.0Z-14.1421
G03X40.0Z14.1421R-20
G01x14.1421Z-14.1421
G00Y5
M5
The YZ plane selection code G19 sets the plane to circular interpolation mode G02
and G03. In circular interpolation blocks, the words X, Y, Z, I, and K are valid. Word I
is not valid. If the word X is programmed in a circular interpolation block, then a
spiral forms in the YZ plane. The direction of the arc or spiral in the YZ plane can be
determined visually: The positive direction Y is to the right, the positive direction Z is
up. The YZ plane has a right-handed coordinate system. In G19, the end point of the
arc is defined in the block by the words Y and Z. The center point of the arc is defined
in the block by the words J and K. Code G19 is canceled by codes G17 and G18.
Example:
G19
G00Y0Z0
M3 S6000
G00X5
G01Y14.1421Z-14.1421
G01X-0.5F700
G02Y14.1421Z14.1421R-20
G01Y40.0Z-14.1421
G03Y40.0Z14.1421R-20
The preparatory function G10 is modal and remains active until it is canceled by code
G11, G53.
G20 G21
The G53 command is used to disable the offset of the origin of the coordinate
system.
When the G53 command is executed, the working coordinate offsets are temporarily
canceled and the machine coordinate system is used.
The G53 command is a safe way to return to the initial position of the machine.
The offset values of the origin of the coordinate system are stored in tables.
The G53 command is not modal, acting only in the frame in which it is assigned.
The G68 command is used to perform rotation (rotation) of the coordinate system by
a certain angle.
Command format: G68 X__ Y__ Z__ R
The choice of coordinates depends on the selected plane (G17, G18, G19). X and Y
and Z are the coordinates of the point relative to which the coordinate system will be
rotated, and R - determines the value of the angle of rotation. If X Y is not specified,
then X Y Z are equal to the previous position.
G69 command is used to cancel the rotation of the coordinate system by a certain
angle.
G00Z5
G00X0Y0
M3 S6000
G00Z0
G68 R45.0
G00X15Y15
G01X25Y15
G01X25Y25
G01X15Y25
G01X15Y15
M5
G00Z5
G00X0Y0
The G51 command allows you to use the zoom mode in numerical control systems.
For each axis, it is possible to specify a scaling factor.
Command format: G51 X Y Z I J K
I - scale for X
J - scale for Y
K - scale for Z
X Y Z - coordinates of the center of scaling
The G50 command allows you to cancel the scaling mode with numerical control
systems (CNC) of machines.
G00Z5
G00X0Y0
M3 S6000
G00Z0
G51X0Y0I3J4
G00X15Y15
G01X25Y15
G01X25Y25
G01X15Y25
G01X15Y15
M5
G00Z5
G00X0Y0