127 Sets Processing 4000mm 127 Sets High-Precision CNC Lathes
15 Years of Experience

CNC Knowledge: Detailed explanation of CNC G code programming

1. Brief description of G code functions G00——Quick positioning G01——Linear interpolation G02——Clockwise arc interpolation G03——Arc interpolation counterclockwise G04——Timed pause G05——Circular interpolation by intermediate point G06——Parabolic interpolation G07——Z spline interpolation G08——feed acceleration G09——feed deceleration G10——Data parameters G16——Polar coordinate programming G17——Processing the XY plane G18——Processing of the XZ plane G19——Processing of the YZ plane G20——Size in inches […]

1. Brief description of G code functions

G00——Quick positioning

G01——Linear interpolation

G02——Clockwise arc interpolation

G03——Arc interpolation counterclockwise

G04——Timed pause

G05——Circular interpolation by intermediate point

G06——Parabolic interpolation

G07——Z spline interpolation

G08——feed acceleration

G09——feed deceleration

G10——Data parameters

G16——Polar coordinate programming

G17——Processing the XY plane

G18——Processing of the XZ plane

G19——Processing of the YZ plane

G20——Size in inches

G21 —– Metric size

G22——radius dimension programming method

G220 —– Used on system operation interface

G23——Diameter size programming method

G230 —– Used on system operation interface

G24——End of subroutine

G25——Jump processing

G26——Cycle processing

G30——rate cancellation

G31——magnification definition

G32——Constant pitch thread, inch system

G33——Constant pitch thread, metric

G34——increased pitch thread

G35——reduced pitch thread

G40——Tool compensation/tool ​​offset cancellation

G41——Tool compensation-left

G42——Tool compensation-right

G43——Positive tool offset

G44——Tool offset–negative

G45——Tool offset+/+

G46——Tool offset+/-

G47——Tool offset-/-

G48——Tool offset-/+

G49——Tool offset 0/+

G50——Tool offset 0/-

G51——Tool offset +/0

G52——Tool offset-/0

G53——Linear offset, disconnection

G54——Set part coordinates

G55——Set room coordinate two

G56——Set the coordinate of part three

G57——Set coordinate of part four

G58——Set part coordinate five

G59——Set coordinate of part six

G60——Precise path mode (fine)

G61——Precise trajectory mode (middle)

G62——Precise trajectory mode (coarse)

G63——Threading

G68——Tool offset, inside corner

G69——Tool offset, outside corner

G70——Size in inches, inches

G71——Metric dimensions, mm

G74——return to reference point (machine zero point)

G75——return to zero point of programming coordinates

G76——Thread Compound Cycle

G80——disconnect from fixed cycle

G81——outer circle fixed cycle

G331 —– Thread canned cycle

G90——absolute size

G91——Relative dimensions

G92——Prefabricated coordinates

G93——countdown, feed rate

G94——feed rate, feed per minute

G95——advance, advance per revolution

G96——constant linear speed control

G97——Cancel constant linear speed control


2. Detailed explanation of G code functions

1. Quick positioning

Format: G00 X(U)__Z(W)__

1) This command allows the tool to move quickly to the specified position according to the point control mode. The workpiece should not be processed during movement.

2) All programmed axes move simultaneously at the speed defined by the parameters. When an axis reaches the programmed value, it stops, while the other axes continue to move.

3) No programming is required for stationary coordinates.

4) G00 can be written G0

2. Linear interpolation

Format: G01 X(U)__Z(W)__F__(mm/min)

1) This command moves the tool to the specified position using linear interpolation. The movement speed is the feed rate of the F command. All coordinates can be executed jointly.

2) G01 can also be written G1

3. Interpolation of arcs

Format 1: G02X(u)____Z(w)____I____K____F______

1) When X and Z are at G90, the arc end point coordinates are the absolute values ​​of the coordinates relative to the programmed zero point. In G91, the arc end point is the incremental value relative to the arc start point. Regardless of G90 or G91, I and K are the incremental coordinates of the center of the arc relative to the starting point. I is the X direction value and K is the Z direction value. The circle center coordinates cannot be omitted during arc interpolation unless programmed in other formats.

