Thursday, August 2, 2018

CNC Programming Examples - G40 G41 G42

  Thanh A Tran       Thursday, August 2, 2018

CNC Mill Subprogram Example Joining Multiple Arcs G02 G03 G41

CNC milling program to describe how two or more radii can be joint together in a cnc mill program.
Contents
  • CNC Mill Subprogram Example
    • CNC Part Program
    • Subprogram
    • G M S T Codes Explanation

CNC Mill Subprogram Example


CNC Part Program

N10 T1 H1 M6 G43 M3
        N20 F150 S250
        N30 G0 X-21 Y50 Z0.5
        N40 G0 Z0
        N50 M98 P040050
        N60 G49
        N70 G0 Z50
        N80 M30

Subprogram

O0050
        N10 F160 S400
        N20 G0 Z-2.5 G91
        N30 G1 G90 X5 Y50 G41      (P1)
        N40 G2 X22 Y85.23 I45 J0   (P2)
        N50 G3 X78 Y85.23 R45      (P3)
        N60 G2 X78 Y14.77 R45      (P4) 
        N70 G3 X22 Y14.77 R45      (P5)
        N80 G2 X5 Y50 R45          (P1)
        N90 G0 G40 X-21
        N100 M99

G M S T Codes Explanation

Code Description
G00 Rapid traverse
G01 Linear interpolation
G02 Circular interpolation CW
G03 Circular interpolation CCW
G40 Cutter compensation cancel
G41 Tool nose radius compensation left
G43 Tool length compensation + direction
G49 Tool length compensation cancel
G90 Absolute command
G91 Increment command
M03 Spindle start forward CW
M06 Tool change
M30 End of program (Reset)
M98 Subprogram call
M99 End of subprogram
T Tool
S Speed
F Feed

--------------

CNC Mill Program G91 G41 G43

CNC milling program examples shows the use of G91 G41 G43 G-codes.
Contents
  • CNC Mill Program G91 G41 G43
    • CNC Part Program
    • G M S T Codes Explanation

CNC Mill Program G91 G41 G43


CNC Part Program

N05 G54
            N10 M6 T1 G43 H1 M3
            N15 S500 F120
            N20 G0 X-22 Y-22
            N25 Z-3
            N30 G1 X3 Y6 G41 H2   (P1)
            N35 G91 X0 Y24        (P2)
            N40 X12 Y9            (P3)
            N45 X36               (P4)
            N50 Y-24              (P5)
            N55 X-21              (P6) 
            N60 G90 X3 Y6         (P1)
            N65 G0 X-21 G40

G M S T Codes Explanation

Code Description
G00 Rapid traverse
G01 Linear interpolation
G40 Cutter compensation cancel
G41 Tool nose radius compensation left
G43 Tool length compensation + direction
G54 Workpiece coordinate system 1 selection
G90 Absolute command
G91 Incremental command
M06 Tool change
T Tool
S Speed
F Feed

--------------

G41 G40 Cutter Radius Compensation Example CNC Mill Program

Cutter Radius Compensation Example program shows how G41, G40 can be used in a cnc mill program.
Cutter Compensation code used in this program are,
  • G41 Cutter Radius Compensation Left
  • G40 Cutter Radius Compensation Cancel

Cutter Radius Compensation Example


G41 G40 Cutter Radius Compensation Example
N5 G00 G54 G64 G90 G17 X20 Y-20 Z50
                N10 S450 M03 F250 D01 (12.5 MM DIA)
                N15 C0
                N20 Z5
                N25 G01 Z0
                N30 Z-5
                N35 G41 X0 Y0
                N40 X-48
                N45 X-68 Y72
                N50 X-28
                N55 Y44
                N60 X12 Y32
                N65 X0 Y0
                N70 G40 X20 Y-20
                N75 G00 Z50
                N80 Y100
                N85 M30
Finished Part
After machining process completion, component will look like

Cutter Radius Compensation Example Finished Part
Explanation of CNC G-Code
G00 : Rapid traverse.
G54 : Zero Offset no. 1.
G64 : Continuous-path mode.
G90 : Absolute dimensioning system.
G17 : X-Y plan selection.
G41 : Cutter radius compensation activation (left hand side movement)
G40 : Cutter radius compensation de-active
S : Spindle speed
F : Axis motion feed
M : Cutter rotation (3=clockwise, 4=anti-clockwise)
D : Tool offset no

-------------

Siemens Sinumerik Milling Programming Example

A very simple cnc milling program example which will show cnc machinists the use of Siemens Sinumerik milling programming concepts.
This program is written for 4-axis cnc mill, where C is used for rotary table.
But a simple cnc mill can also run this program just remove program block N15
Contents
  • Sinumerik Milling Program
    • Finished Part
    • Explanation of G-Code

Sinumerik Milling Program


Sinumerik Mill Programming Example
N5 G00 G54 G64 G90 G17 X-20 Y-20 Z50
                    N10 S450 M03 F250 D01 (12.5 MM DIA)
                    N15 C0
                    N20 Z5
                    N25 G01 Z0
                    N30 Z-5
                    N35 G42 X0 Y0
                    N40 X30
                    N45 Y30
                    N50 X0
                    N55 Y0
                    N60 G40 X-20 Y-20
                    N65 G00 Z50
                    N70 Y100
                    N75 M30

