Pushing the Limits of Home Machining with G-Code, GRBL, CNCJS, and Macro Magic

by | Mar 10, 2024 | DIY 5axis CNC マシン, 工作機械の基礎, CNCルーター | 0 comments

Programs to be used with CNCjs macro function

Continuous Linear Machining Program

This CNC program is designed for a machining operation that sequentially cuts along three lines defined by points A, B, and C, in three separate passes, each deeper than the last. Here's a breakdown of the variables and their use:

Variables

  • %DEPTH: The total depth of the cut, set to -9 units. This value is negative because CNC machines use negative values to represent movement downwards into the material.
  • %POINT_A_X, %POINT_A_Y: The X and Y coordinates of point A, marking the start of the first line.
  • %POINT_B_X, %POINT_B_Y: The X and Y coordinates of point B, the end of the first line and start of the second.
  • %POINT_C_X, %POINT_C_Y: The X and Y coordinates of point C, the end of the second line and theoretically back to the origin if it's a closed shape.

Usage

  1. Setup: Ensure the CNC machine is configured for metric units (G21), and the spindle speed (S5000) and feed rate (F30) are set.
  2. Initial Positioning: The program starts by moving the tool to a safe height (Z5) above the material and then positions the tool at the origin (X0 Y0).
  3. Cutting Process:
    • The tool moves down to the surface (Z0) and then begins the cutting process.
    • In each of the three passes, the tool moves down a third of the total depth (%DEPTH/3) and then sequentially moves along the lines from point A to B to C, creating a continuous path.
    • After each pass, the tool retracts to a safe height (Z13), stops the spindle (M5), moves back to the origin (X0 Y0), and pauses (M0). Before starting the next pass, the spindle restarts (M3), and the tool moves back down (Z-13 minus the additional depth).
  4. Completion: After the final pass, the program ends with M30, signaling the end of the program and resetting the machine for the next operation.

Key Points

  • The tool depth increases incrementally with each pass, making this program ideal for gradual material removal, ensuring precision, and avoiding excessive load on the tool.
  • The use of relative coordinates (G91) for movement ensures that each action builds upon the last, facilitating easy adjustments to the path without recalculating from a fixed origin.
  • This program is suitable for operations requiring multiple, controlled-depth passes, such as engraving, channel cutting, or creating complex shapes with precise depth control.
Continuous Linear Machining Program (Awesome LINES Freak)

;Awesome LINES Freak

G90 G94
G17
G21;MM
%DEPTH = -9

;Enter as G91
%POINT_A_X = 60
%POINT_A_Y = 0

%POINT_B_X = 11
%POINT_B_Y = -11

%POINT_C_X = 0
%POINT_C_Y = 0

S5000 M3
F30

G90
G0 Z5
X0 Y0

G0 Z0

;1
G91 G1 Z[DEPTH/3]G91 G1 X[POINT_A_X] Y[POINT_A_Y]
G91 G1 X[POINT_B_X] Y[POINT_B_Y]
G91 G1 X[POINT_C_X] Y[POINT_C_Y]

G91 G0 Z13
M5
G90 X0 Y0
M0
M3
G91 G0 Z-13

;2
G91 G1 Z[DEPTH/3]G91 G1 X[POINT_A_X] Y[POINT_A_Y]
G91 G1 X[POINT_B_X] Y[POINT_B_Y]
G91 G1 X[POINT_C_X] Y[POINT_C_Y]

G91 G0 Z13
M5
G90 X0 Y0
M0
M3
G91 G0 Z-13

;3
G91 G1 Z[DEPTH/3]G91 G1 X[POINT_A_X] Y[POINT_A_Y]
G91 G1 X[POINT_B_X] Y[POINT_B_Y]
G91 G1 X[POINT_C_X] Y[POINT_C_Y]

G91 G0 Z13
M5
G90 X0 Y0
M30

Hole making program

In this CNC program, variable settings and conditional branching are utilized to automate and precisely execute hole drilling or circular grooving operations repeatedly. Here's a detailed explanation:

