๐Ÿ› ๏ธ Parametric CNC Program for Producing Multiple Parts Automatically

Tested on Biglia B301 SM lathe with Fanuc CNC 18i

In our workshop, we often use a parametric CNC program that is especially useful when producing small batches of washers or similar components from bar stock.

This is not an automatic bar feeder cycle. Instead, it’s a smart code that repeats itself n times, moving the workpiece zero point automatically after each part using the G10 command.


๐Ÿ” What is it for?

This program is designed for producing 2, 4, 6, 8, 10 or more identical parts from a single bar simply by defining the number of parts to produce. The only requirement is to leave enough bar material protruding from the chuck to cover the total length of the n parts.

โš ๏ธ Important: The program does not include automatic bar feed. You must make sure the material protrudes enough to cover all the parts. Also, always leave a safe margin to avoid hitting the chuck jaws.


๐Ÿง  How does it work?

  1. You set the number of parts to produce in variable #501
  2. The program runs the complete cycle for one part
  3. At the end, it shifts the Z zero point using G10
  4. It loops until the desired number of parts is completed

โœ… When do we use it?

We use this program for small series of 10, 20, 40, or 80 parts, especially when:

  • The bar is already cut to a manageable length
  • We want the machine to run autonomously for several minutes
  • We prefer to manually feed the bar every 2โ€“4-6-8 parts

This makes production smoother and lets the operator focus on other tasks while the machine runs automatically for longer cycles.


โš™๏ธ Main Parameters


#501 = 2      (Number of parts to produce)
#509 = 4      (Washer thickness)
#510 = 40     (Bar diameter)
#502 = 40     (Final turned diameter)
#508 = 3      (Cut-off tool thickness)
#507 = 7      (Cutting tool number)
#525 = 0.065  (Feedrate for cut-off)
#526 = 80     (Cut-off speed)
#503 = 0.7    (Chamfer after cut-off)
#506 = 1.8    (Chamfer before cut-off)

The Z zero shift is calculated by:

G10 L2 P1 Z[#521 - 0.5 * #514 - #531 * #514]

๐Ÿ“œ Full CNC Code


:0497(ROND SPEZZ +PZ PARAM)
#501=2(PZ DA PRODURRE)
#514=0(CONT PZ NON MODIFICARE)

#509=4(SPESSORE PEZZO)
#510=40(DIAMETRO BARRA)
#505=30(SPOREENZA BARRA)
#507=7(UTENSILE TAGLIO)
#508=3(LAMA TAGLIO)
#504=3(ORIENTAMENTO UTENSILE TAGLIO)
#503=0.7(SMUSSO TAGLIO)
#506=1.8(SMUSSO DAVANTI)
#502=40(DIA. PZ TORN. FINE A FINE TAGLIO)
#525=0.065(AVANZAMENTO TAGLIO)
#526=80(VELOC+TAGLIO)

#531=#509+#508
#527=0
#523=0(QUOTA SCARICATORE GIU)
#524=15(QUOTA SCARICATORE SU)

#511=-120
#512=0
#513=0

#516=#508+#509
#517=#508+#509-0.8
#521=-3.2+#505

G10L2P1Z#521

G53X#512
G53Z#511

M64
T#507
G0Z1X[#510+2]
M0
G53X#512
G53Z#511

N5
G10L2P1Z[#521-0.5*#514-#531*#514]
#514=#514+1

G92S2000
T2
G96S160M4
G0X[#510+0.5]Z3M8
G71U2R1
G71P10Q20U0.5W0.1F0.25
N10G0X1
G1Z0
X#502,C#506
N20Z-[#516+0.5]
G0X120Z150M5M9

G92S2000
T11
G96S160M4
G0X[#510+0.5]Z1M8
G70P10Q20F0.15
G0X150Z150M5M9

T9
G97S600M3
G0X0Z20M8
Z1
G1Z-2F0.05
G0Z1
X150Z40M5M9

T8
G97S600M3
G0X0Z5M7
Z1
G83Q3000P1000Z-#516F0.1
G0G80Z30
X120M5M9

G92S2000
T#507
G96S#526M#504
G0X100
G0Z-[#509+#508]
X[#502+1]M8
G1X[#502-#503*2]F0.04
G0X[#502+1]
Z-[#509+#508-#503]
M58
G1X#502
Z-[#509+#508]X[#502-2*#503]
X#524
M22
X#523
M23
M9
X-1F0.05
M59
G0X45
X150M5M9
Z150

M90
M01

IF[#514EQ#501]GOTO999
M99P5
N999

M30

๐Ÿญ About Our Workshop

We manufacture custom machined components with high precision. Our workshop includes:

  • 5-axis milling centers
  • 4-axis CNC lathes with Y-axis and sub-spindle
  • Fanuc, Siemens, and Haas CNC controls

๐Ÿ‘ค About Me

My name is Maurizio Riva, and I manage Rimec srl, a precision engineering workshop based in northern Italy. For over 30 years, Iโ€™ve developed CNC solutions to optimize small batch production with smart and reliable automation.


Categories:

Tags:


Comments

Leave a Reply

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