Manufacturing Automation

Chapter 5
Computer Numerical Control and Automated Machine Tools

Bachelors Program in Machine Technology
Manufacturing Automation   •   Bachelor

Computer Numerical Control and Automated Machine Tools

Introduction and Context

Computer numerical control (CNC) is the automated control of machine-tool motion and auxiliary functions by a stored numerical program. A CNC machine converts digital instructions into coordinated motion of axes, spindle operation, coolant control, tool changes, and other manufacturing actions. CNC is therefore more than a motorized machine: it is a cyber-physical production system joining mechanical structure, drives, sensors, control software, tooling, workholding, and production data.

CNC replaced much manual and hard-wired control because it permits rapid changeover, repeatable production, complex geometry, and integration with computer-aided design and manufacturing (CAD/CAM). Its benefits depend on correct process planning. A poorly selected tool, inaccurate work offset, weak fixture, or defective program can produce scrap even when the controller operates perfectly.

Learning Objectives

After studying this chapter, the reader should be able to:

  1. Explain the architecture and operating sequence of a CNC system.
  2. Select suitable coordinate systems, offsets, interpolation methods, tooling, and workholding strategies.
  3. Interpret fundamental G-code and construct a safe part-programming sequence.
  4. Distinguish machining centres from conventional and specialized automated machine tools.
  5. Explain adaptive control, tool monitoring, and the integration of CNC equipment into automated cells.
  6. Evaluate CNC performance, safety, quality, and economic limitations in an industrial application.

1. CNC Architecture

A CNC system has several interacting layers:

LayerMain functionTypical elements
Human–machine interfaceProgram entry, setup, diagnosisDisplay, keyboard, handwheel
Numerical controllerInterprets blocks and generates commandsProcessor, memory, interpolation software
Drive systemConverts commands into axis and spindle motionServo amplifiers, motors, feedback devices
Machine toolProduces physical cutting actionBed, slides, spindle, turret, enclosure
Auxiliary systemSupports machining and safetyCoolant, lubrication, chip removal, guarding
Manufacturing networkExchanges programs and production dataDNC, industrial Ethernet, MES interface

The part program is read by the controller. The control interprets modal and non-modal commands, calculates the commanded path, performs interpolation, and sends position or velocity demands to servo drives. Feedback devices—commonly linear scales or rotary encoders—report actual position. A servo loop compares commanded and measured position and reduces error. In simplified form, position error is

e(t) = r(t) − y(t)

where r(t) is commanded position, y(t) is measured position, and e(t) is position error at time t. The expression is a control concept rather than a complete servo model; actual systems also include velocity loops, current loops, friction, backlash compensation, and dynamic limits.

The machine coordinate system is established by the manufacturer and normally has a fixed machine zero. The work coordinate system is established by the operator or programmer for a particular setup. A tool offset describes tool geometry or length, while a wear offset provides a small correction after measurement or inspection. Confusing these offset types is a common cause of collisions and dimensional errors.

A CNC controller may be open-loop or closed-loop. In an open-loop system, the controller assumes that commanded motion occurs; stepper motors are a common example. A closed-loop system measures motion and corrects deviations. Closed-loop systems generally provide better positioning assurance, although they cannot compensate for every source of error, such as fixture movement or thermal distortion.

2. Coordinate Systems and Motion

Most CNC lathes use a two-axis coordinate system: Z is parallel to the spindle axis and X represents radial motion. Milling machines commonly use three linear axes, X, Y, and Z, with additional rotary axes designated A, B, and C about the corresponding linear axes. Axis direction follows the right-hand rule and machine-tool standards, but the exact positive direction must always be confirmed from the machine manual.

Absolute programming specifies positions from a fixed work origin. Incremental programming specifies movement relative to the current tool position. Absolute coordinates are usually easier to audit; incremental coordinates can be convenient for repeated patterns but are more vulnerable to accumulated programming mistakes.

A programmed point is not necessarily the cutting contact point. Cutter radius compensation allows the control to offset the tool centre path by the cutter radius so that the programmed contour represents the finished-part boundary. Compensation must be activated and cancelled in a suitable location; abrupt activation on a finished contour can cause an unexpected motion.

Feed rate describes commanded tool motion. For milling, cutting speed is related to spindle speed by

vc = πDN / 1000

where vc is cutting speed in m/min, D is cutter diameter in mm, and N is spindle speed in rev/min. Therefore,

