GreatLight CNC Machining Factory logo
CNC Machining
Rapid Prototyping
Materials
Industries
News
About GL

Get Instant Quote

CNC feedback basics

What Is an Encoder in CNC Machine Feedback?

An encoder in a CNC machine converts shaft rotation or linear travel into an electrical signal the controller can count. This page explains how incremental and absolute encoders work, what resolution really means, and which machining jobs expose a weak feedback loop.

Incremental vs absoluteResolution vs accuracyClosed-loop basics
Encoder in CNC machine as a precision feedback tool
Definition

What an encoder in CNC machine control actually does

An encoder is a sensor that reports motion. On a CNC machine it is bolted to a motor shaft, a ball screw end, or a linear scale rail. As that shaft turns or that rail slides, the encoder sends a stream of pulses back to the drive or control. The control compares the commanded position with the reported position and corrects the difference. That comparison is the whole point.

The controller issues a move, for example 100.000 mm on X. Without feedback, the machine assumes the motor did what it was told. With feedback, the control knows the axis reached 99.987 mm and can command the remaining 0.013 mm. No feedback, no correction.

This is why the term closed loop matters. An open-loop machine counts motor steps and hopes for the best. A closed-loop machine measures and adjusts. The encoder in a CNC machine is the measuring half of that loop, and it runs thousands of times per second during a cut.

Where does the signal go? Usually to the servo drive first, then to the CNC. The drive closes a tight velocity loop, the CNC closes the wider position loop. Two loops, one sensor. If the sensor lies, both loops chase a false number and the part comes out wrong.

Mechanism

How the pulse train becomes a position number

Most rotary encoders use a disc with fine radial lines and an optical emitter-detector pair. Light passes through the lines and is chopped into pulses. A photodetector converts that flicker into a square wave. Count the pulses and you have counted the rotation.

Two channels, A and B, sit 90 degrees out of phase. That phase offset is not decoration. When A leads B, the shaft turns one way. When B leads A, it turns the other way. Direction comes free with the same two wires.

A third channel, Z or index, fires once per revolution. It gives an absolute reference point so the control can find home after power-up. Without Z, the control would only know how far it moved, never where it started.

Resolution is the angle or distance represented by one pulse. A 10,000 line encoder on a 10 mm pitch ball screw gives roughly 0.001 mm per count before quadrature. Quadrature reads all four edges of the A/B pair, so the effective count quadruples. Finer counts help, but they do not fix a loose coupling or a bent screw.

Types

Incremental, absolute, and linear encoders

Incremental encoders report change, not location. Power down and the count is gone. On restart the machine must home to a reference, which costs time and depends on a switch or a Z pulse being reliable. They are cheap, fast, and everywhere on older mills.

Absolute encoders report a unique code for every shaft position. The control knows the axis location the moment power returns. No homing, no lost position after an e-stop, no scrapped part because someone jogged the axis while the control was off. Absolute feedback costs more and needs a serial protocol, not just two wires.

Linear encoders mount on the machine structure and read a scale instead of a shaft. They measure the table itself, so they see screw pitch error, thermal growth, and backlash. Rotary feedback cannot see those errors because it watches the motor, not the part.

The practical split: rotary for general milling and turning, linear on jobs where the tolerance is tight and the part is long. A 4,000 mm part with a ±0.005 mm callout is a linear scale job. A bracket with a ±0.05 mm callout is not.

Boundaries

What encoders cannot fix

An encoder measures position. It does not measure cutting force, tool wear, or thermal drift in the spindle. If the tool pushes off by 0.02 mm under load, the encoder still reports that the axis is exactly where it was told to be. The error lives in the structure, not the loop.

Resolution is not accuracy. A scale that counts to 0.0001 mm can still sit 0.01 mm off if it is mounted on a machine that flexes. Buyers often read the resolution number and stop there. That number describes the smallest step the control can see, not the largest error the machine can produce.

Encoder failure modes are usually mechanical or environmental. Contaminated optics from coolant mist, a loose coupling, a cracked glass disc after a crash, a cable shield that picks up drive noise. Symptoms show up as drift, following error alarms, or a surface finish that changes mid-cut.

When a machine holds ±0.005 mm all day, the encoder is one link in a chain that also includes the screw, the bearings, the spindle, and the room temperature. Fixing the feedback alone rarely fixes the part.

