🛠️ Internal Grooving with Parametric CNC Code

A real-world example from our CNC lathe

At our precision machining workshop, we often need to create internal grooves in cylindrical parts, such as bushings, spacers, or seal housing seats.
To simplify these repetitive operations, I created a parametric CNC program that generates a standard cycle, easily adaptable by modifying just a few parameters at the top of the code.

This software has been successfully tested on CMZ TA30Y and TA20Y lathes equipped with Fanuc CNC controllers.


🔧 The code: <CAVA-INTERNA.TXT>


(PARAMETRIC PROGRAM FOR INTERNAL GROOVES)
#591=20     (Bore diameter)
#592=45     (Groove length)
#593=3.5    (Groove depth)
#594=0.2    (Radial increment)
#595=0      (Increment variable - do not modify)
#596=5000   (Feedrate in mm/min)

#598=#593+#593     (Max radial increment - do not modify)
#597=0.5           (Retract amount in X)

G1901D150E#591L#592K0
G53X0B0Y0
G54G94
T909
M80
G28C0
G0C0
M50
G0X[#591]Z50M8
Z5
G1Z-[#592+1]F[#596]
X[#591-#597]
Z1
N10
#595=[#595+#594+#594]
IF[#595GT#598]GOTO20
X[#591+#595]
Z-[#592+1]
X[#591-#597]
Z1
M99P10
N20
X[#591+#598]
Z-[#592+1]
X[#591-#597]
Z1M9
Z100
G95
M51
M81
G0X250Z250
M30

📌 What is it for?

This code automatically generates a roughing toolpath inside a bore, increasing the diameter in steps until the desired groove depth is reached.
It is ideal for standard operations, repeated parts, or when you want to avoid manual programming every time.

Adjustable parameters:

  • #591: initial bore diameter
  • #592: groove length
  • #593: radial depth (how much to enlarge)
  • #594: step increment per pass
  • #596: feedrate in mm/min

⚙️ Benefits

  • Flexible: quickly adapts to different groove sizes
  • Efficient: reduces programming time for standard jobs
  • Accurate: ensures symmetry and dimensional control

🏭 Our workshop

We specialize in precision machining, both from drawings and prototypes. Our modern equipment includes:

  • 5-axis CNC milling centers for complex geometries
  • 4-axis CNC turning centers with Y-axis and sub-spindle

Our machines run on the latest Fanuc, Siemens, and Haas controllers, delivering high reliability, repeatability, and performance.


👤 About me

My name is Maurizio Riva, and for over 30 years I’ve worked in the field of precision mechanics. With the team at Rimec srl, we manufacture turned and milled components for industry, energy, transport, and robotics—blending craftsmanship, technology, and passion.


Categories:

Tags:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *