kene02
kene02

Reputation: 213

Problem with toolpath generated by G-Code

I've written the following code to machine the outer profile of the part shown in Figure 1 with a Ø12 mm end mill tool (Tool index 04), spindle speed of 720 RPM, feed rate of 70 mm/min and a depth of cut of 3 mm:

; 12 mm diam. endmill used (tool index 04)
; Machine home position at (-50, 0, 40)
O0001
N010 G40 M06 T04 ; Disable cutter compensation, switch to tool no 04
N020 G21 G90 G92 X-50 Y0 Z40 M04 S720 
; Metric input, abs coords, set origin, set spindle speed to 720 RPM
N030 G00 X-10 Y0 Z5 M08 ; Move to start position, coolant on
N040 G01 G94 Z0.5 F70 ; Lower tool, set feed rate to 70 mm/min
N050 G10 P04 R6 ; Setting offset value of tool in Slot 4 (radius = 6 mm)
N060 G41 G01 X10 Y30 D04 ; Cutter radius compensation left
N070 G91 M98 P0033 L7 ; Incremental coords, call subprogram O0033 7 times
N080 G90 G00 Z5 M09
N090 X-50 Y0 Z40 M05
N100 M30 ; End of program

O0033
N010 G01 Z-3 ; Lower endmill by 3 mm
N020 Y130 ; Machine left edge
N030 G02 X20 Y20 R20 ; Cut radius on top left corner
N040 G01 X180 ; Machine top edge
N050 G02 Y-120 R60 ; Machine big radius on the right
N051 X-120 R60
N060 G01 X-60
N070 X-35 Y14
N080 X-45
N090 G03 Y-20 R20
N100 G01 Y-24
N110 G02 X-20 R20
N120 Y20 R20
N130 M99 ; Return to main program

enter image description here Figure 1: Part to machine

However, when I put my code into this toolpath viewer, it shows this: enter image description here

Can someone please explain why this is happening?

Upvotes: 0

Views: 28

Answers (0)

Related Questions