0% found this document useful (0 votes)
34 views23 pages

Cutcam Programming G Code Define

The document is a programming manual for a five-axis CNC system, detailing command characters, G-code instructions, and their descriptions. It includes various G-code commands for operations such as quick positioning, linear motion, circular arc commands, and tool compensation. The manual serves as a comprehensive guide for programming and operating the CNC system effectively.

Uploaded by

Bảo Châu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views23 pages

Cutcam Programming G Code Define

The document is a programming manual for a five-axis CNC system, detailing command characters, G-code instructions, and their descriptions. It includes various G-code commands for operations such as quick positioning, linear motion, circular arc commands, and tool compensation. The manual serves as a comprehensive guide for programming and operating the CNC system effectively.

Uploaded by

Bảo Châu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Five-axis CNC system

Programming manual

On March 26,2024 by Robin Lee

1 / 24
Brief
1 . T he command character.......................................................................................................... 6
2 . G Code list....................................................................................................................................6
3.The G-code instruction description............................................................................................ 8
1. G 0: Quick positioning.......................................................................................................... 8
1) Command format......................................................................................................... 8
2) Description.....................................................................................................................8
3) Notes.............................................................................................................................. 8
2. G1: linear motion...................................................................................................................8
1) Command format......................................................................................................... 8
2) Description.....................................................................................................................8
3) Notes.............................................................................................................................. 8
3. G 1.1 Line command using the measurement data.......................................................... 9
1) Command format......................................................................................................... 9
2) Description.....................................................................................................................9
3) Notes.............................................................................................................................. 9
4. G1.2 Linear command of the traditional operation mode of the cutting machine....... 9
1) Command format......................................................................................................... 9
2) Description.....................................................................................................................9
3) Notes.............................................................................................................................. 9
5. G2 / G3 circular arc command.......................................................................................... 10
1) Command format....................................................................................................... 10
2) Description.................................................................................................................. 10
3) Notes............................................................................................................................10
6. G4 time delay...................................................................................................................... 10
1) Command format....................................................................................................... 10
2) Description.................................................................................................................. 10
3) Notes............................................................................................................................11
7. G 4.1 / G 4.2 Internal timer zero-clear / wait...................................................................11
1) Command format....................................................................................................... 11
2) Description.................................................................................................................. 11
3) Notes............................................................................................................................11
4) Programming examples............................................................................................. 11
8. G 6 automatic knife change...............................................................................................11
1) Command format....................................................................................................... 11
2) Description.................................................................................................................. 12
3) Notes............................................................................................................................12
9. G 10 functional instruction.................................................................................................12
1) Command format....................................................................................................... 12
2) Description.................................................................................................................. 12

2 / 24
3) Notes............................................................................................................................12
10. G 17 / G 18 / G19, working plane setting...................................................................... 12
1) Command format....................................................................................................... 12
2) Description.................................................................................................................. 12
3) Notes............................................................................................................................13
11. G37 and G 38 measurement instructions.......................................................................13
1) Command format....................................................................................................... 13
2) Description.................................................................................................................. 13
3) Notes............................................................................................................................13
12. G37.1, G38.1 are measured and cached to the system................................................ 13
1) Command format....................................................................................................... 13
2) Description.................................................................................................................. 13
3) Notes............................................................................................................................14
13. G40 / G41 / G 41 / tool radius compensation...............................................................14
1) Command format....................................................................................................... 14
2) Description.................................................................................................................. 14
3) Notes............................................................................................................................14
14. G50 artifact coordinate offset..........................................................................................14
1) Command format....................................................................................................... 14
2) Description.................................................................................................................. 14
3) Notes............................................................................................................................15
15. G51 point-point-to-point positioning...........................................................................15
1) Command format....................................................................................................... 15
2) Description.................................................................................................................. 15
3) Notes............................................................................................................................15
16. G52: Location of the origin of the workpiece................................................................ 15
1) Command format....................................................................................................... 15
2) Description.................................................................................................................. 15
3) Notes............................................................................................................................15
17. Positioning of the G 53 mechanical coordinates...........................................................16
1) Command format....................................................................................................... 16
2) Description.................................................................................................................. 16
3) Notes............................................................................................................................16
18. G 54 / G 154 / G55~G59 .................................................................................................16
1) Command format....................................................................................................... 16
2) Description.................................................................................................................. 16
3) Notes............................................................................................................................17
19. G61 / G62 / G64 Cutting mode setting..........................................................................17
1) Command format....................................................................................................... 17
2) Description.................................................................................................................. 17
3) Notes............................................................................................................................17
20. G 70 / G 71 sets the code units....................................................................................... 17
1) Command format....................................................................................................... 17
2) Description.................................................................................................................. 17