Variable Settings

  • %TOOL_D = 3: Sets the tool diameter to 3mm.
  • %DIAMETER = 20: Sets the diameter of the circle to be machined to 20mm.
  • %Z_ST = 0: Sets the starting Z-coordinate for machining at 0.
  • %Z_DEPTH = -8: Sets the final Z-coordinate for machining at -8mm, indicating the total depth of material to be removed.
  • %NO_CUT = 20: Sets the number of passes (rounds of machining) to 20.
  • %A_DEPTH = [Z_DEPTH - Z_ST] / NO_CUT: Calculates the depth of cut for each pass. This evenly divides the total depth by the number of cuts, ensuring material is removed uniformly.

Conditional Branching

Conditional branching is used as %UN = [(COUNT <= NO_CUT) ? COUNT : -1]. This means “if COUNT (the current number of passes) is less than or equal to NO_CUT (the total number of passes), then set %UN to COUNT; otherwise, set it to -1.” This logic checks if the machining process has reached the specified number of passes and determines whether all machining operations have been completed.

Use within the Machining Process

With this logic, the program operates as follows:

  1. Increment %COUNT by 1 for each machining cycle.
  2. Use %UN for conditional branching, executing the machining command (N[UN] G91 G3...) only if %COUNT is less than or equal to %NO_CUT. This ensures the circular path is followed for the specified number of times.
  3. Once the specified number of passes is completed, the program stops executing machining commands.

This method allows the program to automatically and accurately perform the specified hole drilling or circular grooving operations with predetermined depth and diameter. Using conditional branching provides flexibility in controlling the machining process, making the program easily adjustable and reusable.

Continuous Linear Machining Program (Awesome HOLES Freak)

;Awesome HOLES Freak

G90 G94
G17
G21;MM
;——————————————————————–
%TOOL_D = 3 ;Tool Diameter
%DIAMETER = 20
%Z_ST = 0 ;Machining start Z-coordinate
%Z_DEPTH = -8 ;Machining of the final Z-coordinate
%NO_CUT = 20 ;number of rounds (of a machine)

S5000 M3
F1000
G90 G0 Z5 ;Moving height
G90 X0 Y0 ;Machining Center Seat Standard

;——————————————————————–

;Move to start point
G91 G0 Y[DIAMETER/2 – TOOL_D/2]G90 G0 Z[Z_ST]

%COUNT = 0
%A_DEPTH = [Z_DEPTH- Z_ST] / NO_CUT

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

%COUNT = COUNT+1;————————————————————–
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G3 J-[DIAMETER/2 – TOOL_D/2] Y-[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]N[UN] G91 G3 J[DIAMETER/2 – TOOL_D/2] Y[DIAMETER – TOOL_D] Z[A_DEPTH/2 ]

 

G90 G0 Z[Z_ST+5]M5
M30

Slotting program

This CNC program is designed for machining a rectangular piece with rounded corners, also known as a “filleted rectangle.” It incrementally cuts the material in layers to achieve the final depth, using a combination of linear and circular (G1 and G3) movements. Here’s a breakdown of its key variables, functions, and usage:

Variables Setup

  • %TOOL_D: Diameter of the cutting tool.
  • %CORNER_R: Radius of the rectangle's corners. This must be larger than the tool radius to accommodate the tool's size during the rounding process.
  • %X_WIDE and %Y_WIDE: The dimensions of the rectangle in the X and Y directions, respectively.
  • %Z_ST: Starting Z-coordinate for machining.
  • %Z_DEPTH: Final Z-coordinate, indicating the total depth of the cut.
  • %NO_CUT: Number of passes the tool makes to reach the final depth, facilitating incremental cutting.

Key Calculations

  • %QUARTER, %LENGTH, %A_DEPTH, %Z_DEPTH_X, %Z_DEPTH_Y, %Z_DEPTH_R: These are calculated values used to control the depth and length of each pass, ensuring uniform material removal across the rectangle and its rounded corners.

