Murray State University School of Engineering CourseWiki

CNC Control Fundamentals

How a control turns a program into motion, how feedback works, and what changes between milling and turning.

CNC repeats programmed motion; the operator still defines the process

CNC repeats programmed motion; the operator still defines the process

Computer numerical control (CNC) uses a program to command machine motion and functions. On a manual machine, the operator directs each move with handwheels or power-feed controls. On a CNC machine, the operator prepares the tools, workholding and coordinate references, then checks the programmed sequence.

CNC can repeat a complex path consistently. It does not remove variation from tool wear, deflection, temperature or setup errors. Programming and setup take time, so CNC is not automatically faster for every one-off job.

The machine control unit (MCU) reads program blocks, keeps track of active settings, calculates intermediate positions along a path, and sends commands to the axis drives and machine functions. The drives supply power to the motors. The control also presents positions, settings and alarms to the operator.

Feedback distinguishes open-loop and closed-loop motion

Feedback distinguishes open-loop and closed-loop motion

SystemHow position is controlledWhat that means
Open loopThe drive sends motion commands without measuring actual position back into that positioning loop.The control may not detect a missed step. A displayed commanded position is not proof of actual position.
Closed loopA sensor reports position or motion; the drive/control compares feedback with the command and corrects error.Excessive following error can produce an alarm. Feedback does not make the mechanics error-free.

A stepper motor advances through commanded angular steps and is often used in open-loop systems. A servo system uses feedback to regulate motion. Closed-loop stepper systems also exist: motor type alone does not tell you whether feedback is present.

Where the sensor sits matters

A motor encoder measures the motor, while a linear scale can measure the slide directly. Screw error, backlash and elastic deflection between the sensor and the cutting point may remain. Homing establishes a reference; repeating homing is not a general cure for lost motion. See Oriental Motor's closed-loop stepper overview for an example of feedback used with steppers.

Milling rotates the cutter; turning rotates the work

Milling rotates the cutter; turning rotates the work

Basic machineCutting motionCommon programming concerns
Three-axis vertical millA rotating cutter moves relative to the work along X, Y and Z.Tool lengths, cutter radius, XY contours and hole locations.
Two-axis latheThe work rotates while a cutting tool moves along X and Z.Diameter/radius convention, tool geometry and wear offsets, tool nose radius and changing work diameter.

Machines with live tooling, extra linear axes or rotary axes extend these basic cases. A mill's tool changer and a lathe's turret do not necessarily use the same tool-selection commands. Learn the geometry in CNC Axes and Offsets, then compare Milling Operations and Lathe Operations. For cutting data use Feeds and Speeds; for milling direction use Climb and Conventional Milling.

G-code is a family of control dialects

G-code is a family of control dialects

These pages describe common Fanuc-style milling usage, with turning differences called out. G- and M-code meanings vary by control, machine type, options and configuration. Check the machine's own manual before applying a code or example. These examples teach interpretation; they are not production programs.

PathPilot is Tormach's machine control. Tormach publishes PathPilot programming documentation and post-processor guidelines. Select documentation for the actual machine and software version. A general description does not establish its installed tools, options or setup.

Continue with CNC Program Structure and CNC Programming and Prove-Out. Use G-code and Toolpaths to explore a deliberately limited teaching interpreter.