3 / 24
3) Notes............................................................................................................................17
21. G 72 Set the Tool Head Type (RTCP type).................................................................18
1) Command format....................................................................................................... 18
2) Description.................................................................................................................. 18
3) Notes............................................................................................................................18
22. G 90 / G 91 absolute / relative coordinate programming........................................... 18
1) Command format....................................................................................................... 18
2) Description.................................................................................................................. 18
3) Notes............................................................................................................................18
23. G92 subis returned........................................................................................................... 19
1) Command format....................................................................................................... 19
2) Description.................................................................................................................. 19
3) Notes............................................................................................................................19
24. G93 waits for input conditions........................................................................................ 19
1) Command format....................................................................................................... 19
2) Description.................................................................................................................. 19
3) Notes............................................................................................................................19
25. G101 uses a straight-line command with a second set of speed parameters...........19
1) Command format....................................................................................................... 19
2) Description.................................................................................................................. 20
3) Notes............................................................................................................................20
26. G102 / G103 uses the second set of speed parameters...............................................20
1) Command format....................................................................................................... 20
2) Description.................................................................................................................. 20
3) Notes............................................................................................................................20
27. G141 automatic radius compensation............................................................................20
1) Command format....................................................................................................... 20
2) Description.................................................................................................................. 21
3) Notes............................................................................................................................21
28. G200~G299 customer code............................................................................................ 21
1) Description.................................................................................................................. 21
2) Notes............................................................................................................................21
29. G302 docked at Z..............................................................................................................21
1) Command format....................................................................................................... 21
2) Description.................................................................................................................. 21
3) Notes............................................................................................................................21
30. G303 docked at XY........................................................................................................... 22
1) Command format....................................................................................................... 22
2) Description.................................................................................................................. 22
3) Notes............................................................................................................................22
31. G 304 was paused for 0.1 seconds................................................................................. 22
1) Command format....................................................................................................... 22
2) Description.................................................................................................................. 22
3) Notes............................................................................................................................22

4 / 24
32. G 305 docked all axes.......................................................................................................22
1) Command format....................................................................................................... 22
2) Description.................................................................................................................. 23
3) Notes............................................................................................................................23
33. G 306 docks to remove all the axes of the A axis......................................................... 23
1) Command format....................................................................................................... 23
2) Description.................................................................................................................. 23
3) Notes............................................................................................................................23
34. G400 system factory test command............................................................................... 23
1) Command format....................................................................................................... 23
2) Description.................................................................................................................. 23
3) Notes............................................................................................................................23

5 / 24
1 . The command character

character function
% The entire line containing% is not performed.
N Code line number
M PLC instruct
G system command
X Y Z
A B C
U V W
Floating-point data command. Bring in the floating-point parameter for
I J K
the G command.
R S F
L
O P Q T
Plastic data instructions. Bring in the shaping parameters for the G
D H
command.
$ System function command
; One-way annotation. The characters starting from the semicolon to the
end of the code line are all ignored.
() Multiple lines of annotation. Do not ignore the characters between the
parentheses.

2. G Code list
G0 quick positioning
G1 rectilinear motion
G 1.1 Use the straight-line command for the measured data
G 1.2 A straight-line command for the traditional cutter operation
mode
G2 Shun round command
G3 Inverse circle command
G4 delayed
G 4.1 Inner timer
G 4.2 The internal timer waits
G6 Automatically change the knife
G 10 function command
G 17 Machining plane XY
G 18 Machining plane, ZX
G 19 Machining plane, YZ

6 / 24
G 37 、G38 Survey Instruction
.1G 37 、G38.1 Measure and cache to the system
G 40 Cancel the half, the diameter compensation
G 41 Radius left compensation
G 50 Creature coordinate offset
G 51 Point-to-point positioning
G 52 The knife tip positioning of the origin of the workpiece 0
G 53 Positioning of the mechanical coordinates
G 54 Set up the artifact origin number
G 55~G59 Set up the artifact origin number
G 61 Each segment does stop
G 62 Each segment does stop
G 64 Continuous face of continuously continuously
G 70 Set the code to inch units
G 71 Set the code to metric units
G 72 Set the Tip Type (RTCP type)
G 90 Absolute coordinate programming
G 91 Sit opposite, mark programming
G 92 return from subroutine
G 93 Wait for the input conditions
G 101 Use the line command with the second set of speed parameters
G 102 Use the circular command for the second set of speed
parameters
G 103 Use the inverse circle command for the second set of speed
parameters
G 141 Automatic radius compensation
G 154 Set up the artifact origin number
G 200~G299 Customer code
G 302 calling Z
G 303 calling XY
G 304 Pause for 0.1 seconds
G 305 Stop all axes
G 306 Dock all axes removing the A axis
G 400 System factory test command

