Machine Tool Design

Chapter 9
Servo Systems, CNC and Motion Control

Bachelors Program in Machine Technology
Machine Tool Design   •   Bachelor

Servo Systems, CNC and Motion Control

Introduction and Context

Machine tools have evolved from manually operated mechanisms into integrated cyber-physical systems. In a modern machining centre, a numerical program specifies geometry and process commands; the CNC interprets those commands; interpolation generates coordinated motion; servo drives convert command signals into motor torque; mechanical transmissions produce axis movement; feedback devices report actual position and speed; and a programmable logic controller (PLC) supervises sequencing, tooling, clamping, lubrication, coolant, and safety functions.

The quality of a CNC machine is therefore not determined by the controller alone. It depends on the complete motion-control chain: numerical command, interpolation, digital control, power conversion, motor, transmission, structure, measurement, and process. Errors in any element can appear as dimensional error, poor surface finish, contour distortion, vibration, or unsafe operation.

This chapter examines CNC architecture, interpolation, feedback devices, servo-loop behaviour, tuning, contouring accuracy, PLC integration, and the comparative evaluation of open-loop and closed-loop systems.

Learning Objectives

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

  1. Describe the architecture and information flow of a CNC machine tool.
  2. Explain interpolation methods and coordinated multi-axis motion.
  3. Distinguish open-loop, semi-closed-loop, and closed-loop control.
  4. Explain the functions of position, velocity, and current loops.
  5. Select and evaluate common feedback devices.
  6. Interpret servo response, following error, bandwidth, and stability.
  7. Apply practical servo-tuning and contour-accuracy principles.
  8. Explain PLC–CNC integration and its implications for machine safety and productivity.
  9. Diagnose common motion-control defects and recommend corrective action.

1. CNC Architecture

A CNC system is a hierarchy of computation and control. Its principal elements are:

  • Part-program input: G-codes, M-codes, coordinate values, feed rates, spindle commands, tool offsets, and probing instructions.
  • Human–machine interface (HMI): Used for program entry, setup, monitoring, diagnostics, and parameter management.
  • CNC kernel: Interprets the program, applies offsets and transformations, performs look-ahead, and calculates the required path.
  • Interpolator: Converts geometric commands into a sequence of closely spaced axis-position commands.
  • PLC or PMC: Executes logical sequencing, such as tool change, door interlock, coolant control, pallet exchange, and alarm handling.
  • Servo controller and drive: Regulates motor current, torque, speed, and position.
  • Motor and mechanical transmission: Produce physical axis or spindle motion.
  • Feedback system: Measures position, speed, or both.
  • Machine interface: Includes limit switches, encoders, temperature sensors, pressure switches, contactors, valves, and safety circuits.

A simplified information flow is:

CNC motion-control architecture Part programG/M codes CNC kerneloffsets, look-ahead Interpolatoraxis commands Servo drivecurrent/speed control Motor and axistransmission and load Feedback deviceencoder or scale actual position PLC / PMCsequence and interlocksenable, mode, alarms, auxiliaries
CNC motion-control architecture
Figure: CNC motion-control architecture

Figure: Simplified CNC, servo, feedback, and PLC architecture.

The architecture contains both high-level and real-time functions. Program interpretation can tolerate milliseconds of computation, whereas current regulation may require sampling intervals measured in microseconds. This separation is essential for stable and responsive operation.

2. Coordinate Systems and Interpolation

A CNC part program defines commanded geometry in a work coordinate system. The controller transforms this information through work offsets, tool-length compensation, cutter-radius compensation, kinematic transformations, and machine-coordinate limits. The resulting commands are expressed for individual machine axes.

2.1 Linear interpolation

For a straight move from point P0=(x0,y0) to P1=(x1,y1) over time T, the ideal path is parameterised by:

x(t) = x₀ + (x₁ − x₀)t/T, y(t) = y₀ + (y₁ − y₀)t/T, 0 ≤ t ≤ T

Here, t and T have units of time and x,y have units of length. Constant component velocities are assumed. The path is straight because both coordinates use the same normalised time parameter.

The feed-speed magnitude is:

vf = √[(∆x/T)² + (∆y/T)²]

where ∆x=x1−x0 and ∆y=y1−y0. The controller must distribute pulses or digital commands so that axis velocities maintain the commanded ratio.

2.2 Circular interpolation

For a circular path with centre (xc,yc) and radius R, the ideal coordinates are:

x(θ) = xc + R cos θ, y(θ) = yc + R sin θ

