CNC Services Northwest

Centroid CNC control sales, service, training and support

Unified Mill PLC Program for Oak-Based Controls


This PLC program supports both typical umbrella and swing-arm Automatic Tool Changer (ATC) systems, as well as non-ATC mills.

Additional support is included from some common optional systems and features, including:


You can download an installation package containing the PLC program, M function macros and custom message files here:

CNC11 software version 3.16 or newer, or CNC12, is required.

To install, copy the above file to a USB thumb drive; plug into the control; and use F7/Utility → F2/Restore Report.

Alternate versions are available for controls using the MPU11 and GPIO4D boards with the OpticDirect axis interface, and for controls using the All-in-one DC unit. The All-in-one DC version supports only umbrella-type tool changers.


If needed, make your own machine-specific copy of the source file and edit the I/O definitions in the PLC Inputs and PLC Outputs sections to match the existing wiring on your machine.

If an I/O definition for a feature you do not have or need occupies a location which you need to use for another purpose, you can either "park" the unused definition on a spare I/O point (e.g. a higher-numbered point than is actually present on your system) or you can delete the feature-specific stage(s) which relate to the unused feature.

It is generally not necessary to edit the cncxmsg.txt file when you change I/O assignments, because all of the "Waiting..." messages are based on PLC memory bits, and not directly on the input numbers.

The presence or absence, and in some cases the behavior, of various features is determined by Machine Parameter values in the CNC11 software.

ATC presence and features are indicated by Parameters 6, 160, 161 and 164:

P1601ATC is umbrella type
2ATC is swing-arm type
P161nNumber of tool carousel bins
P1641(umbrella-type only)
Enable F2/ATC Reset feature in Tool Library

Most other accessories are indicated by bits within Parameter 901:

P901 bit 00No spindle chiller
1Spindle chiller installed
P901 bit 10No stack lights
2Stack lights installed
P901 bit 20No rotary clamp
4Rotary clamp installed
P901 bit 30No CTS pump
8CTS pump installed
P901 bit 40No washdown pump
16Washdown pump installed
P901 bit 50No chip conveyor
32Chip conveyor installed
To obtain a value for Parameter 901, add the bit values together for each installed option. For example, if your machine has a spindle chiller and a rotary axis clamp, then you would set Parameter 901 = 5 (1 + 4).

ATC Characteristics

Common to both Umbrella and Swing-Arm

A "Maintenance Mode", activated using the Aux12 key, is used for error recovery. This takes the place of the older maintenance M functions (e.g. M81) which used Aux12 as an ATC error override.

In Maintenance Mode, the Aux keys on the jog panel can be used to drive each ATC component directly. For example, in Maintenance Mode with an umbrella-type ATC, Aux5 will retract the carousel. In Maintenance Mode with a swing-arm ATC, Aux1 will raise the tool pot.

In the event of an error or failure during an automatic tool change, the PLC program will encode the state of the relevant inputs and flags, and store them in PLC word variable W8 (called ATCError_W). A utility program, AWDecode.exe, is provided to unpack and display the stored values.


The spindle air blast is turned off after unclamping the old tool and moving the head up, and remains off until the carousel has finished rotating to the new tool, and the head starts down again. This reduces noise, and also reduces the chance of a low-air-pressure Error.


At the start of a tool change, the control will simultaneously move Z to home; orient the spindle; advance the carousel to the needed tool; and (once rotation is complete) lower the tool pot. Earlier PLC programs did these things sequentially.

Optional Systems

Spindle Chiller

The spindle chiller will start whenever the spindle starts.

The chiller will continue to run for some time afer the spindle stops, unless interrupted early by a Fault or Emergency Stop.

Set the chiller off-delay time, in minutes, in Machine Parameter 175.
P175nSpindle chiller off-delay time (minutes)

The spindle motor cooling fan, if present, will run for the same times as the chiller.

A "ChillerOk" confirmation signal is expected. This input should close whenever the spindle is running. Some lag time is allowed. However, if the chiller is supposed to be running, and the ChillerOk input remains open for ten seconds, then a Fault will be triggered:

The spindle chiller is supposed to be running, but the ChillerOk confirmation input did not close within a reasonable length of time.

Stack Lights

The PLC will light Red, Amber and Green lights to indicate machine status:
RedAny Fault condition, or Emergency Stop
AmberWaiting for operator: manual tool change, M0/M1, or no job running
GreenJob is running

Rotary Clamp

The clamp will be applied with M10; released with M11.

By default, the Clamp output will be powered on when the clamp is to be applied.

If your machine requires that the Clamp output be powered on to release the clamp, then set bit 8 of Machine Parameter 178 (add 256).

The PLC will monitor the axis #4 encoder position while the clamp is applied. If axis #4 moves by more than 8000 encoder counts (typically one turn of a DC servo motor, or about 1/4 turn of an AC servo motor) while the clamp is applied, then the PLC will display a warning message, and automatically release the clamp:

5430 Warning: Fourth axis moving against clamp. Clamp released.
The clamp was applied, but the fourth axis was moving anyway. The PLC has released the clamp.

Coolant Thru Spindle

The thru-spindle coolant is switched on with M88. M88 does not cancel M7 (Mist) or M8 (Flood).

All coolant systems are switched off with M9.

In Manual Coolant mode, thru-spindle coolant is switched on and off with the Aux13 key. Aux13 is the usually-blank blue key to the right of the Mist coolant key. Custom-printed jog panels are available from Centroid for applications like this.

Washdown Pump

A chip washdown pump can be controlled with the following M functions and Aux keys:

M21Start washdown pump
M22Stop washdown pump
Aux14 KeyToggle washdown pump on and off

Aux14 is the usually-blank blue key, rightmost in the coolant-control row.

Chip washdown operates independently of the cutting coolant systems (flood, mist, and CTS).

M21, M22 and Aux14 all work to control the chip washdown pump without regard to the Auto/Manual coolant control selection.

Chip Conveyor and Augers

Up to two reversible augers, plus a chip conveyor, are all controlled simultaneously with the following M functions and Aux keys:

M31Start conveyor, start augers forward
Aux6 Key
M32Start conveyor, start augers reverse
Aux4 Key
M33Stop conveyor and augers
Aux5 Key

There is no provision in the standard PLC program for selecting, deselecting, or selectively controlling separate augers and/or conveyors.

Load Meters

The Oak board features analog inputs on each axis interface header, and also on the spindle analog header H2. If you have connected analog load monitoring signals from your servo drives and/or spindle drive to these inputs, then you can display load meters on the control screen.

Centroid factory-supplied interface cables for Yaskawa Sigma-series and Delta ASDA-series servo drives include wiring for analog load monitors.

Servo axis load meters are displayed as a bar graph below each line of the DRO position display.

The spindle load meter is displayed as a bar graph below the spindle RPM and spindle speed override display in the status window.

To configure load meters on one or more axes, set the following parameter values:

P57 bit 00No load meter for axis #1
1Load meter enabled for axis #1
P57 bit 10No load meter for axis #2
2Load meter enabled for axis #2
P57 bit 20No load meter for axis #3
4Load meter enabled for axis #3
P57 bit 30No load meter for axis #4
8Load meter enabled for axis #4
P991n.nnAxis #1 meter scaling (analog volts for full-scale load)
P992n.nnAxis #2 meter scaling (analog volts for full-scale load)
P993n.nnAxis #3 meter scaling (analog volts for full-scale load)
P994n.nnAxis #4 meter scaling (analog volts for full-scale load)

To configure a spindle load meter, set the following parameter values:

P356Spindle axis is axis #6
P57 bit 50No spindle load meter
32Spindle load meter enabled
P3136If spindle encoder is connected to encoder input #6
0If no spindle encoder is connected
P990n.nnSpindle load meter scaling (analog volts for full-scale load)

CNC Services Northwest Home

Copyright © 2017 Marc Leonard
Last updated 14-Nov-2017 MBL