Do CNC Machines Use Rotary Encoders?
Most CNC machines use rotary encoders to close the position loop on each axis and spindle. This page explains where the encoder sits, what signal the control reads, and which failure modes show up on the shop floor. Read it if you program, run, or maintain a CNC machine.

Do CNC machines use rotary encoders on every axis?
A rotary encoder turns shaft rotation into a digital pulse train the control can count. On a CNC machine, that shaft is usually the servo motor or the ball screw. The control compares counted pulses with the commanded position and corrects the difference in real time. That correction is the closed loop. Without it, the control only knows what it told the motor to do, not where the slide actually is.
The answer to do CNC machines use rotary encoders is not a flat yes. Machines with AC servo drives use them on every interpolated axis. Basic stepper machines do not, unless a retrofit added them. Some high-end machines use linear encoders on the slide instead, and a few use both. The distinction matters when you chase lost position or scrap parts after a warm-up.
Encoder resolution sets the smallest motion the drive can see. A 17-bit serial encoder resolves 131,072 counts per revolution. On a 10 mm pitch ball screw that is well under 1 μm of linear resolution before any scaling. The mechanical accuracy of the screw, thrust bearings, and thermal growth will limit the part long before the encoder does.
On spindles, the encoder serves a different job. It feeds speed feedback for constant surface speed and provides the index pulse used for rigid tapping and spindle orientation. Spindle encoders are often lower resolution than axis encoders because the control needs speed and phase, not fine linear position.
- 1Servo axisEncoder on the motor or screw closes the position loop.
- 2Stepper axisOpen loop by default; no encoder feedback unless retrofitted.
- 3SpindleEncoder gives speed and index pulses for tapping and orientation.
- 4Rotary tableA Ø400 mm table needs its own encoder to index accurately.
How the feedback loop closes on a machining center
The drive amplifier sends current to the servo motor. The motor turns, and the encoder on its rear shaft outputs A/B quadrature or a serial position word. The drive reads that signal, computes following error, and adjusts current thousands of times per second. The CNC then reads position from the drive over a fieldbus. Each layer adds a small update delay, which is why high-gain tuning can hum or oscillate.
Incremental encoders output two square waves 90 degrees out of phase plus a once-per-rev index. Direction comes from which channel leads. Absolute encoders report the full position at power-up, so the machine does not need a homing move after every restart. That is why an absolute machine can resume a job after a power cut without re-zeroing the fixture.
Linear encoders mount on the slide and read a scale, so they measure the table itself rather than the screw. They catch screw pitch error, thermal growth, and backlash that a motor-mounted encoder cannot see. The trade-off is cost, scale cleanliness, and a second feedback loop the drive must reconcile with the motor encoder.
For most 3-axis and 5-axis work, motor-mounted encoders plus ball screw mapping hold ±0.005 mm on parts within our 4,000 mm envelope. When a drawing calls for tighter position over long travels or over a wide temperature swing, linear scales earn their price.
- 1IncrementalA/B quadrature plus index; needs homing at power-up.
- 2AbsoluteFull position at power-up; no homing move required.
- 3Motor-mountedSees motor rotation, not slide position.
- 4Linear scaleSees slide position; catches screw and thermal error.
What fails first: encoder symptoms and their causes
Encoder faults usually show up as position drift, following-error alarms, or a spindle that will not orient. A dirty or scratched disc causes intermittent counts, so the axis jumps a few microns and then recovers. A loose coupling between motor shaft and encoder body causes a slow drift that grows with axis reversal. A failed channel kills one direction of travel outright.
Heat and vibration are the two most common killers. An encoder rated to 70 °C will drift when the motor housing runs hotter on a long roughing cycle. Vibration loosens the mounting screws or fatigues the cable at the connector. Both faults tend to appear after a warm-up, not at spindle start, which is why operators often blame the program first.
Contamination matters more on linear scales than on rotary encoders. A scale exposed to fine aluminum dust or coolant mist will lose counts until it is cleaned. Sealed scales with pressurized air purge cost more, but they survive in graphite and cast iron environments where an open scale will not last a month.
Diagnosis follows a simple order. Check the alarm code and the axis, then inspect the coupling and connector, then the cable, then the encoder itself. Swap the encoder to another axis only if the drive allows it. On most machines, a replacement encoder must be re-zeroed to the motor commutation, so budget a re-homing and test cut afterward.
- 1Intermittent jumpDirty disc or a connector with a bad pin.
- 2Slow driftLoose coupling or thermal growth in the screw.
- 3One-way faultA dead encoder channel; replace the unit.
- 4Orient failureSpindle encoder index lost or misaligned.
Encoder choice affects the parts you can hold
Feedback type sets the floor on part tolerance. A machine with motor-mounted encoders and good screw mapping holds ±0.005 mm on a 100 mm feature. Add linear scales and the same machine can hold that tolerance over a 1,000 mm part. Without them, screw growth over a long cut can eat most of the band.
Thermal behavior is the part most engineers miss. A ball screw grows about 11 μm per meter per degree Celsius in steel. Twenty degrees of warming on a 1 m axis moves the tool 0.22 mm. A linear scale sees that growth and corrects it. A motor encoder does not, because the screw turned exactly as commanded.
For 5-axis work, the rotary and tilt axes each carry their own encoder. Position error on a tilt axis is amplified by tool length. A 0.01 degree error on a 100 mm tool offset is about 17 μm at the tip. That is why simultaneous 5-axis finishing on our 16 five-axis centers depends on clean rotary feedback as much as on the spindle.
When you quote a job with a tight true-position callout, ask what feedback the machine has. Encoder type, scale resolution, and the calibration date tell you more about what the machine can hold than the brochure accuracy figure does.
- 1Short partMotor encoder is usually enough for ±0.005 mm.
- 2Long partLinear scales correct screw growth over meters.
- 35-axis tiltRotary encoder error is multiplied by tool length.
- 4Thermal driftSteel screws grow about 11 μm per meter per °C.
Rotary encoder vs linear scale vs open loop
Pick the feedback type that matches the tolerance band and the part length.
| Feedback type | What it measures | Typical use | Watch out for |
|---|---|---|---|
| Motor rotary encoder | Motor shaft rotation | Most 3-axis and 5-axis servo axes | Does not see screw growth or backlash |
| Screw-end rotary encoder | Ball screw rotation | Older mills and lathes | Coupling backlash adds to error |
| Linear scale | Slide position directly | Long axes and tight-tolerance work | Needs clean air and sealed mounting |
| Absolute encoder | Full position at power-up | Machines that must restart fast | Battery or capacitor backup ages |
| Open loop (stepper) | Nothing; counts commands | Light-duty routing and engraving | Lost steps go undetected |
When feedback type decides the job
For parts under 300 mm with a ±0.005 mm band, motor-mounted rotary encoders are enough. For long parts, wide temperature swings, or true-position callouts under 0.02 mm, insist on linear scales. If a shop cannot tell you which feedback its machines use, that is your answer on the tight-tolerance quote.
Rotary encoder questions from the shop floor
Do CNC machines use rotary encoders or linear encoders?
Most use rotary encoders on the servo motor, and some add linear scales on the slide. The two serve different jobs: the rotary encoder closes the velocity and commutation loop, while the linear scale closes the position loop at the table.
Machines with both reconcile the two signals in the drive. If they disagree beyond a set window, the control alarms out to protect the part.
Can you add encoders to a stepper CNC machine?
Yes, with a closed-loop stepper drive or a full servo retrofit. A closed-loop stepper reads an encoder on the motor shaft and faults if it falls behind, but it does not interpolate as smoothly as a servo under load.
For production work with tight tolerance, a servo retrofit is the better path. For hobby routing, closed-loop steppers stop the lost-step scrap without a full rebuild.
How often should encoders be checked?
Inspect couplings, connectors, and cable strain relief at each preventive maintenance interval. Check the scale or disc for contamination if the machine sits in a graphite or cast iron cell.
Replace an encoder when drift appears and cleaning does not fix it. Most encoder failures give warning through following-error alarms before they stop the machine.
Why does my machine drift after a warm-up?
The ball screw is growing as it warms, and a motor-mounted encoder cannot see that growth. The control believes the axis is on position because the motor turned the commanded amount.
Let the machine warm up with a spindle and axis cycle before the first finish pass, or use a machine with linear scales that correct the growth in real time.
Does encoder resolution set my part tolerance?
No. Resolution sets the smallest step the drive can command, but screw pitch error, thrust bearing play, thermal growth, and tool deflection usually set the part tolerance first.
A 17-bit encoder on a 10 mm screw resolves well under 1 μm, while the machine may still hold only ±0.005 mm on the part. Buy feedback for the error it corrects, not for the count.
Send us the drawing and the tolerance band
We machine prototypes and production runs on 127 CNC machines with closed-loop feedback on every axis. Upload a STEP file and get a quote plus DFM notes within 12 hours.
12-hour quote±0.005 mm100% inspectionNo minimum order