Finished Part

After the machining is complete, this finished part will look like this

Finished Part

Explanation of G-Code

G00 – Rapid traverse.
G54 – Zero Offset no 1.
G64 – Continuous-path mode.
G90 – Absolute dimensioning system.
G17 – X-Y plan selection.
G42 – Cutter radius compensation activation
G40 – Cutter radius compensation cancel
M03 – Cutter rotation clockwise
S – Spindle speed
F – Axis motion feed
D – Tool no

------------

CNC Lathe Programming Exercise Fanuc G71 Turning Cycle, G74 Peck Drilling Cycle

CNC programming exercise for cnc lathe machinists who work on Fanuc cnc control (or similar cnc control).
This cnc programming exercise use
Fanuc G71 Turning Cycle
Fanuc G74 Peck Drilling Cycle
Contents
  • CNC Lathe Programming Exercise
    • Used Tools & Operations

CNC Lathe Programming Exercise


CNC Lathe Programming Exercise Fanuc G71, G74 Cycles
N10 G40 G00
                        N20 G99
                        N60 T0101
                        N70 G50 S3500
                        N80 G96 S0240 M4
                        N90 G00 X72. Z0.1
                        N100 G01 X-1.6 F0.12 M7
                        N110 G00 X150. Z150.
                        N120 M5
                        N130 M9
                        N140 T0303
                        N150 G97 S2500 M3
                        N160 G00 X0. Z3.
                        N170 G01 Z-6. F0.1 M7
                        N180 G00 Z2.
                        N190 G00 X150. Z150.
                        N210 T0707 M7
                        N220 G97 S0884 M3
                        N230 G00 Z3.
                        N240 G00 X0.
                        N250 G74 R1.0
                        N260 G74 X0.0 Z-68.326 Q18000 F0.22
                        N380 G00 X200.
                        N400 G00 Z100.
                        N500 T0404 M7
                        N510 G50 S3500
                        N520 G96 S0240 M4
                        N530 G00 Z1.
                        N540 G00 X70.
                        N550 G71 U4. R1
                        N560 G71 P570 Q650 U0.6 W0.2 F0.35
                        N570 G42 G00 X24.
                        N580 G01 Z0.
                        N590 G01 X28. Z-2.
                        N600 G01 Z-72.
                        N610 G02 X32. Z-74. I2. K0.
                        N620 G01 X62.
                        N630 G01 X68. Z-77.
                        N640 G01 Z-90.
                        N650 G40
                        N660 G00 X150.
                        N680 G00 Z70.
                        N690 T0202 M7
                        N700 G50 S4500
                        N710 G96 S0380 M4
                        N720 G00 X16. Z3.
                        N730 G42 G01 Z0. F0.1
                        N740 G01 X24.
                        N750 G01 X28. Z-2.
                        N760 G01 Z-72.
                        N770 G02 X32. Z-74. I2. K0.
                        N780 G01 X62.
                        N790 G01 X68. Z-77.
                        N800 G01 Z-90.
                        N810 G40
                        N820 G00 X150. Z150.
                        N830 M5
                        N840 M9
                        N850 M30

Used Tools & Operations

  • T0101 Turning Tool – Rough Facing
  • T0303 Center Drill – Center Drilling
  • T0707 Twist Drill – Drilling
  • T0404 Turning Tool – Rough Turning
  • T0202 Turning Tool – Finish Contour Cutting

------------------

Fanuc G73 Pattern Repeating Cycle CNC Program Example Code

CNC programming example for Fanuc G73 pattern repeating cycle.
Fanuc G73 Pattern Repeating Cycle has already been described here
CNC Fanuc G73 Pattern Repeating Cycle
You might like other Fanuc G73 pattern repeating cycle examples
CNC Fanuc G73 Pattern Repeating Cycle CNC Program Example
Fanuc G73 Pattern Repeating Canned Cycle Basic CNC Sample Program

Fanuc G73 Pattern Repeating Cycle Programming Example

This cnc program example also shows how cnc machinists can use ‘W’ instead of ‘Z’ for z-axis movements.

Fanuc G73 Pattern Repeating Cycle Program Example
N010 G00 X260.0 Z80.0
                            N011 G00 X220.0 Z40.0
                            N012 G73 U14.0 W14.0 R3
                            N013 G73 P014 Q020 U4.0 W2.0 F0.3 S0180
                            N014 G00 G42 X80.0 Z2.0
                            N015 G01 W-20.0 F0.15 S0600
                            N016 X120.0 W-10.0
                            N017 W-20.0 S0400
                            N018 G02 X160.0 W-20.0 R20.0
                            N019 G01 X180.0 W-10.0 S0280
                            N020 G40
                            N021 G70 P014 Q020
                            N022 G00 X260.0 Z80.0
                            N023 M30


----------------

logoblog

Thanks for reading CNC Programming Examples - G40 G41 G42

Previous
« Prev Post

No comments:

Post a Comment