What's new
What's new

Okuma G111 Toolchange Macro with T0 capability

Edster

Diamond
Joined
Feb 8, 2003
Location
Illinois
This is my G111 Toolchange Macro.

It was written by out applications engineer to support a T0 call to have the machine take out the tool in the spindle.

I have notes on how to register the macro I will post later.

OTCHK
( SET GCODE PARAM. G111 TO OTCHK )
( AT TOOL CHANGE KEY IN G111 T= TOOL NO. Q = NEXT TOOL EX. G111 T1 Q2)
IF [ PT EQ 0 ]NSKP1
IF [ VTLCN EQ PT ]NST1 (ACTIVE TOOL)
IF [ VTLNN EQ PT ]NRT1 (NEXT TOOL)
IF [ VTLNN EQ 0 ]NOT1 (NEXT TOOL)
M64
NOT1 T=PT
NRT1 M06
NST1
IF [ PQ EQ EMPTY ]NEND (if ready tool empty/jump )
IF [ VTLNN EQ PQ ]NEND (if next called tool is at next tool pos./jump)
IF [ VTLNN EQ 0 ]NTT1 (if next tool has no value)
M64 (next tool pot back up)
NTT1
T=PQ
M356 (next pot down)
NEND
IF [ PW EQ EMPTY ]NEND2 (if ready tool empty/jump )
NEND2

GOTO NEND3

NSKP1
IF [ VTLCN EQ 0 ]NEND3 (ACTIVE TOOL)
IF [ VTLNN EQ 0 ]NSKP2 (NEXT TOOL)
M64

NSKP2
M63
M06

NEND3
RTS

pq def. when p is attached to a letter it become readable
 
Here is a basic G111 macro that doesn't support a T0 call.

OTCHK
( SET GCODE PARAM. G111 TO OTCHK )
( AT TOOL CHANGE KEY IN G111 T= TOOL NO. Q = NEXT TOOL EX. G111 T1 Q2)
IF [ VTLCN EQ PT ]NST1 (ACTIVE TOOL)
IF [ VTLNN EQ PT ]NRT1 (NEXT TOOL)
IF [ VTLNN EQ 0 ]NOT1 (NEXT TOOL)
M64
NOT1 T=PT
NRT1 M06
NST1
IF [ PQ EQ EMPTY ]NEND (if ready tool empty/jump )
IF [ VTLNN EQ PQ ]NEND (if next called tool is at next tool pos./jump)
IF [ VTLNN EQ 0 ]NTT1 (if next tool has no value)
M64 (next tool pot back up)
NTT1
T=PQ
M356 (next pot down)
NEND
RTS
pq def. when p is attached to a letter it become readable
 
Yes the point of the macro that supports T0 is to have the machine put the tool in the spindle into the magazine leaving the spindle empty.

I use it to remove the active tool from the spindle so I can load a 3d Taster that I don't store in the magazine, or to remove the tool prior to shutdown. Before the macro I would do this by hand and would have to remember to put the tool back in the spindle. I had a special spot in the tool rack with a special tag for the active tool. This was necessary because one of my employees opens the shop in the mornings and would have to put the tool back before running the warm up program.

Or are you asking why a macro would be used to change tools in the first place. The macro allows prestaging tools, and stops alarms if the tool called is already in the spindle.
 
What would the point of this be aside from the T0? To be able to leave no tool in the spindle?

By default, the OSP300M makes you setup a tool "library" and load tools manually from a screen.
In theory it's a good design, but for a job shop like us where we use a bajillion different tools every day it just isn't feasible, besides, we have 4 mills and often swap out tools to each machine.
A T0 isn't needed, and if I need to change tools with nothing in the spindle, I just use an M329 code beforehand.
 
By default, the OSP300M makes you setup a tool "library" and load tools manually from a screen.
In theory it's a good design, but for a job shop like us where we use a bajillion different tools every day it just isn't feasible, besides, we have 4 mills and often swap out tools to each machine.
A T0 isn't needed, and if I need to change tools with nothing in the spindle, I just use an M329 code beforehand.

The newest control I have is the P200, so can you still load tools through the magazine on the P300?

You never have a need to take out a tool from the spindle? Do you leave tools in the spindle when the machine is shut down?

If I load tools through the spindle I typically just add the new tool number to the magazine and call it up. Then load the tool into the spindle. It works fine on my VMC's but my HMC doesn't like that and alarms. I'll have to try the M329 next time on that machine.
 
Good Grief!
All that just to shut down the machine with a tool in the spindle:willy_nilly:

It runs seamlessly in the background you won't ever notice it.

Other machines (Fanuc IIRC) use a toolchange macro but hide it as a 9000 program and it is called with an M6 instead of G111 so you don't notice it's there. Okuma's toolchange macro is just more visible. An Okuma will still function with an M6 but just not optimally. Not sure if a fanuc will still operate without it's macro.

The best thing for you to do is show both of these macros to the applications engineer that comes to do your training and get his opinion.
 
Here are some notes I made last time I registered a macro. I wrote these to jog my memory if I forgot, they might be kind vague to someone new to Okumas.

To register macros on machine.

Save files as .LIB files in MD1.

In Auto mode select the Library Program tab.

Set the buffer size.

Select regis. tab and select the macros. The name (not the file names) will be populated along with the size.

In the parameter screen G/M CODE MACRO enter the name (not the file name) of the macro in the box for the call code.
 
Here is a readme that was packaged with the first G111 macro I got from Okuma.

LOAD FILE OTSET.TXT INTO MD1: FROM FLOPPY DRIVE.
RENAME OTSET.TXT TO OTSET.LIB


Set Macro Param G111 to OTCHK (under parameters/G codes macros)
In Auto F8 Extend
F1 LIB Program
SET 500;i Write (initialize .LIB for memory Size)
SET OTCHK,OTSET.LIB Write (when G111 is called (OTCHK) then call Library program OTSET.LIB)


Example For MIN. Programs:


G15 H20 (SELECT WORK COORDINATE)
G111 T1 Q2 (INDEX TO TOOL 1 AND READY 2)
G56 H1 (TOOL 1 OFFSET)
X0 Y0 Z.1 S
GO1
.
.
.
.
.
G30 P1 M19 (POSITION TO TOOL HOME POSITION 1 AND SPNDLE ORIENTATION)
G111 T2 Q3 (INDEX TO TOOL 2 READY 3)
G56H2
X0 Y0 Z.1 S
G01
.
.
.
.
.
G30 P1 M19
 
Here is the G116 tool change macro for a P200 (Okuma MB machine) in case anyone needs it.

