Hello everybody, I running a lathe (fanuc 31i) with bar feeder. I undesrtand the basics but never wrote a macro before, because there was no need for it.
I trying to figure out how to write a macro program for automatic wear offset change for finish tool after certain number of parts.
From one bar I get 15 parts, the problem is that after part 9, the tolerance always changes for 0.02mm, because of bar vibrations.
Example:
Parts 1-9 dimesion is 30.00mm
Parts 10-15 dimension is 29.98mm
So would like to write a macro program which would add 0.02mm (X-axis) to finish tool wear offset after part 9.
Till now I was using part counter and than manualy change wear after part 9.
Program would look like this:
T0101
Rough turning
T0202 (wear offset 0)
Finish turning
Run the turning cycle for 9-times
Than automaticly add 0.02mm to T0202 wear offset
And run the same cycle 6 more times.
After that repeat the same proces again after bar change.
How should I start? Maybe using part counter for each bar so when it comes to part 9 than it would add to wear offset, finish the bar till the end and than reset the part counter again for the next bar?
I hope you guys understand what I trying to do