7 / 24
3. The G-code instruction description

1) Command format

G0 X_ Y_ Z _
X _ Y _ Z _: Specifies the point coordinates.

2) Explain

In the absence of cutting, the tip is located to the coordinates with X, Y, Z at the
fastest speed.

3) Notes

The tip moves from the beginning to the end. Some axes may change in direction
during operation.

1) Command format

G 1 X _ Y _ Z _ F __
X _ Y _ Z _: Specifies the point coordinates.
F: feed rate

2) Explain

The G 1 straight cutting, and the absolute value or incremental form is determined
by G90 / G91. Advance to the specified position at the feed speed set by the F parameter.

3) Notes

It may be limited by the maximum system cutting speed or the maximum speed
of the shaft without reaching the speed specified by the F parameter.

8 / 24
1) Command format

G1.1X _Y _Z _O _P _Q _R _

2) Explain

X _ Y _ Z _: Specifies the point coordinates.


O: The shaft number of the compensation shaft
P: Measurement value index 1
Q: Measurement value index 2
R: Compensation for the target value

3) Notes

This command is only used for code generated by CutCam software, in


conjunction with field measurement data. Cannot be used alone.

1) Command format

G 1.2 X _ Y _ Z _ F__

2) Explain

Function is the same as in G1. With the CutCam software, you can adjust the
starting point and ending position of the whole cutting process in real time.

3) Notes

This command is only used for code generated by the CutCam software and
executed by the field data provided by the CutCam software.

9 / 24
1) Command format

G 17{ G2 } X _ Y _} F _; X-Y plane arc interpolation


G3

G 18{ G2 } X _ Z _ {} F _; Z-X planar arc interpolation


G3

G 19{ G2 } Y _ Z _} F _; Y-Z plane arc interpolation


G3
X, Y, and Z: Specify the point coordinates.
I, J, K: the vector value from the arc start to the center of the circle.
R: Arc radius.
F: feed rate.

2) Explain

G 2 and G 3 instructions enable the tool to perform arc insertion according to the
specified plane, coordinate system, arc dimension and feed speed, while the movement
direction of the knife is determined by G2 (clockwise direction) and G3 (counterclockwise
direction).

3) Notes

R is a positive value when the circumference angle is less than or equal to 180°.
Negative R value when the circumference angle is greater than 180°. When the
circumference angle is 360°, it can only be used in I, J and K.

1) Command format

G 4X_
X: seconds of seconds seconds.

2) Explain

When some processing needs to be delayed, G4 can be used to keep the spindle
running normally, and each axis is suspended for a period time.

10 / 24
3) Notes

The G 4 command is only valid within the bank code.

1) Command format

G 4.1P _
G 4.2X_P_
P: Index number of the internal timer.
X: Wait for the count value.(Unit: seconds)

2) Explain

There are 10 consecutive count timers inside the system. If you continue to execute
subsequent commands while waiting for the external device to be ready, you can use the
internal timer. Favto the process of the system and external equipment work at the same
time.

3) Notes

4) Programming examples

G 4.1P 1; / / 1 timer has been cleared. Recount from now on.


G 0X 1000.; / / The timer is still timing, waiting before the timing ends.
G 0XZ 500. / / Continue to do more things.
.2 G 4 X5.0 P1; / / Wait for timer 1 to count to 5 seconds.
/ / If the first two commands have taken more than 5 seconds,
G4.2 ends immediately.
/ / If the first two commands take less than 5 seconds, G4.2 will wait for the remaining time.

1) Command format
G 6T_
G6T _P 1
T: Tool number in the knife library
P 1: Set the value of the current tool number as the T parameter directly.

11 / 24
2) Explain

The G 6T _ command returns the current tool to the knife vault and
then takes the tool specified by the T parameter. The G 6T _P1
command has no actual knife procedure. Just set the current tool
number.

3) Notes

Change to the command belongs to a custom command. Different machines or


different customers have different functions.

1) Command format

G10P _
P: Number of the function command.

2) Explain

Perform specific system functions based on the values of the P parameter.


Commands or customized commands used within the manufacturer.

3) Notes

1) Command format
G 17: Set the X-Y working plane
G 18: Set the Z-X working plane
G 19: Set the Y-Z working plane

