Re: swiss program of long parts
Your code looks fine with 1 exception. You need something to hold the stock in place while the main collet is open. If you set your guide bushing tight enough to hold the stock in place, that may work, but I would consider that dangerous because if the bar hits a low spot and the GB is no longer tight enough to hold the stock, the bar feeder could push it out and you could whip the bar in the machine, crash the sub, or generally have length problems.
So, your code is fine, but just needs the sub to approach and chuck on the part before you open the main collet, then open it after the regrip or spindle sync it.
Here's what I would do.
M3 S1=2500
T200
G0 X[#530+0.025] Z0 T2
G1 X-.035 F.003
G0 Z-0.025
G0 X.510 Z0
G1 Z4.0 F.003
X[#530]
W0.025
G0 X[#530+0.025]
M5 (STOP MAIN SPINDLE)
G4 U.5 (DWELL)
G650 (superimpose z2 on z1)
!1!2 L650 (wait for sub to be in place)
M7 (OPEN MAIN COLLET)
G4 U.5 (DWELL)
G98 G1 W-2.0 F100.
G50 W2.00
M6 (CLOSE COLLEET)
G4 U.5 (DWELL)
M3S1=0M24S2=0 (turn spindles on at 0 rpm)
G114.1H1D-2 (Spindle sync at 0 rpm. NOTE if you have an R value on this line this WILL NOT work)
(alternately, you could just open the Sub (M16) and fire up the main spindle and not sync, but I think spindle sync from a stop is a cool trick, so I do it all the time and it works well)
G99 S1=2500
G0Z3.99 (.010 SHORT OF WHERE YOU LEFT OFF)
G1 X.510 F.003
Z5.822
X.620
Z.6.05
X[#530]
W0.025
G0 X[#530+0.025]
Then in $2:
G650 (Superimpose on)
M16 (Open sub. last part should already be ejected)
G0 Z-.3 (rapid to face)
G1 G98 Z2. F120. (feed on some amount. I chose 2" for no particular reason)
M15 (close collet)
!1!2L650 (sub is in place and ready for main to regrip)
Then right before cutoff, you'd probably want to move the sub up closer.
$1
!1!2L1000
!1!2L1001
(...cutoff)
$2
!1!2L1000
M16 (Open)
G1G98Z5.6 F120. (move up) (or z5.1 if you're using a .500" extended nose pickoff)
M15 (close)
!1!2L1001 (done)
CNC Product Manager / Training Consultant