Machining Process

  • The program starts with setting up the machine with G90, G94, G17, G21 for absolute positioning, feed rate per minute, XY plane selection, and measurement in millimeters, respectively.
  • It then moves the tool to the starting position, accounting for the tool diameter and corner radius.
  • For each pass (%COUNT increment), the tool moves linearly (G1) and arcs (G3) around the corners with calculated Z-depth adjustments (%Z_DEPTH_X, %Z_DEPTH_Y, %Z_DEPTH_R) to create the filleted rectangle. The process repeats for the specified number of cuts (%NO_CUT).
  • Conditional checks (%UN) are used to continue the loop until the required number of passes is completed, adjusting the cutting depth incrementally with each pass.
  • Finally, a finishing pass is made at the full depth to ensure the final surface quality.

Usage

  1. Prepare the Machine: Load the program, set up the tool with the specified diameter, and secure the material.
  2. Program Variables: Adjust the %X_WIDE, %Y_WIDE, %Z_DEPTH, and %NO_CUT variables as needed for your specific project requirements.
  3. Run the Program: Start the machining process. The tool will automatically perform the necessary linear and circular movements to machine the filleted rectangle.

This program is particularly useful for parts requiring precise rounded corners, common in dies, molds, and mechanical components. Its incremental depth approach minimizes tool wear and allows for efficient material removal.

Slotting program (Awesome SLOTS Freak)

;Awesome SLOTS Freak

G90 G94
G17
G21;MM
;——————————————————————–
%TOOL_D = 3 ;Tool Diameter
%CORNER_R = 11.5 ;Radius of 4 corners.Set more than tool radius.
%X_WIDE = 23 ;Set above tool diameter
%Y_WIDE = 23 ;Set above tool diameter
%Z_ST = 0 ;Machining start Z-coordinate
%Z_DEPTH = -2.8 ;Machining of the final Z-coordinate
%NO_CUT = 30 ;number of rounds (of a machine)

S5000 M3
F1000
G90 G0 Z5 ;Moving height
G90 X0 Y0 ;Machining Center Seat Standard

;——————————————————————–

%QUARTER =[0.785*[CORNER_R*2 – TOOL_D]]%LENGTH = [QUARTER*4+[X_WIDE – TOOL_D]*2+[Y_WIDE – TOOL_D]*2] ;Distance per lap
%A_DEPTH = [ Z_ST – Z_DEPTH] / NO_CUT ;One cut

%Z_DEPTH_X = [[[X_WIDE – TOOL_D] / LENGTH]*A_DEPTH]%Z_DEPTH_Y = [[[Y_WIDE – TOOL_D] / LENGTH]*A_DEPTH]%Z_DEPTH_R = [-[QUARTER / LENGTH]*A_DEPTH]

;Move to start point
G91 G0 X[X_WIDE/2 – CORNER_R*2/2] Y[Y_WIDE/2 – CORNER_R*2/2]G91 G0 Y[CORNER_R*2/2 – TOOL_D/2]G90 G0 Z[Z_ST]

%C_DEPTH =Z_ST
%COUNT = 0

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

%COUNT = COUNT+1;————————————————————–
%C_DEPTH = C_DEPTH – A_DEPTH
%UN = [(COUNT <= NO_CUT) ? COUNT : -1]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2] Z[-Z_DEPTH_X]N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2] Z[-Z_DEPTH_Y]N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2] Z[Z_DEPTH_R]

;仕上げ加工
%UN = 9999
G90 G1 Z[Z_DEPTH]N[UN] G91 G1 X[ -X_WIDE +CORNER_R*2]
N[UN] G91 G3 J-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2]

N[UN] G91 G1 Y[ -Y_WIDE +CORNER_R*2]
N[UN] G91 G3 I[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y-[CORNER_R*2/2 – TOOL_D/2]

N[UN] G91 G1 X[ X_WIDE – CORNER_R*2]
N[UN] G91 G3 J[CORNER_R*2/2 – TOOL_D/2] X[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2]

N[UN] G91 G1 Y[ Y_WIDE – CORNER_R*2]
N[UN] G91 G3 I-[CORNER_R*2/2 – TOOL_D/2] X-[CORNER_R*2/2 – TOOL_D/2] Y[CORNER_R*2/2 – TOOL_D/2]

G90 G0 Z[Z_ST+5]M5
M30