2) Explain
When using the arc command and the tool radius compensation command, G17,
G18 and G19 must be used to set the cutting plane and inform the system machining plane
(internal default G 17).

12 / 24
3) Notes

1) Command format

G37 X _Y _Z _P _Q _
X _Y _Z _: end coordinates of measurement.
P _: The sensor number
Q _: Sensor signal is in reverse logic

2) Explain

The machine runs in a straight line from the current position to the terminal
coordinate X _Y _Z _. If the specified sensor signal is encountered during the operation, the
operation is stopped and the measurement result is obtained. If there is still no suitable
sensor signal at the destination, then alarm.

3) Notes

Measurement instructions are customized instructions. The sensor number and


signal logic are specified within the system.

1) Command format
G 37.1 X _Y _Z _P _Q_
X _Y _Z _: end coordinates of measurement.
P _: The measured shaft number
Q _: Results cache index

2) Explain
The machine runs in a straight line from the current position to the terminal
coordinate X _Y _Z _. If a specific sensor signal is encountered during operation,
the operation is stopped and the measurements are obtained. If there is still no
suitable sensor signal at the destination, then alarm. The measurements are
deposited in the cache space specified by Q.
13 / 24
3) Notes

It is a custom command. Both the sensor port and logic are internally defined and
the customer cannot modify them.

1) Command format

G41 X_Y_H_
G42 X_Y_H_
G 40: Cancel the compensation
G 41: tool radius left compensation
G 42: the tool radius is offset to the right
X and Y: end coordinates of each axis.
H: Tool compensation number

2) Explain

Generally, if the tool center cuts the shape along the outline of the design drawing,
there is an overcutting radius to the right of each machining path. The tool radius
compensation makes the actual movement of the tool always offset the value of a tool
radius. This makes the processed outline consistent with the design figure. Therefore, as
long as according to the size of the machining diagram, and then with this function to write
the machining program can get the correct finished product, without considering the
calculation trouble caused by the tool radius size in the program.

3) Notes

The command after G 41 and G42 must be a straight line command, not a circular
arc command.

1) Command format

G 50; / / Cancel the artifact coordinate offset


G 50X _Y _Z _; / / Set the artifact coordinate offset

2) Explain
Offset the specified value based on the existing artifact coordinates.

14 / 24
3) Notes

1) Command format

G51G 0X _Y _Z _A _C _

2) Explain

Conventional G 0 movement ensures the linear movement of the knife tip, and
some positive and negative speed conversion may occur on the axes. G51 is located point
to point with the current tip and based on the current artifact origin, and does not
participate in RTCP calculation.

3) Notes

The G 51 is only valid in the current line. The G51 can only be used with the G0.

1) Command format

G52G0X_Y _Z _

2) Explain

Position the tip to the specified coordinates at the origin of piece 0 (usually set to
0,0,0). It is equivalent to positioning the knife tip to the specified mechanical coordinates.

3) Notes

The G 52 works only in the current line. The G52 can only be used with the G0.

15 / 24
1) Command format

G53G0X _Y _Z _A _C _
X _Y _Z _: Mechanical coordinates of the axis.

2) Explain

Position the axes to the specified mechanical coordinates. Independent of the


artifact coordinates, and independent of the blade type.

3) Notes

The G 53 is valid only in the current line. The G53 can only be used with the G0.

1) Command format

G 54 ; / / 1 Workpiece origin
G54O 1 ; / / O1 is the origin of 7 workpiece, O2 is the origin of 8
workpiece, and so on
G 154O1 ; / / O1 is the origin of 7 workpiece, O2 is the origin of 8
workpiece, and so on
G 55 ; / / 2 Workpiece origin
G 56 ; / / 3 Workpiece origin
G 57 ;//4
G 58 ; / / 5 Workpiece origin
G 59 ;//6

2) Explain

When operating a machine, if multiple artifacts are placed on the workbench, the
position of each workpiece on the mechanical coordinate can then be defined by different
workpiece coordinate systems. In order to process each workpiece one by one.

16 / 24
3) Notes

1) Command format

G 61; / / The end of each path slows down to 0


G 62; / / The end of each path without switch directly to the next path. Not yet opened,
press
As to G61.
G 64; / / Plan the speed of each section according to the system acceleration
and deceleration parameters.

2) Explain

The G 61 is suitable for cutting purposes. The G 64 is suitable for curved surface
machining.

3) Notes

Cutting mode is set until the cutting mode setting command appears again.

1) Command format

G 70; / / inch units


G 71; / / Metric unit

2) Explain