2) When programming the G02 instruction, you can directly program quadrant circles, full circles, etc.

Note: When crossing the quadrant, compensation for the gap will be automatically carried out. If the offset compensation input at the end of the parameter area is significantly different from the actual reverse offset of the machine tool, obvious cuts will be produced on the part.

3) G02 can also be written G2.

Example: G02 X60 Z50 I40 K0 F120

Format 2: G02X(u)____Z(w)____R(+\-)__F__

1) Cannot be used for full loop programming

2) R is the radius of the arc R on one side of the part. R is signed, “+” means the arc angle is less than 180 degrees; “-” means the arc angle is greater than 180 degrees. The “+” can be omitted.

3) It is based on the coordinates of the end point. When the length value between the end point and the start point is greater than 2R, a straight line is used instead of the arc.

Example: G02 X60 Z50 R20 F120

Format 3: G02X(u)____Z(w)____CR=__(radius)F__

Format 4: G02X(u)____Z(w)__D__ (diameter) F___

These two programming formats are basically the same as format 2

Note: Except for the opposite direction of arc rotation, the format is the same as the G02 command.

4. Scheduled break

Format: G04__F__ or G04__K__

The processing movement is interrupted once the time has elapsed, the processing continues. The pause time is specified by the data following F. The unit is seconds.

The range is from 0.01 seconds to 300 seconds.

5. Midpoint arc interpolation

Format: G05X(u)____Z(w)____IX_____IZ______F_____

X and Z are the coordinate values ​​of the end point, and IX and IZ are the coordinate values ​​of the intermediate point. Others are similar to G02/G03.

Example: G05 X60 Z50 IX50 IZ60 F120

6. Acceleration/deceleration

Format: G08

They occupy a single line in the program section. When this section is executed in the program, the feed rate will increase by 10%. If it is to be increased by 20%, it must be written in two separate sections.

7. Programming the radius

Format: G22

If it occupies its own line in the program, the system operates in radius mode and subsequent values ​​in the program are also based on the radius.

8. Diameter size programming method

Size: G23

If it occupies its own line in the program, the system operates in diameter mode and subsequent values ​​in the program are also based on diameter.

9. Jump processing

Format: G25 LXXX

When the program runs on this program, it transfers to the program segment it specifies. (XXX is the program segment number).

10. Cyclic treatment

Format: G26 LXXX QXX

When the program executes this section of the program, the specified program section starts with this section as the loop body, and the number of loops is determined by the value after Q.

11. Cancellation of the rate

Format: G30

Occupy its own line in the program and use it with G31 to override G31’s function.

12. Definition of magnification

Format: G31 F_____

G32—Constant Pitch (Imperial) Thread Processing

G33—Constant pitch (metric) thread processing

Format: G32/G33 X(u)____Z(w)____F____

1) X and Z are the coordinates of the end point and F is the step.

2) G33/G32 can only process single tool and single start threads.

3) Changes to the X value can handle tapered threads

4) When using this command, the spindle speed cannot be too high, otherwise the tool wear will be greater.

13. Set workpiece coordinates/set maximum spindle speed (low)

Format: G50 S____Q____

S is the highest spindle speed and Q is the lowest spindle speed.

14. Set room coordinates

Format: G54

There can be multiple coordinate systems in the system. G54 is the first coordinate system, and its original position value is set in the machine tool settings.

G55: set the coordinate of part two

Same as above

G56—Set Part Coordinate Three

Same as above

G57—Set Part Coordinate Four

Same as above

G58—Set Part Coordinate Five

Same as above

G59—Set part coordinate six

Same as above

15. Exact path method

Format: G60

In the actual processing process, when multiple actions are connected together and programmed with precise paths, there will be a buffering process (i.e. deceleration) when executing the next section of treatment.

16. Continuous path method

Format: G64

Compared to the G60. Mainly used for rough machining.

17. Return to reference point (machine zero point)

Format: G74 XZ

1) No other content may appear in this paragraph.