The angle θ is in radians. Clockwise and counter-clockwise directions determine the sign and progression of θ. A practical CNC approximates the continuous path with high-rate position commands, while look-ahead plans acceleration and deceleration before corners and curvature changes.

2.3 Interpolation quality

Interpolation is not identical to machining accuracy. Even a mathematically correct path can produce error because of servo lag, quantisation, backlash, structural compliance, thermal growth, cutting-force deflection, and tool wear. At a corner, the controller may either stop exactly, blend the corner, or maintain a specified contouring tolerance. High-speed machining commonly uses blending and look-ahead to avoid excessive deceleration, but excessive blending can remove intended sharp features.

3. Motion-Control System Types

3.1 Open-loop control

An open-loop system sends a command without measuring the achieved position. Stepper-motor systems are a common example. They are simple and economical, but the controller cannot directly detect lost steps caused by overload, acceleration that is too high, or mechanical obstruction. Open-loop systems are suitable where loads are predictable, speed is moderate, and lost motion is acceptable or independently detected.

3.2 Semi-closed-loop control

In a semi-closed system, an encoder is mounted on the motor shaft. The controller measures motor rotation but not necessarily the final table position. This arrangement provides rapid feedback and is compact, yet errors in ballscrew pitch, backlash, coupling, and thermal expansion between motor and table may remain unmeasured.

3.3 Fully closed-loop control

A fully closed system measures position at or near the machine element being controlled, often with a linear scale on the axis. It can compensate for transmission errors and thermal or geometric effects within the measurement arrangement. It costs more and introduces alignment, contamination, signal-integrity, and control-bandwidth challenges.

SystemMain feedback locationStrengthLimitation
Open loopNoneLow cost and simpleCannot detect lost motion directly
Semi-closedMotor shaftFast, common, compactTransmission errors may remain
Fully closedTable or tool pointMeasures final motion more directlyCost, installation, and stability complexity

4. Feedback Devices

Incremental encoders generate periodic pulses and often separate A and B channels in quadrature. The phase relationship indicates direction, and an index pulse establishes a reference once per revolution. Position is accumulated from a known datum, so loss of power or counts can require re-referencing.

Absolute encoders provide a coded position directly, commonly through optical or magnetic technologies. They retain position information through power interruption when appropriately designed, reducing homing requirements. Their resolution, communication protocol, environmental rating, and update rate must match the application.

Linear scales measure table displacement directly. Optical scales can provide high resolution but require protection from coolant, chips, vibration, and contamination. Magnetic scales are often more tolerant of harsh conditions, although accuracy and thermal behaviour depend on the design.

Tachometers measure rotational speed, while resolver devices provide angular position through electromagnetic signals and are robust in demanding environments. Hall sensors are commonly used for commutation and coarse rotor-position information in some motors.

Resolution is not the same as accuracy. A high-resolution encoder can report very small increments while the total system remains inaccurate because of scale error, installation misalignment, thermal expansion, or mechanical compliance. Signal interpolation can also create apparent resolution without proportionally improving absolute accuracy.

5. Servo Loops and Dynamic Behaviour

Most machine-tool servo systems are cascaded. The innermost loop regulates motor current, which is closely related to torque. A velocity loop surrounds it, and a position loop is normally the outer loop.

5.1 Current or torque loop

The current loop responds rapidly to torque demand. Its purpose is to make motor torque follow the commanded value despite electrical disturbances and back electromotive force. Excessive current-loop gain can cause noise or instability; insufficient bandwidth limits the performance of all outer loops.

5.2 Velocity loop

The velocity loop compares commanded and measured speed. Proportional and integral action are common. Integral action removes persistent speed error under load, but excessive integral gain can produce overshoot, oscillation, or wind-up when the drive saturates.

5.3 Position loop

The position error is:

ep(t) = r(t) − y(t)

where r(t) is commanded position and y(t) is measured position, both in the same units. A proportional position controller may command velocity as:

vc(t) = Kp ep(t)

where Kp has units of inverse time when vc is length per time. This relationship applies to a simplified proportional position loop and assumes compatible units and a controller operating below saturation.

A practical servo is a dynamic system. Important measures include:

  • Following error: instantaneous difference between commanded and actual position.
  • Settling time: time required to enter and remain within a specified error band.
  • Overshoot: response beyond the final commanded value.
  • Bandwidth: frequency range over which the system tracks commands acceptably.
  • Stability margin: reserve against oscillation caused by gain, delay, resonance, or phase lag.
  • Saturation: limitation imposed by maximum current, speed, acceleration, or voltage.