N = 1000vc / (πD)

These equations assume consistent units and a circular tool rotating about its axis. For a 50 mm cutter at 150 m/min, N ≈ 955 rev/min. The programmed feed for a milling cutter is commonly estimated by

vf = fz z N

where vf is feed rate in mm/min, fz is feed per tooth in mm/tooth, z is the number of effective teeth, and N is spindle speed in rev/min. If fz = 0.08 mm/tooth, z = 4, and N = 955 rev/min, then vf ≈ 306 mm/min. Actual values must be checked against tool, material, rigidity, coolant, and manufacturer recommendations.

3. Interpolation and Motion Control

Interpolation calculates intermediate points between programmed locations. Linear interpolation produces a straight tool-centre path. Circular interpolation produces an arc defined by an end point and either a centre or radius. Helical interpolation combines circular motion with linear axis motion. Spline and high-speed look-ahead functions may provide smoother motion for complex free-form surfaces.

The controller does not normally command infinitely smooth motion. It approximates a path through discrete control cycles while respecting axis velocity, acceleration, jerk, spindle limits, and machine geometry. Look-ahead examines future blocks to avoid sudden deceleration and to maintain surface quality. Excessively short CAM-generated blocks can overload a controller or cause velocity fluctuations unless the control has suitable processing capacity.

Interpolation accuracy is affected by numerical resolution, servo response, backlash, pitch error, thermal growth, structural deflection, and the quality of the geometric model. Thus, a mathematically correct program does not guarantee a geometrically correct component.

4. Tooling and Workholding

Tool selection balances material removal rate, surface finish, tool life, rigidity, accessibility, and cost. Important tool variables include material, coating, geometry, diameter, number of teeth, edge preparation, and overhang. Carbide tools generally permit higher cutting speeds than high-speed steel, but they are more sensitive to impact and poor rigidity. Coatings can reduce friction and wear, but their suitability depends on workpiece material and cutting temperature.

Tool overhang should be minimized because deflection rises rapidly with unsupported length. For a simplified cantilever model, tip deflection is

δ = FL³ / (3EI)

where δ is tip deflection, F is transverse cutting force, L is unsupported length, E is elastic modulus, and I is the second moment of area. This formula assumes a uniform, elastic cantilever with a point load and is an approximation, not a complete model of a rotating tool assembly. Its important design implication is the cubic dependence on overhang: doubling L increases predicted deflection eightfold if other variables remain constant.

Workholding must resist cutting forces without damaging the part or obstructing tool access. Common devices include vises, three-jaw and four-jaw chucks, collets, modular fixtures, vacuum fixtures, magnetic chucks, tombstones, and custom hydraulic or pneumatic fixtures. A robust fixture locates the workpiece, constrains unwanted motion, permits loading and unloading, provides repeatability, and supports chip and coolant management.

The 3-2-1 locating principle provides a conceptual basis for rigid location: three points establish a primary plane, two establish a secondary plane, and one establishes a tertiary plane. Clamps should apply force toward locating surfaces rather than distort the component. Thin or flexible parts may require distributed support, soft jaws, reduced cutting forces, or multiple operations.

5. Part Programming and G-code

A CNC program consists of blocks, commonly containing sequence numbers, preparatory functions, coordinates, feed, spindle speed, tool commands, and auxiliary functions. G-codes specify motion or control modes; M-codes commonly control auxiliary functions such as spindle rotation, coolant, and program stop. Codes vary by controller, so the machine manual is authoritative.

Typical milling commands include:

CodeTypical meaning
G00Rapid positioning
G01Linear interpolation at programmed feed
G02/G03Clockwise/counterclockwise circular interpolation
G17/G18/G19Plane selection
G20/G21Inch/metric input selection
G40/G41/G42Cutter compensation cancellation/left/right
G54–G59Work-coordinate systems
G90/G91Absolute/incremental programming
M03/M04/M05Spindle clockwise/counterclockwise/stop
M06Tool change on many machining centres
M08/M09Coolant on/off
M30End and reset program

Many G-codes are modal: they remain active until replaced or cancelled. This makes programs concise but creates risk. A safe program explicitly establishes units, plane, coordinate mode, work offset, tool, spindle state, coolant state, and safe approach conditions. It should also contain a controlled tool-change position and an end-of-program state.