2) Coordinates appearing after G74 will return to zero in X and Z order.

3) Before using the G74, you must confirm that the machine tool is equipped with a reference point switch.

4) Single axis zero feedback can also be performed.

18. Return to zero point of programmed coordinates

Size: G75 XZ

Return to zero point of programmed coordinates

19. Return to starting point of programming coordinates

Format: G76

Return to the position where the tool started machining.

20. Canned cycle of the outer circle (inner circle)

Format: G81__X(U)__Z(W)__R__I__K__F__

1) X, Z are the end point coordinate values, U, W are the end point increment values ​​from the current point.

2) R is the diameter of the starting section to be treated.

3) I is the rough turning feed, K is the finishing turning feed, I and K are signed numbers and the signs of both must be the same. The symbol convention is: cutting from the outside to the center axis (turning the outer circle) is “-“, and vice versa is “+”.

4) Different X, Z, R determine different switches of the outer circle, such as: with or without taper, forward taper or reverse taper, left cut or right cut, etc.

5) F is the cutting speed (mm/min).

6) Once processing is completed, the tool stops at the end point.

Example: G81 X40 Z 100 R15 I-3 K-1 F100

Treatment process:

1) G01 advances I 2 times (the first cut is I and the last cut is an I+K finish) for a deep cut.

2) G01 two-axis interpolation, cut to the final section and stop if processing is completed.

3) G01 retracts the knife I to a safe position and at the same time performs auxiliary smoothing of the cutting surface.

4) G00 quickly advances outward from the high work surface I, leaving I for the next cutting process, repeat up to 1.

21. Absolute value programming

Format: G90

1) When G90 is programmed, all coordinate values ​​programmed in the future are based on the programmed zero point.

2) After the system is powered on, the machine tool is in G state.

N0010 G90 G92 x20 z90

N0020 G01X40 Z80 F100

N0030 G03X60 Z50 I0K-10

N0040M02

22. Incremental programming

Format: G91

When G91 is programmed, all subsequent coordinate values ​​use the previous coordinate position as the starting point to calculate the programmed movement value. In the next segment of the coordinate system, the previous point is always used as the starting point for programming.

Example: N0010 G91 G92 X20 Z85

N0020 G01X20 Z-10 F100

N0030Z-20

N0040X20Z-15

N0050M02

23. Set the room coordinate system

Format: G92 X__ Z__

1) G92 only changes the coordinate value currently displayed by the system, without moving the coordinate axis, to achieve the purpose of setting the coordinate origin.

2) The effect of G92 is to change the displayed coordinates of the tool tip to the set value.

3) XZ behind G92 can be programmed separately or entirely.

24. Subroutine call

Format: G20 L__

N__

1) After L is the program name after N of the subroutine to be called, but N cannot be entered. Only numbers 1 to 99999999 are allowed after N.

2) This program must not contain content other than the description above.

25. End and return of the subroutine

Format: G24

1) G24 indicates the end of the subroutine and returns to the next section of the program that called the subroutine.

2) G24 and G20 appear in pairs

3) No other instructions are permitted in this section of G24.

3. G Code Programming Examples

Example: The following example illustrates the process of passing parameters when calling a subroutine.

Program name: P10

M03 S1000

G20L200

M02

N200 G92 X50 Z100

G01 X40 F100

Z97

G02 Z92 X50 I10 K0 F100

G01 Z-25 F100

G00 X60

Z100

G24

If you want to call it multiple times, please use it in the following format

M03 S1000

N100 G20 L200

N101 G20 L200

N105 G20 L200

M02

N200 G92 X50 Z100

G01 X40 F100

Z97

G02 Z92 X50 I10 K0 F100

G01 Z-25 F100

G00 X60

Z100

G24

G331—Thread machining cycle

Format: G331 X__ Z__I__K__R__p__

1) Diameter changes in X direction, X=0 is straight thread

2) Z is the thread length, absolute or relative programming is available

3) I is the runout length in the X direction after thread cutting, value ±

4) The diameter difference between the outer diameter of the thread R and the root diameter, positive value