A moving axis can have nonzero following error even when it is accurately positioned at rest. With proportional control, a constant-speed move generally requires error to generate the velocity command. At the endpoint, the error should decay, subject to friction, quantisation, and tuning.

6. Servo Tuning

Servo tuning is the adjustment of gains, filters, feed-forward parameters, acceleration limits, and notch filters so that the machine follows commands rapidly without unacceptable vibration or instability.

A disciplined procedure is preferable to trial-and-error:

  1. Inspect mechanical condition: lubrication, coupling tightness, ballscrew preload, guideways, backlash, and balance.
  2. Confirm encoder direction, scaling, polarity, and machine-coordinate conventions.
  3. Establish conservative current, velocity, acceleration, and position limits.
  4. Tune the current loop according to the drive manufacturer’s validated procedure.
  5. Tune the velocity loop using low-risk moves, checking overshoot and oscillation.
  6. Increase position-loop gain gradually while monitoring following error and vibration.
  7. Add velocity or acceleration feed-forward where supported to reduce dynamic lag.
  8. Identify structural resonances and use carefully selected notch or low-pass filters.
  9. Test rapid traverses, short moves, reversals, circles, and representative cutting loads.
  10. Record parameters and validate them after thermal stabilisation.

Feed-forward does not replace feedback. It anticipates the command, reducing predictable tracking error, while feedback corrects disturbances and modelling error. Filters improve stability around known resonances but may reduce bandwidth and introduce phase delay. They should not be used to conceal poor mechanics.

7. Contouring Accuracy

Contouring accuracy concerns the error between the commanded geometric path and the actual tool-centre path. It differs from point-to-point positioning accuracy. A machine can reach individual points accurately yet produce poor circularity because the axes respond differently during coordinated motion.

Important contributors include:

  • unequal axis gains and dynamic lag;
  • backlash and reversal error;
  • ballscrew pitch and cyclic error;
  • servo quantisation and communication delay;
  • structural deflection under cutting force;
  • thermal expansion of screws, scales, spindle, and casting;
  • interpolation tolerance and corner blending;
  • tool-radius and work-offset errors;
  • vibration, friction, and stick–slip behaviour.

A useful geometric measure for a commanded circular test is radial error. If the measured point is (xi,yi) and the intended centre is (xc,yc), the measured radius is:

Ri = √[(xi − xc)² + (yi − yc)²]

The radial deviation is er,i=Ri−R. This is a diagnostic measure, not a complete machine-accuracy specification. It assumes the intended centre and radius are known and does not by itself separate servo, geometric, thermal, and measurement errors.

Circular interpolation tests, ball-bar tests, laser interferometry, scale calibration, and machining trials each reveal different error sources. Compensation tables can reduce repeatable pitch and geometric errors, but compensation cannot reliably correct random vibration, changing thermal conditions, or unstable cutting dynamics.

8. PLC Integration and Machine Sequencing

The CNC determines coordinated motion; the PLC governs discrete and sequential machine functions. Typical PLC tasks include:

  • spindle start, stop, orientation, and speed confirmation;
  • tool-change sequencing and unclamp/clamp verification;
  • coolant, chip conveyor, lubrication, and hydraulic control;
  • door, guard, chuck, vise, and pallet interlocks;
  • homing and reference-return logic;
  • alarm generation and reset conditions;
  • probing cycles and tool-break detection;
  • communication with robots, material-handling systems, and plant networks.

CNC–PLC integration requires clear ownership of commands and permissives. For example, a cycle-start request should not energise axis motion unless door status, emergency-stop status, lubrication pressure, tool clamping, and spindle readiness are valid. Safety-related functions should use appropriately rated safety circuits or safety PLCs; ordinary program logic must not be treated as a substitute for engineered safeguarding.

Handshaking signals commonly include request, busy, complete, ready, and fault. Each signal needs defined timing, reset behaviour, and fault response. A tool-change sequence that lacks timeout supervision may leave the machine in an ambiguous state after a sensor failure. Good PLC design uses diagnostic messages, fail-safe states, controlled restart, and documented state transitions.

9. Worked Example: Coordinated Linear Motion

An axis must move from (x0,y0)=(10,20) mm to (x1,y1)=(70,50) mm in 2 s. Determine the component velocities and feed-speed magnitude.

The displacements are ∆x=60 mm and ∆y=30 mm. Thus:

vx = ∆x/T = 60/2 = 30 mm/s
vy = ∆y/T = 30/2 = 15 mm/s

The resultant feed speed is:

vf = √(30² + 15²) = √1125 ≈ 33.54 mm/s

The controller must maintain the velocity ratio vx:vy=2:1. If one axis lags substantially, the tool deviates from the intended straight line even if both axes eventually reach their endpoints.

10. Applied Case: Contour Error on a Machining Centre

Background

This illustrative case concerns a three-axis vertical machining centre producing aluminium mould inserts. Operators report acceptable point-to-point dimensions but visible witness marks and poor circularity on pocket corners.

Problem

A circular interpolation test shows a radial variation of approximately 18 μm. The error is most pronounced during reversal of the X axis. The PLC reports no alarms, and static position checks are within the stated acceptance range.

Analysis

The distinction between static positioning and dynamic contouring directs attention to reversal error, friction, servo mismatch, and mechanical looseness. Inspection finds slight coupling looseness and inadequate lubrication on one guideway. Diagnostic traces also show higher following error on X during reversal than on Y. The controller’s corner-blending tolerance is set very tightly, causing abrupt deceleration at transitions.

Approach and solution

The maintenance team first corrects lubrication and coupling torque, then verifies encoder polarity and scale. The X velocity-loop response is retuned conservatively, and a small feed-forward adjustment reduces predictable tracking lag. A validated notch filter addresses a measured structural resonance. The corner-blending parameter is changed only within the tolerance permitted by the component drawing. Finally, the team repeats thermal warm-up, circular tests, and a representative cutting trial.

Outcome

Radial variation falls to approximately 7 μm, surface witness marks are reduced, and the component remains within its functional tolerance. The improvement results from mechanical correction, matched servo dynamics, and appropriate path planning—not from gain adjustment alone.

Learning points

  1. A CNC alarm-free condition does not prove contour accuracy.
  2. Mechanical inspection must precede aggressive tuning.
  3. Static accuracy and dynamic accuracy are different properties.
  4. PLC diagnostics and servo traces should be interpreted together.
  5. Compensation and blending must remain subordinate to drawing tolerances.

11. Evaluation, Limitations, and Contemporary Practice

Closed-loop systems generally provide superior disturbance rejection and diagnostic capability, but they cost more and can become unstable if feedback is poorly installed or gains are excessive. Open-loop systems remain useful for simple, low-cost applications, particularly when the load and duty cycle are predictable. The correct choice depends on required accuracy, force, speed, duty cycle, risk, maintainability, and life-cycle cost.

Modern CNC systems increasingly use high-speed digital networks, model-based feed-forward, adaptive control, direct-drive motors, linear motors, absolute encoders, thermal compensation, probing, and condition monitoring. Artificial intelligence can assist anomaly detection, parameter recommendation, tool-wear estimation, and predictive maintenance. However, an AI recommendation must be validated against machine limits, process evidence, and safety requirements. It must not autonomously disable interlocks or replace responsible engineering judgement.

Cybersecurity is also a motion-control concern. Network segmentation, authenticated access, controlled parameter backup, event logging, secure remote maintenance, and tested recovery procedures reduce the risk of malicious or accidental changes to motion parameters. Safety, intellectual property, and traceability should be included in system governance.

Best practice is to specify the complete performance chain rather than a controller’s nominal resolution. Requirements should state positioning accuracy, repeatability, contour tolerance, speed, acceleration, settling time, environmental conditions, measurement method, and acceptance standard. Commissioning should include baseline data, parameter backups, thermal tests, geometric calibration, and documented change control.

Chapter Summary

CNC motion control is an integrated system in which the CNC interprets programs, interpolation generates coordinated commands, servo loops regulate torque, speed, and position, feedback devices measure response, and mechanical components produce tool motion. Linear and circular interpolation establish the commanded path, but actual contour accuracy is affected by servo dynamics, backlash, compliance, thermal effects, friction, interpolation strategy, and cutting forces.

Open-loop systems are simple but cannot directly detect lost motion. Semi-closed systems measure motor position, while fully closed systems measure motion nearer the machine element. Cascaded current, velocity, and position loops provide progressively higher-level control. Tuning must proceed from mechanical inspection through inner-loop adjustment, outer-loop tuning, filtering, feed-forward, and representative validation. PLC integration coordinates sequencing, interlocks, auxiliary equipment, diagnostics, and safe machine states. Accurate evaluation therefore requires both control-theory understanding and practical machine-tool diagnosis.

Key Terms

CNC: Computer numerical control used to command machine-tool functions.

Interpolator: CNC function that converts geometry into coordinated axis commands.

Servo drive: Power-electronic unit regulating motor current, speed, or position.

Following error: Difference between commanded and measured position.

Open-loop control: Control without feedback of achieved motion.