After the metric unit switch, all the length units of the subsequent code
coordinates, tool data, and origin offset are explained according to the new unit.

3) Notes

The rotation axis is not affected by the unit setting.


17 / 24
1) Command format

G 72H _; / / Set the blade type specified by the H parameter


G72H_T_; / / Set the blade type specified by the H parameter and set the tool
number
G 72H _T _S _W _; / / Set the blade type specified by the H parameter, and set the
tool number, suction ker number, and flush
Water number

2) Explain

In addition to the mechanical coordinate programming, the coordinates of the


system are according to the tip of the knife. Different tools, mechanisms will have different
position reference, such as the bottom end of the saw blade, milling cutter bottom end,
suction cup center, measuring instrument contact point and so on. For a given target
position coordinate, the system ensures that the individual mechanism base position reaches
the specified position.

3) Notes

After the blade type is set, the coordinates of all subsequent instructions are
calculated for this blade type until a new blade type setting command is encountered. After
all processing code execution, the system may set the blade type to 0.

1) Command format

G 90;
G 91;

2) Explain
The code behind the G 90 setting is programmed in absolute value.
The code behind the G 91 setting is programmed incrementally.

3) Notes
18 / 24
1) Command format

G 92

2) Explain

Return from the child program to the previous program.

3) Notes

The G 92 can only be used in the subroutine. The master program cannot use the
G92.

1) Command format

G93P_Q_X_Y_

2) Explain

P: Port number, can have multiple P parameters, all port status 1 meets
the waiting condition. Q: Port number, can have multiple Q parameters, all
port status 0 meets the waiting condition.
X: Timeout time of waiting
Y: signal stabilization time.
If the following conditions are met, the command is successfully completed: port
status 1 specified by all P parameters, port status 0 specified by all Q parameters, all signals,
stability time meets the value specified by Y parameter, and the running time does not
exceed the value specified by X parameter. If the condition is still not satisfied after the time
specified by the X parameter, then the alarm occurs.

3) Notes

1) Command format
G101X_Y _Z _F _

19 / 24
2) Explain

G 101 Use a different set of acceleration and deceleration parameters to perform


linear machining. Suitable for the same processing of different materials or different parts of
the different processing.

3) Notes

1) Command format

G 17 {} X _ Y _} F _; X-Y plane arc interpolation

G 18 {} X _ Z _ {} F _; Z-X planar arc interpolation

G 19 {} Y _ Z _} F _; Y-Z plane arc interpolation

X, Y, and Z: Specify the point coordinates.


I, J, K: the vector value from the arc start to the center of the circle.
R: Arc radius.
F: feed rate.

2) Explain

G 102, G 103, the same function as G 2, G3. However, another set of acceleration
and deceleration parameters is used to perform linear machining. Suitable for the same
processing of different materials or different parts of the different processing.

3) Notes

R is a positive value when the circumference angle is less than or equal to 180°.
Negative R value when the circumference angle is greater than 180°. When the
circumference angle is 360°, it can only be used in I, J and K.

1) Command format
G 141 U _ V _ W _ I _ J_

20 / 24
2) Explain

U V W: Maximum starting point offset coordinate value after curve compensation.


IJ: compensate the minimum tool radius and maximum tool radius.

3) Notes

G 141 After starting, the subsequent command will perform the automatic radius
compensation, and the specific compensation method varies according to different
customers. Stop compensation automatic stopped via G40. G141, which needs to be
applied with the CutCam software.

1) Explain

Custom code according to customer request. The specific grammar should be


based on the customer's needs.

2) Notes

1) Command format

G 302

2) Explain

Position the Z-axis to the pre-set docking value of the system. Equivalent to the
G53G0Z__

3) Notes

21 / 24
1) Command format

G 303

2) Explain

Position the X axis Y axis to the docking value set by the system. Equivalent to the
G 53G 0X __Y__

3) Notes

1) Command format

G 304

2) Explain

For a specific location of machining, this command can ensure that all axes do stop,
achieve accuracy.

3) Notes

1) Command format

G 305

22 / 24
2) Explain

Position all the axes to the pre-set docking value of the system. Equivalent to the
G53G0X__Y__Z__A__C__

3) Notes

1) Command format

G 306

2) Explain

Position all axes except axis A to the pre-set docking value of the
system. Equivalent to the G 53G 0X __Y __Z __C __

3) Notes

1) Command format

34. G 400

2) Explain

System production workshop test and use for system internal self-inspection. The
user cannot execute this command. And this command requires the CutCam software to
run smoothly.

3) Notes
23 / 24

You might also like