5) Not K KMM

6) The number of thread processing cycles p, i.e. how many cuts are required to complete the cut

hint:

1) The depth of each cut is R÷p and rounded to the nearest integer. The final cut is not made to smooth the surface of the thread.

2) The name of internal thread removal is determined according to the positive and negative directions of X.

3) The starting position of the thread processing cycle is to align the tool tip with the outer circle of the thread.

example:

M3

G4 f2

G0x30z0

G331 z-50 x0 i10 k2 r1.5 p5

G0 z0

M05

4. Supplements and notes

1. G00 and G01

There are two types of G00 motion paths: straight line and polyline. This command is only used for point positioning and cannot be used for cutting processing.

G01 moves to the target point specified by the instruction in a linear motion at the specified feed rate and is generally used for cutting processing.

2. G02 and G03

G02: Arc interpolation clockwise.

G03: Arc interpolation counterclockwise.

3. Delay or pause command G04

Generally used for forward and reverse switching, processing of blind holes, stepped holes, as well as turning and grooving.

4. Instructions for selecting plans G17, G18, G19

Specified surface treatment, typically used on milling machines and machining centers

G17: XY plane, can be omitted, or it can be a plane parallel to the XY plane

G18: XZ plane or plane parallel to it. There is only XZ plane in CNC lathes and does not need to be specially specified.

G19: YZ plane or a plane parallel to it

5. Reference point commands G27, G28, G29

G27: Return to reference point, check and confirm reference point position

G28: Automatic return to the reference point (intermediate point crossing)

G29: Reference point feedback, used in conjunction with G28

6. Radius compensation G40, G41, G42

G40: Cancel tool radius compensation

G41: Left tool radius compensation

G42: Straight tool radius compensation

7. Length compensation G43, G44, G49

G43: Positive length compensation

G44: Negative length compensation

G49: Cancel tool length compensation

8.G32, G92, G76

G32: Thread

G92: Fixed threading cycle

G76: Compound threading cycle

9. Turning processing: G70, G71, 72, G73

G71: Control of the axial roughing compound cycle

G70: Compound finishing cycle

G72: Face turning, radial rough turning cycle

G73: Copy of the rough turning cycle

10. Milling machines and machining centers:

G73: High speed deep stripping drilling

G83: Deep drilling

G81: drilling cycle

G82: Deep drilling cycle

G74: Left-hand thread processing

G84: Right-hand thread processing

G76: Fine boring cycle

G86: Boring machining cycle

G85: Bore

G80: Cancel cycle command

11. Programming method G90, G91

G90: Absolute coordinate programming

G91: Incremental coordinate programming

12. Spindle adjustment control

G50: Setting the maximum spindle speed

G96: Constant linear speed control

G97: Spindle speed control (cancel constant linear speed control command)

G99: Return to point R (middle hole)

G98: Return to reference point (last hole)

13. Spindle forward and reverse stop commands M03, M04, M05

M03: Spindle front transmission

M04: Spindle reverse rotation M05: Spindle stop

14. Coolant switches M07, M08, M09

M07: Spray cutting fluid on

M08: Opening the liquid cutting fluid

M09: Cutting fluid

15. Stopping movement M00, M01, M02, M30

M00: program pause

M01: Final plan

M02: Resetting the machine tool

M30: The program ends and the pointer returns to the beginning

16. M98: subroutine call

17. M99: Return to the main program

Daguang focuses on providing solutions such as precision CNC machining services (3-axis, 4-axis, 5-axis machining), CNC milling, 3D printing and rapid prototyping services.

CNC Experts

Picture of JinShui Chen

JinShui Chen

Rapid Prototyping & Rapid Manufacturing Expert

Specialize in CNC machining, 3D printing, urethane casting, rapid tooling, injection molding, metal casting, sheet metal and extrusion

CNC Recent Posts

CNC News

Welcome to GreatLight Metal,Maximum Processing Size 4,000 mm

Precision Machining CNC Quote Online

Loading file

Upload Click here to upload or drag and drop your model to the canvas.

The model is too large and has been resized to fit in the printer's build tray. [Hide]

The model is too large to fit in the printer's build tray. [Hide]

The model is too large, a fitting printer is selected. [Hide]

The model is too small and has been upscaled. [Hide]

Warning: The selected printer can not print in full color [Hide]

Warning: obj models with multiple meshes are not yet supported [Hide]

Warning: Unsupported DXF entity  [Hide]

Warning: could not arrange models [Hide]



	
⚡ Instant Quote for Precision Manufacturing

Submit your design files (STEP/IGES/DWG) and receive a competitive quote within 1 hour, backed by ISO 9001-certified quality assurance.

📋 How It Works

  1. Upload & SpecifyShare your 3D model and select materials (Aluminum/Stainless Steel/Titanium/PEEK), tolerances (±0.002mm), and surface treatments.

  2. AI-Powered AnalysisOur system calculates optimal machining strategy and cost based on 10+ years of automotive/aerospace data.

  3. Review & ConfirmGet a detailed breakdown including:
    - Volume pricing tiers (1-10,000+ units)
    - Lead time (3-7 days standard)
    - DFM feedback for cost optimization

Unit Price: 

Loading price
5 Axis CNC Machining Equipment
4 Axis CNC Machining Equipment
3 Axis CNC Machining Equipment
CNC Milling & Turning Equipment
Prototype and Short-Run Injection Moldings Exact plastic material as final design
Volume Metal Die Casting Services - Precision Cast Parts
Bridge the Gap From Prototype to Production – Global delivery in 10 days or less
Custom high-precision sheet metal prototypes and parts, as fast as 5 days.
Custom Online 3D Printing Services
Custom Online 3D Printing Services
Custom Online 3D Printing Services
Design Best Processing Method According To 3D Drawings
Alloys Aluminum 6061, 6061-T6 Aluminum 2024 Aluminum 5052 Aluminum 5083 Aluminum 6063 Aluminum 6082 Aluminum 7075, 7075-T6 Aluminum ADC12 (A380)
Alloys Brass C27400 Brass C28000 Brass C36000
Alloys Stainless Steel SUS201 Stainless Steel SUS303 Stainless Steel SUS 304 Stainless Steel SUS316 Stainless Steel SUS316L Stainless Steel SUS420 Stainless Steel SUS430 Stainless Steel SUS431 Stainless Steel SUS440C Stainless Steel SUS630/17-4PH Stainless Steel AISI 304
Inconel718
Carbon Fiber
Tool Steel
Mold Steel
Alloys Titanium Alloy TA1 Titanium Alloy TA2 Titanium Alloy TC4/Ti-6Al 4V
Alloys Steel 1018, 1020, 1025, 1045, 1215, 4130, 4140, 4340, 5140, A36 Die steel Alloy steel Chisel tool steel Spring steel High speed steel Cold rolled steel Bearing steel SPCC
Alloys Copper C101(T2) Copper C103(T1) Copper C103(TU2) Copper C110(TU0) Beryllium Copper
Alloys Magnesium Alloy AZ31B Magnesium Alloy AZ91D
Low Carbon Steel
Alloys Magnesium Alloy AZ31B Magnesium Alloy AZ91D
ABS Beige(Natural) ABS Black ABS Black Antistatic ABS Milky White ABS+PC Black ABS+PC White
PC Black PC Transparent PC White PC Yellowish White PC+GF30 Black
PMMA Black PMMA Transparent PMMA White
PA(Nylon) Blue PA6 (Nylon)+GF15 Black PA6 (Nylon)+GF30 Black PA66 (Nylon) Beige(Natural) PA66 (Nylon) Black
PE Black PE White
PEEK Beige(Natural) PEEK Black
PP Black PP White PP+GF30 Black
HDPE Black HDPE White
HIPS Board White
LDPE White
This is a finish of applying powdered paint to the components and then baking it in an oven, which results in a stronger, more wear- and corrosion-resistant layer that is more durable than traditional painting methods.
No coating required, product’s natural color!
This is a finish of applying powdered paint to the components and then baking it in an oven, which results in a stronger, more wear- and corrosion-resistant layer that is more durable than traditional painting methods.
This finishing option with the shortest turnaround time. Parts have visible tool marks and potentially sharp edges and burrs, which can be removed upon request.
Sand blasting uses pressurized sand or other media to clean and texture the surface, creating a uniform, matte finish.
Polishing is the process of creating a smooth and shiny surface by rubbing it or by applying a chemical treatmen
A brushed finish creates a unidirectional satin texture, reducing the visibility of marks and scratches on the surface.
Anodizing increases corrosion resistance and wear properties, while allowing for color dyeing, ideal for aluminum parts.
Black oxide is a conversion coating that is used on steels to improve corrosion resistance and minimize light reflection.
Electroplating bonds a thin metal layer onto parts, improving wear resistance, corrosion resistance, and surface conductivity.
This is a finish of applying powdered paint to the components and then baking it in an oven, which results in a stronger, more wear- and corrosion-resistant layer that is more durable than traditional painting methods.
This is a finish of applying powdered paint to the components and then baking it in an oven, which results in a stronger, more wear- and corrosion-resistant layer that is more durable than traditional painting methods.
Please provide additional text description for other surface treatment requirements!
The world's first CNC machining center that dares to provide free samples!

