How can I confirm that the right pallet is in position?

We have (4) Mori Seiki SH-630 Horizontal Machining Centers. They have Fanuc-type controls (model MSC-502) on them. The question I have is do you know of a macro program or some way to do a pallet check at any point in the body of a program to make sure that the correct pallet is in the machine at the correct time? We have a very long program for 2 of these machines and sometimes if the operator has trouble (i.e....broken tool), he must stop the machine, fix the problem and restart the machine at the proper place in the program with the proper pallet. I need to try and "bullet proof" this issue if that is possible. This is the first time I have seen your website and it is very interesting and informative. I hope that someone there can help me with this problem. Thanks, Gary Neill, Consolidated Metco Inc.



It just so happens that this is the topic of an up-coming CNC Tech Talk column in Modern Machine Shop Magazine (July 2002). I'll publish it early.

A pallet changer testing custom macro

Many machining centers, especially horizontal machining centers, come with a two-pallet pallet changing system. The operator loads one pallet while the other is in cycle. It is quite important, of course, that when the operator activates the cycle, the correct pallet is in the machine. A mistake in this regard can be disastrous.

Unfortunately, most machine tool builders provide little in the way of pallet confirmation. Again, if the wrong pallet is in the machine, the control will simply activate the program, ignoring the problem. If your machine has parametric programming capabilities, it is quite easy to add your own pallet confirmation system. We're showing the example in Fanuc's custom macro B, but with a little ingenuity, you should be able to apply this technique with just about any version of parametric programming.

We'll use a #500 series permanent common variable with which to store the current pallet location. We'll make #501=1 if pallet A is in position and #501=2 if pallet B is in position. #501 is a permanent variable. Like an offset, its value will be retained even after the power is turned off.

With custom macro B, the function of your pallet change activation word (commonly an M60) can be changed to automatically update the value of #501 with each pallet change (see below). A test can be made at the beginning of each program to confirm that the correct pallet is in position before allowing machining to occur.

Note that this is a software solution to the problem and the control could get mixed up if the program is stopped in the middle of a pallet change. A more positive (but much more difficult) method would be to use the #1000 series input signal terminals in conjunction with physical limit switches mounted on the pallet changer to determine which pallet is in position.

Here is the "easy way", using #501 as a flag to determine which pallet is in position:

You must first manually set the value of #501 (just like you set an offset) to initially specify which pallet is in position. You'll find #501on the variables page of your display screen. If pallet A is currently in position, manually set #501 to 1.0. If pallet B is currently in position, set #501 to 2.0.

With custom macro B, a parameter must be set to make the control activate a specific program (O9001 in our case) whenever an M60 is activated. You must reference the custom macro descriptions in the programming manual for your specific control to confirm the parameter number. For a 16M Fanuc control, for example, it is parameter number 6071. You must set this parameter to a value that corresponds to your pallet changing M code. If your pallet changer is activated with an M60, set this parameter to a value of 60. From this point, whenever the control reads an M60, it will execute program O9001.

Next, you must load program O9001 into your control.

  • O9001 (Pallet changing program - control will execute this program when M60 is read)

  • M60 (Normal pallet change command)

  • IF [#501 EQ 1] GOTO 1 (IF pallet A WAS in position GOTO N1)

  • #501=1 (If pallet B WAS in position, set #501 to 1, pallet A now in position)

  • GOTO 2 (Skip N1)

  • N1 #501=2 (Set #501 to 2 - pallet B now in position)

  • N2 M99 (Return to calling program)

Now, in every program that requires the correct pallet to be in position, add these commands at the very beginning:

If pallet A is supposed to be in position:

  • O0001 (Pallet A is supposed to be in position right now!)

  • IF [#501 EQ 1] GOTO 1


  • N1 (Normal commands in program) . . .

If pallet B is supposed to be in position:

  • O0002 (Pallet B is supposed to be in position right now!)

  • IF [#501 EQ 2] GOTO 1


  • N1 (Normal commands in program) . . .

The #3000 system variable will, if activated, put the machine into an alarm state (if all is okay, the control will skip this command). The message MC-100 WRONG PALLET IN POSTION will appear on the display screen.

Gary, Remember that the testing commands (at the beginning of programs O0001 and O0002 above) can be placed anywhere in your cutting programs. You could make this testing more "bullet proof" if you include these commands at the beginning of every tool in every program.


Recent Posts

See All

How does G66 work?

G66 is one of the more misunderstood custom macro B commands. Fanuc calls it a modal custom macro call. It looks just like a G65 command. Consider these two commands: N045 G65 P1000 X3.0 Y3.0 Z0 A45.0

What are directional vectors?

Current model CNC controls make it easy to create circular commands. You simply specify the direction (G02: clockwise or G03: counter clockwise), the end point (usually X and Y), and the radius (with

cnc reverse logo.jpg

44 Little Cahill Road

Cary, IL  60013

Ph: 847-639-8847

  • Facebook Social Icon