Semi-closed loop: Feedback measured at the motor or transmission input.

Fully closed loop: Feedback measured near the final machine element.

Incremental encoder: Encoder producing pulses relative to a reference position.

Absolute encoder: Encoder reporting coded position directly.

Linear scale: Feedback device measuring linear axis displacement.

Position loop: Outer servo loop regulating position.

Velocity loop: Servo loop regulating speed.

Current loop: Inner loop regulating motor current and torque.

Interpolation: Computation of coordinated intermediate path points.

Following error: Dynamic command–response position difference.

Contour accuracy: Agreement between actual and commanded path.

PLC/PMC: Programmable controller supervising machine logic and sequencing.

Feed-forward: Predictive control action based on commanded motion.

Backlash: Lost motion caused by clearance or reversal in a transmission.

Look-ahead: Planning of upcoming path segments to improve dynamic response.

Review Questions

Short Answer Questions

  1. What are the principal functions of the CNC kernel and interpolator?
  2. Distinguish an incremental encoder from an absolute encoder.
  3. Why is the current loop normally faster than the position loop?
  4. What is following error?
  5. State two functions commonly performed by a machine-tool PLC.

Long Answer Questions

  1. Explain the architecture of a CNC machine tool from part program to physical axis motion.
  2. Compare open-loop, semi-closed-loop, and fully closed-loop motion-control systems.
  3. Explain how unequal servo dynamics can produce contouring error.
  4. Describe a safe and systematic servo-tuning procedure.
  5. Discuss the role of PLC handshaking, permissives, and safety interlocks in CNC operation.

Analytical / Application Questions

  1. An axis reaches its commanded endpoint accurately but produces poor circularity during reversal. Analyse at least four possible causes and propose a diagnostic sequence.
  2. Select an appropriate feedback architecture for a high-precision grinding axis operating in a coolant-rich environment. Justify the choice and identify installation risks.
  3. A two-axis move has ∆x=80 mm and ∆y=60 mm and must finish in 4 s. Calculate each component velocity and the resultant feed speed, then explain why unequal servo lag would distort the path.

Multiple Choice Questions with Answers

Question 1

Which CNC function generates coordinated intermediate commands between programmed geometric points?

A. Interpolator

B. PLC timer

C. Spindle contactor

D. Lubrication pump

Correct Answer: A. Interpolator

Question 2

Where is feedback measured in a fully closed-loop axis system?

A. Only at the motor current sensor

B. Near the final machine element or table

C. Only at the CNC keyboard

D. At the coolant reservoir

Correct Answer: B. Near the final machine element or table

Question 3

For a proportional position loop, the position error is defined as:

A. Measured position minus motor current

B. Commanded position minus measured position

C. Velocity divided by acceleration

D. Torque minus spindle speed

Correct Answer: B. Commanded position minus measured position

Question 4

Which loop is normally the innermost loop in a cascaded servo system?

A. Position loop

B. Temperature loop

C. Current or torque loop

D. PLC sequence loop

Correct Answer: C. Current or torque loop

Question 5

A principal limitation of open-loop stepper motion is that it:

A. Always requires a linear scale

B. Cannot directly detect lost steps

C. Cannot produce digital commands

D. Has no speed limitation

Correct Answer: B. Cannot directly detect lost steps

Question 6

A move has component velocities 30 mm/s and 15 mm/s. What is the resultant feed speed?

A. 15.00 mm/s

B. 30.00 mm/s

C. 33.54 mm/s

D. 45.00 mm/s

Correct Answer: C. 33.54 mm/s

Question 7

Which device commonly uses quadrature channels to indicate incremental position and direction?

A. Incremental encoder

B. Hydraulic pressure switch

C. Thermocouple

D. Contactor

Correct Answer: A. Incremental encoder

Question 8

What is the primary purpose of CNC look-ahead?

A. To store coolant

B. To plan upcoming path segments and manage dynamic response

C. To replace all feedback devices

D. To measure tool hardness

Correct Answer: B. To plan upcoming path segments and manage dynamic response

Question 9

Which action should normally precede aggressive servo-gain adjustment?

A. Disable all interlocks

B. Inspect mechanical condition and feedback scaling

C. Increase acceleration to its maximum

D. Remove the encoder

Correct Answer: B. Inspect mechanical condition and feedback scaling

Question 10

Which PLC design feature helps prevent an indefinite tool-change state after sensor failure?

A. Timeout supervision

B. Removing fault messages

C. Ignoring permissives

D. Eliminating state transitions

Correct Answer: A. Timeout supervision

Machine Tool Design
Chapter 9 of 15