Free for first product valued at less than $200. (Background check required)

precision machining cnc quote online

15 Years CNC Machining Services

When you’re ready to start your next project, simply upload your 3D CAD design files, and our engineers will get back to you with a quote as soon as possible.
Scroll to Top

ISO 9001 Certificate

ISO 9001 is defined as the internationally recognized standard for Quality Management Systems (QMS). It is by far the most mature quality framework in the world. More than 1 million certificates were issued to organizations in 178 countries. ISO 9001 sets standards not only for the quality management system, but also for the overall management system. It helps organizations achieve success by improving customer satisfaction, employee motivation, and continuous improvement. * The ISO certificate is issued in the name of FS.com LIMITED and applied to all the products sold on FS website.

greatlight metal iso 9001 certification successfully renewed
GB T 19001-2016 IS09001-2015
✅ iso 9001:2015
greatlight metal iso 9001 certification successfully renewed zh

IATF 16949 certificate

IATF 16949 is an internationally recognized Quality Management System (QMS) standard specifically for the automotive industry and engine hardware parts production quality management system certification. It is based on ISO 9001 and adds specific requirements related to the production and service of automotive and engine hardware parts. Its goal is to improve quality, streamline processes, and reduce variation and waste in the automotive and engine hardware parts supply chain.

automotive industry quality management system certification 01
Certification of Production Quality Management System for Engine Hardware Parts Engine Hardware Associated Parts
automotive industry quality management system certification 00
发动机五金零配件的生产质量管理体系认证

ISO 27001 certificate

ISO/IEC 27001 is an international standard for managing and processing information security. This standard is jointly developed by the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC). It sets out requirements for establishing, implementing, maintaining, and continually improving an information security management system (ISMS). Ensuring the confidentiality, integrity, and availability of organizational information assets, obtaining an ISO 27001 certificate means that the enterprise has passed the audit conducted by a certification body, proving that its information security management system has met the requirements of the international standard.

greatlight metal technology co., ltd has obtained multiple certifications (1)
greatlight metal technology co., ltd has obtained multiple certifications (2)

ISO 13485 certificate

ISO 13485 is an internationally recognized standard for Quality Management Systems (QMS) specifically tailored for the medical device industry. It outlines the requirements for organizations involved in the design, development, production, installation, and servicing of medical devices, ensuring they consistently meet regulatory requirements and customer needs. Essentially, it's a framework for medical device companies to build and maintain robust QMS processes, ultimately enhancing patient safety and device quality.

greatlight metal technology co., ltd has obtained multiple certifications (3)
greatlight metal technology co., ltd has obtained multiple certifications (4)

Get The Best Price

Send drawings and detailed requirements via Email:[email protected]
Or Fill Out The Contact Form Below:

All uploads are secure and confidential.