A Pallet Changer Testing Program
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.
Share





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 an 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 a 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.
However, 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 a 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 the following 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
#3000 = 100 (WRONG PALLET IN POSITION)
N1 (Normal commands in program)
If pallet B is supposed to be in position:
O0001 (Pallet B is supposed to be in position right now!)
IF [#501 EQ 2] GOTO 1
#3000 = 100 (WRONG PALLET IN POSITION)
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.
Read Next
Machine Shop MBA
Making Chips and 91ÊÓÆµÍøÕ¾ÎÛ are teaming up for a new podcast series called Machine Shop MBA—designed to help manufacturers measure their success against the industry’s best. Through the lens of the Top Shops benchmarking program, the series explores the KPIs that set high-performing shops apart, from machine utilization and first-pass yield to employee engagement and revenue per employee.
Read MoreLast Chance! 2025 Top Shops Benchmarking Survey Still Open Through April 30
Don’t miss out! 91ÊÓÆµÍøÕ¾ÎÛ's Top Shops Benchmarking Survey is still open — but not for long. This is your last chance to a receive free, customized benchmarking report that includes actionable feedback across several shopfloor and business metrics.
Read MoreAMRs Are Moving Into Manufacturing: 4 Considerations for Implementation
AMRs can provide a flexible, easy-to-use automation platform so long as manufacturers choose a suitable task and prepare their facilities.
Read More