A general programming sequence is: review drawing and datum; define stock and setup; select tools; establish work offset; plan roughing and finishing operations; calculate speeds and feeds; write or generate the program; simulate it; dry-run above the workpiece; verify offsets; machine a first article; inspect; and document corrections.

CAM software improves productivity for complex geometry, but post-processing is essential because controllers differ in syntax, canned cycles, compensation behavior, and machine kinematics. The programmer remains responsible for verification.

6. Machining Centres and Automated Machine Tools

A machining centre integrates multiple operations in one machine, usually with automatic tool changing. Vertical machining centres offer good visibility and are common for prismatic parts. Horizontal machining centres improve chip evacuation and may access several faces using a rotary table or pallet system. Five-axis machines orient the tool and workpiece to reach complex surfaces and reduce setups, but they require careful kinematic calibration and collision checking.

Turning centres combine spindle rotation, feed axes, turrets, live tooling, and sometimes sub-spindles. Swiss-type machines support slender, small-diameter parts close to the cutting zone. Automated machine tools may also include pallet changers, bar feeders, robots, probing systems, and in-process gauging.

The economic value of a machining centre is not simply its maximum speed. Relevant measures include setup time, spindle utilization, tool-change time, first-pass yield, changeover flexibility, maintenance cost, and total equipment effectiveness (TEEP) or overall equipment effectiveness (OEE). A commonly used OEE relationship is

OEE = Availability × Performance × Quality

where each factor is expressed as a decimal or percentage on a consistent basis. Availability reflects scheduled time actually operating, performance compares actual rate with an ideal rate, and quality represents good units divided by total units. OEE is useful for diagnosing losses but should not be treated as a complete measure of profitability or engineering capability.

7. Adaptive Control and Tool Monitoring

Fixed cutting conditions assume that stock allowance, material, tool condition, rigidity, and temperature remain sufficiently stable. Adaptive control modifies feed, spindle speed, or another process variable using measured conditions. Signals may include spindle power, torque, vibration, acoustic emission, motor current, cutting force, temperature, or dimensional inspection.

A simple control policy might reduce feed when measured spindle load exceeds a limit and restore feed when the load returns to an acceptable range. Such a policy needs filtering, hysteresis, rate limits, and safe bounds; otherwise noise can cause oscillation or excessive command changes. Adaptive control must never exceed tool, spindle, fixture, or machine limits.

Tool monitoring has two principal purposes: detecting gradual wear and identifying sudden breakage. Wear may be inferred from power, vibration, acoustic emission, or measured dimensions. Breakage detection may use a sudden signal change, laser tool measurement, spindle-load monitoring, or a post-operation probe. Monitoring systems require a baseline and a decision threshold. False alarms reduce trust, while missed alarms create scrap and possible machine damage.

Tool life can be described empirically by Taylor’s equation:

V Tⁿ = C

where V is cutting speed, T is tool life, and n and C are experimentally determined constants for a specified tool-workpiece-condition combination. The relationship is valid only over the tested range and does not replace manufacturer data or process trials.

8. Integration into Automated Cells

A CNC machine becomes part of an automated cell when material handling, inspection, tooling, information flow, and control are coordinated. A typical cell may include a CNC machining centre, robot, pallet station, tool presetting unit, washing system, gauging station, safety enclosure, and manufacturing execution system (MES).

Integration requires defined interfaces. The cell controller must know whether the machine is ready, occupied, faulted, or awaiting material. The robot needs reliable part-present signals, gripper confirmation, door interlocks, and a verified loading position. The MES may dispatch programs, record serial numbers, capture tool-life data, and associate inspection results with each part.

A practical sequence is: identify the order; select a verified program and fixture; load and clamp the blank; confirm part presence and datum; machine the component; perform probing or gauging; route accepted parts to finished inventory; quarantine nonconforming parts; and record traceability data. Interlocks should prevent motion when doors are open, pallets are unsecured, tools are absent, or clamping pressure is inadequate.

Automation creates new risks. A robot can repeat an unsafe action at high speed, and a network connection can distribute an incorrect or unauthorized program. Functional safety therefore requires risk assessment, guarding, emergency stops, safe motion functions, access control, backups, change management, and periodic validation. Cybersecurity is also a production concern: authenticated access, segmented networks, malware protection, and controlled removable media reduce the risk of manipulation.

9. Worked Application: Automated Aluminium Housing Cell

Background

This illustrative case concerns a cell producing aluminium motor housings. Each housing requires face milling, drilling, pocketing, and tapping. Previously, operators transferred parts between three machines, producing variable datums and long throughput time.