OATC (G116)
(TOOL CHANGE MACRO)
(COMMAND IS G116 T?? Q??)
(T=DESIRED TOOL #, Q=NEXT TOOL #)
(G116 T0 WILL CLEAR TOOL FROM SPINDLE)
(AUG 17, 2005)
M329
IF[PT EQ EMPTY]NCLR
IF[PT EQ 0]NMT
NSTRT
IF[VTLCN EQ PT] NFIN
IF[VTLNN EQ PT] NCH
IF[VTLNN EQ 0] NCHG
G30 P1
M64
NCHG G30 P1
M5
M19
T=PT M6
NFIN IF[VTLNN EQ 0] NTL
IF[VTLNN NE PQ] NCLR
GOTO NEND
NCH M6
GOTO NFIN
NCLR IF[VTLNN EQ 0]NTL
M64
NTL T=PQ
GOTO NEND
NMT IF[VTLNN EQ 0]NRID
G30 P1
M64
NRID M63
M6
NEND RTS
 
Sooooo I know this is an old thread but it's relevant to my current pain.

I'm in the process of getting a 1998 MX40 Horizontal up and running. Things are going well except for tool changes.

I am running the G116 macro (really similar to the G111 posted above) Here's the issue, and I think it's because this is a matrix style tool changer machine (robot pulls tools off the rack, stages them, then returns tools to their place after a tool change)

Every time I run a G116TxxQxx it will unstage the next tool, put it back on the rack, then pull it back off the rack, restage it and then finish executing the tool change.

I have it narrowed (I think) down to the use of M64 in the macro (posted below)


IF [PT EQ 0]NMT
IF [VTLCN EQ PT] NFIN (ACTIVE TOOL)
IF [VNTOL EQ PT] NCH (NEXT TOOL)
IF [VNTOL EQ 0] NCHG (NEXT TOOL)
M64
NCHG T=PT M6
NFIN IF [VNTOL EQ 0] NTL
IF [VNTOL NE PQ] NCLR
GOTO NEND
NCH M6
GOTO NFIN
NCLR M64
NTL T=PQ
GOTO NEND
NMT IF [VNTOL EQ 0]NRID
M64
NRID M63
M6
NEND RTS


On my machine, the M64 returns the staged tool to the rack. I think this would work fine on a machine with a traditional tool chain style magazine (Like my M560, the same macro works great there, can do T0, etc) but not so much on the matrix style changer that I have.

Anyone have any ideas? I don't need the ability to do a G116 T0 to empty the spindle. The design of the matrix means that isn't possible so don't worry about that. I just change to a tool pot I know is empty instead. I just need it to quit unstaging next tools when I want them in the spindle instead.

Anyone have any ideas?
 
I fixed it.

It was suggested to me to swap VNTOL for VNTNN. VNTOL is read only, VNTNN is read/write.

Worked perfectly!
 
I still don't understand how Okuma can sell a $.5 million machine that alarms if you try to do M6 T1 if T1 is already loaded. They've been making CNC controls for 30+ years and still can't put some basic logic in the M6 function. Every Okuma ever made left the factory with no tool change macro. It has to be added by the dealer.

Why even have the M6 if everyone has to use a custom macro?

Why not let us remap the M6 to a macro like every other CNC control?

The integration on the pallet changing machines is terrible. Why can't the machine stage the first tool for the scheduled program while it's changing pallets? I asked every Okuma apps guy who would hear me how to do that. Crickets.

I had to write stupid variables into the pallet changing program and count on the setup guy to change them to get the right tool staged. Otherwise the machine changes pallets, then it just sits there while it puts away the current ready tool, find the tool it needs, then changes tools.
 
I still don't understand how Okuma can sell a $.5 million machine that alarms if you try to do M6 T1 if T1 is already loaded. They've been making CNC controls for 30+ years and still can't put some basic logic in the M6 function. Every Okuma ever made left the factory with no tool change macro. It has to be added by the dealer.

Why even have the M6 if everyone has to use a custom macro?

Why not let us remap the M6 to a macro like every other CNC control?

The integration on the pallet changing machines is terrible. Why can't the machine stage the first tool for the scheduled program while it's changing pallets? I asked every Okuma apps guy who would hear me how to do that. Crickets.

I had to write stupid variables into the pallet changing program and count on the setup guy to change them to get the right tool staged. Otherwise the machine changes pallets, then it just sits there while it puts away the current ready tool, find the tool it needs, then changes tools.

I'm with you on everything but the tool staging.

On my HMC I don't wait until the pallet swap to stage anything. If I have Pallet1.min and Pallet2.min, when I call the last tool in pallet1.min I stage the first tool for Pallet2.min and vise - versa.

By the time you get to the point where you need to switch pallets, the correct next tool has long been staged.

Seems to work ok for me on this machine.
 
Yes, but you have to edit the program every time you change what job is running on the pallet. I've worked with Mori Seikis and other machines that do all of that automatically as part of the tool change logic.
 
Yes, but you have to edit the program every time you change what job is running on the pallet. I've worked with Mori Seikis and other machines that do all of that automatically as part of the tool change logic.


This is my first HMC, so I'm still learning a lot. Are you talking about multiple pallets and you never know what job is running where? I could see that being a reason to have to always edit things.

In my case I just have a two pallet machine, small scale production, so it's not a big deal to change something around. If I hand a bunch of pallets I could see that being handy to have it auto stage for each new program.
 
Even a two pallet machine may change jobs and programs several times per shift. Now you have the operator or setup guy editing programs. That's a no go for a production shop. The program is sacred. Don't touch the program...
 
Even a two pallet machine may change jobs and programs several times per shift. Now you have the operator or setup guy editing programs. That's a no go for a production shop. The program is sacred. Don't touch the program...

I see what you're getting at. You're 100% correct.
 
I still don't understand how Okuma can sell a $.5 million machine that alarms if you try to do M6 T1 if T1 is already loaded

hello ewlsey :) T1 is never loaded, T1 is an ATC code, and M6 is arm swing code; you can not issue a T comand towards the spindle, but only towards the ATC, so once T1 left the ATC, than an error will occure if you call it again

a mill does not load T1; it loads a tool registered as T1 inside the virtual library, which is registered at pot X; once the tool is inside the spindle, there will never be a machining code which requires T1; machining codes simply requires H* and D*

T1 is not available outside the ATC, just like how H* & D* are not available inside the ATC :)




futher more, on a turret lathe you may use T010101 and later T10; T10 will activate offset 10 on tool from pot=1 ( turret post=1 );

now imagine that T10 would not activate the offset, but would index the turret to post 10 : this means that it would be possible to index the turret without activating the tool corection : this is similar to loading a tool inside the mill spindle without using G56 : on a lathe is nonsense, but inside a mill you may load stuff that does not require corection : washers, propelers, calibers, etc / kindly :)
 
Last edited:








 
Back
Top