G41 and G42 Examples for CNC Milling

Example - 1

CNC Milling G41 Code Tool Offset Example

N1 T1 ; Tool 1 with offset D1
N5 G0 G17 G90 X5 Y55 Z50 ; Approach starting point
N6 G1 Z0 F200 S80 M3
N10 G41 G450 X30 Y60 F400 ; Compensation to the left of the contour, transition circle
N20 X40 Y80
N30 G2 X65 Y55 I0 J-25
N40 G1 X95
N50 G2 X110 Y70 I15 J0
N60 G1 X105 Y45
N70 X110 Y35
N80 X90
N90 X65 Y15
N100 X40 Y40
N110 X30 Y60
N120 G40 X5 Y60 ; Terminate compensation mode
N130 G0 Z50 M2

Example - 2

Profile definition with tool radius compensation(G40/G41/G42)

N5 T2 D2
N10 G0 G90 **G42 X0 Y0** Z5 S1000 M3 M41
N20 G94 G1 Z-5 F150
N30 X10.858 F200 ; Start machining the profile.
N40 G2 X39.142 I14.142 J-5
N50 G1 X100
N60 Y50
N70 X90 Y42
N80 X80 Y50
N90 Y20
N100 X55
N110 X38.672 Y56.172
N120 G3 X10 Y50 I-13.672 J-6.172
N130 G1 X10 Y20
N140 X0
N150 Y0 ; Finish machining the profile.
N160 G1 Z5
N170 G0 G40 X-30 Y-30 Z20 M30