Problem

The factory experienced repeated setup errors, excessive handling, and occasional broken drills. The target was to improve repeatability without sacrificing operator safety.

Analysis

A single horizontal machining centre with a two-pallet changer was selected. A modular fixture located the casting using three primary supports, two secondary locators, and one end stop. Hydraulic clamps applied force toward the locating surfaces. A probe established the work offset and checked casting presence. Tool lengths were measured offline, while a broken-tool sensor checked drills and taps.

The process engineer selected carbide cutters using supplier data, then verified feeds by trial cuts. For a 63 mm face mill operating at 180 m/min,

N = 1000(180)/(π×63) ≈ 909 rev/min

With five teeth and a feed per tooth of 0.10 mm/tooth,

vf = 0.10×5×909 ≈ 455 mm/min

The controller program first established metric units, the selected work offset, safe plane, tool, spindle direction, and coolant. Roughing and finishing were separated so that dimensional corrections could be made without changing the roughing strategy.

Approach and Outcome

The robot loaded a raw casting on pallet A while pallet B was machined. Probing confirmed the datum; the MES released only the approved revision of the program. After machining, a gauging station measured critical hole position and housing thickness. A failed result caused automatic quarantine and generated an operator message rather than allowing the part into assembly.

The principal improvements were reduced manual handling, consistent location, earlier detection of broken tools, and traceable inspection records. The cell did not eliminate engineering judgment: tool-life limits, fixture maintenance, probe calibration, and program revision control remained necessary.

Learning Points

The case demonstrates that automation performance depends on the complete system. Accurate CNC motion cannot compensate for unstable castings, poor location, missing inspection, or weak information control. The best solution combines mechanical design, programming discipline, sensing, safety, and production management.

10. Limitations, Quality, and Best Practice

CNC does not automatically provide accuracy. Thermal growth can change tool and workpiece dimensions; machine geometry can drift; cutting forces can deflect tools; chips can prevent seating; and incorrect offsets can create systematic error. Preventive maintenance should include lubrication, coolant control, way protection, spindle and axis checks, calibration, and inspection of fixtures and tooling.

Best practice includes:

  • use standardized datum and offset conventions;
  • verify programs through simulation, single-block operation, and controlled dry runs;
  • minimize tool overhang and use balanced tool assemblies at high speed;
  • measure tools and work offsets rather than relying on assumptions;
  • record tool life and corrective actions;
  • separate approved production programs from editable working files;
  • use probing and in-process verification where the cost of scrap is high;
  • apply documented risk assessment and lockout/tagout procedures;
  • preserve traceability for programs, tools, fixtures, operators, and inspection results.

Contemporary developments include digital twins, machine learning for tool-wear prediction, cloud-connected monitoring, additive–subtractive hybrid machines, high-speed five-axis machining, and autonomous process planning. These technologies are valuable when supported by reliable data and explainable alarms. Artificial intelligence should assist—not silently replace—engineering approval, especially where a faulty prediction could cause injury or release nonconforming product.

Chapter Summary

CNC combines numerical programming, coordinate transformation, interpolation, servo control, machine mechanics, tooling, workholding, and inspection. Absolute and incremental coordinates, work offsets, tool offsets, cutter compensation, and modal codes must be controlled carefully. Cutting speed and feed calculations provide a starting point, but material, tool geometry, rigidity, coolant, and manufacturer limits determine the final process.

Machining centres consolidate operations and can use automatic tool changing, pallet systems, probing, and robots. Adaptive control and tool monitoring use process signals to regulate cutting or identify wear and breakage. When CNC equipment is integrated into an automated cell, reliable interfaces, interlocks, cybersecurity, traceability, and risk assessment become as important as axis accuracy. Successful automation is therefore a systems-engineering achievement rather than merely the purchase of a programmable machine.

Key Terms

CNC: Computer-based control of machine-tool functions.

Servo loop: Feedback control system comparing commanded and measured motion.

Interpolation: Calculation of intermediate motion points between programmed locations.

Work coordinate system: Part-specific coordinate frame established for a setup.

Machine zero: Fixed reference established by the machine manufacturer.

Work offset: Transformation locating the programmed part datum relative to machine coordinates.

Tool offset: Stored value representing tool length, radius, or geometry.

Cutter compensation: Control adjustment that accounts for cutter radius.