Shop practice

Matching feedback to the parts you quote

Start from the tolerance, not the encoder spec sheet. A part held to ±0.05 mm on a 200 mm aluminum bracket does not need linear scales. Rotary feedback on a good ball screw is enough, and it is faster to set up.

Move to linear scales when the part is long, when the tolerance is under about ±0.01 mm, or when the material cuts hot. Aluminum engine blocks and long titanium ribs both fall into that zone. So do parts that get measured in a temperature-controlled room after machining.

Absolute feedback pays off on unattended or lights-out runs. If a machine sits idle overnight and restarts without homing, a crash from a lost position disappears. For high-mix shops running 24 hours, that alone can justify the cost.

Ask what the machine will be asked to do in three years. Feedback upgrades are possible but rarely cheap. Buying the right loop at the start costs less than adding scales to a machine that was never prepared for them.

Failure

Symptoms that point at the feedback loop

Following error alarms during acceleration usually mean the loop cannot keep up. Check the coupling first, then the cable shield, then the drive tuning. A loose coupling shows up as a small oscillation that grows with speed.

Drift that appears after two hours of cutting is often thermal, not electrical. The encoder is reporting correctly; the screw has grown. Linear scales on the table would catch that, rotary feedback on the motor end cannot.

A single axis that finishes rough while its neighbors cut clean is a strong clue. Swap the encoder cable if the machine allows it. If the problem follows the cable, you found it. If it follows the axis, look at the mechanics.

Repeatability checks with a dial indicator still matter. Command a move, measure the result, repeat ten times. If the spread is wider than the spec, the loop, the screw, or the thrust bearing is the suspect, in that order.

Selection

Encoder type compared by job requirement

Pick the feedback that matches the error you need to catch.

TypeReportsBest forWeak point
Incremental rotaryChange in positionGeneral milling and turningNeeds homing after power-up
Absolute rotaryUnique position codeE-stop recovery, unattended runsHigher cost, serial wiring
Linear scaleTable position directlyLong parts, tight tolerancesMounting and cleanliness
MagneticChange or absolute positionDirty shops, washdownLower resolution than optical

When to specify which feedback

Choose rotary incremental feedback for general milling and turning where tolerances sit near ±0.05 mm. Choose absolute feedback when the machine restarts unattended and lost position means scrap. Choose linear scales when the part is long, the tolerance is tight, or the material runs hot.

FAQs

Encoder in CNC machine questions

Does every CNC machine have an encoder?

Any machine with a servo axis has some form of feedback. That includes most mills, lathes, and routers built in the last thirty years.

Open-loop machines, such as small stepper-driven routers, may have no encoder at all. They count steps and assume the motion happened.

Is a higher count encoder always better?

No. A finer count lets the control see smaller steps, but it does not remove backlash, screw pitch error, or structural flex.

A 0.0001 mm count on a machine that flexes 0.01 mm under load is a precise measurement of a moving target.

Why do some machines need homing after power-up?

Incremental encoders only report change. When power is removed, the count is lost, so the control must drive to a known reference before it can trust any position.

Absolute encoders keep their position through a power cycle and skip that step.

Can an encoder cause a bad surface finish?

Yes, if the feedback signal is noisy or intermittent. The control then commands small corrections that were never needed, and the tool leaves marks.

Check the cable routing and shield before replacing the encoder itself.

Do linear scales replace rotary encoders?

On many machines both are fitted. The rotary encoder drives the velocity loop at the motor, while the linear scale closes the position loop on the table.

Running both gives fast response and true table position.

What kills an encoder first?

Coolant mist and chips reach the optical disc, or a crash cracks it. Cable damage at the moving end is the other common cause.

Sealed housings and proper cable management extend life more than any spec upgrade.

Send your drawings, get a manufacturability read

We machine prototypes and production parts to ±0.005 mm with 100% inspection before shipment. Send a file and we return a quote with DFM notes within 12 hours.

12-hour quote100% inspectionNo minimum order quantity

Follow

More from the shop floor

We publish setup notes, tooling trials and inspection data from the factory floor.

FacebookTikTokYouTubeLinkedInInstagramThreadsPinterest

Trusted by engineers and manufacturers worldwide

Tesla Ford Motor Company BYD Auto Denso Magna International Boeing Airbus Medtronic KUKA FANUC