What's new
What's new

Adding counter for tool life Okuma lathe

Amanor

Plastic
Joined
Jul 26, 2016
we have an old Okuma CNC 2-turret lathe that my boss wants to implement lights out machining. The down side is that the control doesn't support the option for tool life management, he still wants me to figure a way out to be able to switch a tool mid run or offset mid run without the machine being attended. I already have a counter for our barfeeder so i don't really know how to move on any help would be really helpful.

The control is a OSP 5020L and the lathe is a LR10
 
How are you going to know how much to offset the Tool, without a known diameter. Just incrementally offsetting a Tool as the Machine runs through the night is not going to end up well IMO. Sure you run 100,000 parts under supervision you get a decent idea of wear, but still.

If you still need to do it, you are going to have to insert a Macro (parametric in Okuma's language) and the Macro will only be used when a program switch is there, so Toolchange, @ something, Program rewind or Barfeed activated. I guess you could write another Macro to activate the switch. I don't know the actual code you would need, or if it's even possible.

R
 
As long as your control can handle macros, the programming should be relatively simple. There's a sticky at the top of this forum about macro programming if you're new to them.

The simplest way to is to count the number of parts, and list the tools being used. Use non-volatile macro variables between 500 and 599. When the part counter reaches certain numbers, switch to the next tool.

In the example below, #500 is the counter. Manually reset this to zero via the macro variable table when starting a new run.

#501 is the tool and offset number being used. When the counter reaches a predetermined number, e.g. 50, it'll be overwritten to the the next designated tool number.

Code:
#501 = 707;    (First tool = tool 7 offset 7)
#502 = 808;    (Second tool = tool 8 offset 8)
#503 = 909;    (Third tool = tool 9 offset 9)

WHILE[#500 LE 150] DO1; (make 150 parts)

IF[#500 LE 50]  THEN #501=#501 (this line doesn't do anything, but I added it to clarify what's going on)
IF[#500 GE 51]  THEN #501=#502 (change to tool 808 for parts 51-100)
IF[#500 GE 101] THEN #501=#503 (change to tool 909 for parts 101-150)

...

T#500

...

END1

M30;

You'll want to test cut all your redundant tools ahead of time to dial in the proper wear offsets.

Disclaimer: test run your program before letting it go unattended. E.g. in the above example, set your counters to 49, 99, etc. and make sure it's doing what it's supposed to do. Unattended machining is unforgiving.
 
Fanuc Macro is handled different than OSP Macro. Tony's Thread is based on Fanuc knowledge.

The 5020 can process it, but not Macro B or A.

R
 
In OSP land it's called "User Task" and your 5020 should have it. Most do. Tool Life Management may have been an option on the 5020, I don't remember. You could probably have Okuma load the option but it may cost.

User Task is very similar to Macro language. Mike Lynch's book covers it. Highly recommended.
 
If you already know how many parts you get off a specific tool then it should be relatively simple. Add V1=V1+1 (or whatever V you want to use) at the end of the code of the tool you want to switch. Follow this with a simple IF GOTO statement.
Example... you know your drill in position 1 (T101) lasts 500 parts so you set the counter to 500. Then you want to switch to the identical tool in position 2 (T202) to continue running.

IF [V1 EQ 500] GOTO N1000
T101 X20 Z20 S1000 (and P whatever for 2 turret model)
X0 Z.5
Z.05
G1 Z-1 F.005
G4 F.1
G0 Z.5
X20 Z20
V1=V1+1
GOTO N2000

N1000
T202 X20 Z20 S1000 (make sure you use same P code to keep synchronized with lower turret)
X0 Z.5
Z.05
G1 Z-1 F.005
G4 F.1
G0 Z.5
X20 Z20
(add another V counter hear if you want to keep going with more positions)

N2000
rest of your program


For part 1-500 the program will execute with T101. At the end of the T101 section notice the GOTO N2000. This ensures the program will skip over the T202 section until the counter reaches 500. After 500, the logic statement in line 1 will skip over the T101 and go directly to N1000 and execute the T202 part of the program.

I have not done this but I think this will work. I do use V counters to monitor tool life.
 
Hi Bradley, how do you differentiate from V1 and V1 when they do different things? How is V1+1 going to change something? You are adding 1 to V1, which is not dedicated to anything. I doubt what you posted would do anything. But there are two V1's in the posted code, that theoretically do two different things.

R
 
Each time the control reads this section of code it takes the current V1 value, adds 1 to it, and overwrites the current V1 value with the new number...which will be one more. I use this often on my Okuma programs to keep track of tool life.
Tool 1 I use V1, tool 2 uses V2, etc...

You can view the current value of V1 on the common variable page. This also where you reset the counter back to zero.
 
Each time the control reads this section of code it takes the current V1 value, adds 1 to it, and overwrites the current V1 value with the new number...which will be one more. I use this often on my Okuma programs to keep track of tool life.
Tool 1 I use V1, tool 2 uses V2, etc...

You can view the current value of V1 on the common variable page. This also where you reset the counter back to zero.

But you have no V1= in the program you posted, so the Values are set somewhere in your common. What you posted is assuming a lot. And useless unless the values are set, which is also just trying to be Fanuc-y.

R

R
 
V1=V1+1 is all that is needed....it's that easy. As soon as the control reads that line it will take whatever value that is currently in V1 and add one more to it. Of course, the V1 value in the common variable page should be zeroed out at the beginning of the job.

If V1 is currently zero then, as soon as the program is read (even in machine lock mode) the control will read this line, look at the current V1, take that value, add 1 to it, and overwrite the V1 to this new value.

V1=0 to start. Reads the line... performs math calculation 0+1... new V1 number is 1. If you were to look at the common variable page the new V1 number would now be saved and is 1.

And so on...and so on. Each time the control reads the line the common variable V1 will increase by one.
 
You're not paying attention. What is V1? If V1 adds to Tool 1 each time it's read then wouldn't your Tool end up at the Tailstock end of the Machine? Or wouldn't the Zero Set change each time? Or the TNR?

In YOUR common variables V1 is assigned as (I'm assuming) to the X value of the Turning tool. That is not constant. It can be anything you want it to be. So unless the OP's Machine has the same variable stored it means nothing. The advantage of OSP over other controls is you can insert the variable into the foregroung program.
 
You're not paying attention. What is V1? If V1 adds to Tool 1 each time it's read then wouldn't your Tool end up at the Tailstock end of the Machine? Or wouldn't the Zero Set change each time? Or the TNR?

In YOUR common variables V1 is assigned as (I'm assuming) to the X value of the Turning tool. That is not constant. It can be anything you want it to be. So unless the OP's Machine has the same variable stored it means nothing. The advantage of OSP over other controls is you can insert the variable into the foregroung program.

He's just using V1=V1+1 as a counter
The variable for the offset is (if i remember right) VZOFX = 12.3456 as an example.
Then once his counter reaches a certain value he can put something like this in the program:
If [V1 = 10000] then T2M6
And after the T2M6 they can say V1=1 and start all over
Obviously my format isn't exact but that's the gist.

I mean that's probably a caveman way of writing it by me but it's not the worst idea ;)
 
Geeze... I'm just using V1 as a simple tool counter like Mtndew said. I thought that was clear in my original post. I'm not using it in my example program as an offset adjustment or anything else. It's quite simple and something I threw together quickly to answer the OP.

I use V(?) as tool counters all the time on my Okumas when I'm doing tool life testing. I also use them as a part counter for bar feeders that don't have an interface with the control. I also use them as groove tool width adjustments independent of offset adjustments if needed.

All the V parameters on the common variable page of an Okuma can be used for whatever you want. I'll say again, just go to the page, set V1 to zero, then just let the machine start running. It's literally that simple. Every time the program reads the line the V1 goes up by one. Also, every time the program reads the IF logic statement it looks to the common variable page to read the existing number. When it reaches 500 it will then skip over and start using T202.
 
Here's a program for a part I no longer run. It was a bar pull type job that we ran thousands of. Multiple tools, turning rgh/fin, cutoff, drill, bore and tool life counters for all of them.

Your 5020 (or any okuma lathe) will run this program as is. Look it over, run over the logic in your head/ follow the program and adapt it to your needs.

In this case, if any of the tools life out then the program ends. If the operator hits cycle start, it just ends again repeatedly until they think to look at the parameter page to see which tool needs changed and it's count set back to zero.

Note that restarting the program somewhere other than the beginning will also increment all the counters as it's scanning the program to find your restart point.

Any questions just ask.

(SET NEW BAR 2.875 FROM HARD JAW)
(BARS *MUST* BE 35.75" MIN LENGTH TO MAKE 13 PCS)
(CHUCK @ 400 PSI)
(V1= LIFE COUNT FOR T1 OD RGH)
(V8= LIFE COUNT FOR T8 .118 PENTACUT)
(V3= LIFE COUNT FOR T3 OD FIN)
(V7= LIFE COUNT FOR T7 .75 880 DRILL)
(V10=LIFE COUNT FOR T10 .62 BORING BAR)
(V11=TOOL LIFE LIMIT FOR T1)
(V18=TOOL LIFE LIMIT FOR T8)
(V13=TOOL LIFE LIMIT FOR T3)
(V17=TOOL LIFE LIMIT FOR T7)
(V20=TOOL LIFE LIMIT FOR T10)
(V21= PART COUNT, SET @ 0 ON NEW SETUP)
(DRILL LAST X.0245 Z4.5205)
(.62 BORE LAST X-.7949)
(BAR PULLER LAST Z3.863)
N0001 G00 X25 Z25
IF [ V1 EQ V11 ] GOTO N0810
IF [ V3 EQ V13 ] GOTO N0810
IF [ V7 EQ V17 ] GOTO N0810
IF [ V8 EQ V18 ] GOTO N0810
IF [ V10 EQ V20 ] GOTO N0810
/M0
V11=400
V13=650
V17=400
V18=1750
V20=600
N0001 G00 X25 Z25
N0002 G50 S3800
NAT01 (DNMG-332 PM 4325 OD RGH)
N0100 G97 S2387 M42 M03 M08
N0101 G00 X1.6 Z0.1 T010101
N0102 G96 S1000
N0103 G85 N0104 D0.1 F0.01 W0.010
N0104 G82
N0105 G00 Z0
N0106 G01 X1.5 G41 E0.01
N0107 X0
N0108 G40 K0.003
N0109 G80
N0110 G97 S2387 M09
N0111 M01
NAT01
N0200
N0201 G97 S2387 M42 M03 M08
N0202 X1.520 Z0.1 T010101
N0203 G96 S900
N0204 G85 N0205 D0.2 F0.0135 U0.016 W0.008
N0205 G81
N0206 G00 X1.0914
N0207 G01 Z0 G42 E0.0135
N0208 G03 X1.0967 Z-0.0016 I-0.0001 K-0.003 E0.015
N0209 G01 X1.1153 Z-0.0193 E0.0135
N0210 G03 X1.116 Z-0.0207 I-0.0027 K-0.0014
N0211 G01 Z-0.1789
N0212 G03 X1.494 Z-1.219 I-2.76 K-1.0388
N0213 X1.115 Z-2.2596 I-2.949 K-0.0005
N0214 G01 Z-2.56
X1.175 Z-2.6
X1.5
N0215 G40
N0216 G80
N0217 G97 S1910 M09
N0221 G00 X25 Z25 T0100
V1=V1+1
N0222 M01
NAT07 (.75 880 DRILL, SET TO CUT .765)
N0300 G97 S4074 M08
N0301 G00 X0 Z0.1 T070707
N0302 G74 X0 Z-2.62 D5.44 L5.44 F0.005 E0.02
N0303 M09
N0304 G00 X25 Z25 T0700
V7=V7+1
N0305 M01
NAT10 (.62 TCMT-221 BORING BAR)
N0400 G97 S3820 M08
N0401 G00 X0.75 Z0.1 T101010
N0402 G96 S750
N0403 G85 N0404 D0.2 F0.012 U0.01 W0.002
N0404 G81
N0405 G00 X0.8082
N0406 G01 Z0 G41 E0.012
N0407 G02 X0.8028 Z-0.0017 I0.0001 K-0.003 E0.018
N0408 G01 X0.7901 Z-0.0144 E0.012
N0409 G02 X0.7895 Z-0.0157 I0.0028 K-0.0013
N0410 G01 Z-2.475
N0411 G40 I-0.003
N0412 G80
N0413 G97 S3820 M09
N0414 M01
NAT10
N0500 G97 S4329 M08
N0501 G00 X0.75 Z0.1 T101010
N0502 G96 S850
N0503 G87 N0504
N0504 G81
N0505 G00 X0.8082
N0506 G01 Z0 G41 F0.012
N0507 G02 X0.8028 Z-0.0017 I0.0001 K-0.003
N0508 G01 X0.7901 Z-0.0144
N0509 G02 X0.7895 Z-0.0157 I0.0028 K-0.0013
N0510 G01 Z-2.475
N0511 G40 I-0.003
N0512 G80
N0513 G01 X0.7817 Z-2.4196
N0514 G97 S4153 M09
N0515 G00 Z0.1
N0516 X25 Z25 T1000
V10=V10+1
N0517 M01
NAT03 (DNMG-332 PM 4325 OD FIN)
N0600 G97 S2546 M08
N0601 G00 X1.5 Z0.1 T030303
N0602 G96 S1000
N0603 G87 N0604
N0604 G81
N0605 G00 X0.625
N0606 G01 Z0 G42 F0.006
N0607 X1.0717
N0608 G03 X1.0773 Z-0.0012 I-0.0001 K-0.004
N0609 G01 X1.1127 Z-0.0188
N0610 G03 X1.115 Z-0.0217 I-0.0029 K-0.0029
N0611 G01 Z-0.1729
N0612 G02 X1.1192 Z-0.1845 I0.033
N0613 G03 X1.1192 Z-2.254 I-2.7615 K-1.0348 F.015
N0614 G02 X1.115 Z-2.2656 I0.0309 K-0.0116
N0615 G01 Z-2.56 F.006
N0616 X1.5 F.02
N0617 G40 I0.003
N0618 G80
N0619 G01 X1.5078 Z-2.5046
N0620 G97 S2533 M09
N0621 G00 X25 Z25 T0300
V3=V3+1
N0622 M01
NAT08 (.118 WD CUTOFF)
N0700 G97 S1681 M08 M77
N0701 G00 X1.6 Z-2.5565 T080808
N0702 X1.25
N0703 G96 S750
N0704 G73 X1.0196 Z-2.5565 D2.5 L2.5 F0.003 E0.07
N0705 G00 Z-2.5262
N0706 G01 X1.1263 F0.003
N0707 X1.0656 Z-2.5565
X.75
N0714 G00 X1.6
N0715 G97 S1681 M05 M09 M76
N0716 X25 Z25 T0800
V8=V8+1
N0717 M01
NAT05
N0800 (BAR PULL, 1-1/2 COLLET)
V21=V21+1
IF [ V21 EQ 13 ] GOTO N1000
IF [ V21 LE 12 ] GOTO N0801
N0801 M5
N0802 G0X0Z.1T050505
N0803 G1G94Z-2.806F350.
N0804 M84
N0805 Z-.20 F165.
N0806 M83
N0807 G0 Z.5
N0808 G0G95X25Z25T0500
N0809 M01
GOTO N0001
N1000
V21=0
N0810 M02

 








 
Back
Top