Modal code: Command that remains active until cancelled or replaced.

G-code: Preparatory programming command governing motion or control modes.

M-code: Auxiliary machine-function command.

Machining centre: CNC machine with automatic tool changing and multiple machining capabilities.

Adaptive control: Automatic adjustment of process variables using measured conditions.

Tool monitoring: Detection or estimation of tool condition during production.

Workholding: Method of locating and securing a workpiece.

Post-processor: Software that converts CAM output to controller-specific code.

OEE: Product of availability, performance, and quality factors.

MES: Manufacturing execution system coordinating production information.

Interlock: Safety or sequencing condition that prevents an unsafe action.

Review Questions

Short Answer Questions

  1. What are the principal layers of a CNC system?
  2. Distinguish a work offset from a tool offset.
  3. What is the purpose of interpolation?
  4. Why should tool overhang be minimized?
  5. State two functions of tool monitoring.

Long Answer Questions

  1. Explain the architecture of a closed-loop CNC system and the role of feedback.
  2. Discuss how coordinate systems, cutter compensation, and modal codes affect programming safety.
  3. Compare vertical, horizontal, and five-axis machining centres.
  4. Explain the design requirements of a reliable CNC workholding system.
  5. Describe how a CNC machining centre can be integrated into a robot-assisted automated cell.

Analytical / Application Questions

  1. A 40 mm cutter is specified for 125 m/min cutting speed. Calculate spindle speed and explain which practical limits must be checked before programming it.
  2. A process shows increasing spindle load and occasional broken tools. Propose a tool-monitoring and adaptive-control strategy, including safeguards against false alarms.
  3. An automated cell produces dimensionally inconsistent parts despite a correct program. Analyze at least five possible mechanical, thermal, tooling, fixturing, sensing, or data-management causes and propose verification tests.

Multiple Choice Questions with Answers

Question 1

Which CNC element compares commanded position with measured position?

A. Servo feedback loop

B. Coolant pump

C. Tool magazine

D. Workholding fixture

Correct Answer: A. Servo feedback loop

Question 2

For a 50 mm cutter at 150 m/min, the approximate spindle speed is:

A. 95 rev/min

B. 955 rev/min

C. 4,775 rev/min

D. 7,500 rev/min

Correct Answer: B. 955 rev/min

Question 3

What is the principal purpose of a work offset?

A. To define the part datum relative to machine coordinates

B. To increase coolant pressure

C. To select the number of cutting teeth

D. To measure spindle temperature

Correct Answer: A. To define the part datum relative to machine coordinates

Question 4

Which command commonly represents linear interpolation?

A. G00

B. G01

C. G02

D. M06

Correct Answer: B. G01

Question 5

If cutter overhang doubles in the simplified cantilever model, predicted deflection becomes:

A. Half as large

B. Twice as large

C. Four times as large

D. Eight times as large

Correct Answer: D. Eight times as large

Question 6

Which feature most directly distinguishes a machining centre from a basic CNC mill?

A. Automatic tool changing

B. A machine bed

C. A spindle motor

D. A coordinate system

Correct Answer: A. Automatic tool changing

Question 7

Which is an appropriate purpose of adaptive control?

A. Changing feed in response to measured cutting conditions

B. Replacing all fixture location surfaces

C. Removing the need for program verification

D. Guaranteeing zero tool wear

Correct Answer: A. Changing feed in response to measured cutting conditions

Question 8

In the relationship OEE = Availability × Performance × Quality, quality represents:

A. Good units divided by total units

B. Scheduled time divided by cycle time

C. Tool life divided by cutting speed

D. Spindle speed divided by feed rate

Correct Answer: A. Good units divided by total units

Question 9

Which arrangement best reflects the 3-2-1 locating principle?

A. Three primary, two secondary, and one tertiary locating contact

B. Three clamps, two tools, and one coolant line

C. Three programs, two offsets, and one spindle

D. Three robots, two pallets, and one inspection station

Correct Answer: A. Three primary, two secondary, and one tertiary locating contact

Question 10

Why is a controller-specific post-processor required for CAM output?

A. Controllers differ in syntax, cycles, and compensation behavior

B. CAM software cannot represent geometry

C. Post-processors physically sharpen cutting tools

D. Controllers do not use numerical coordinates

Correct Answer: A. Controllers differ in syntax, cycles, and compensation behavior

Manufacturing Automation
Chapter 5 of 15