In the intricate ballet of industrial automation, precision is everything. Whether it is a robotic arm assembling a microchip or a heavy-duty CNC lathe carving aerospace components, the machine needs to know the exact position of its moving parts at all times. The unsung hero responsible for this critical data is the rotary encoder.
As we move through 2026, encoder technology has evolved, becoming more robust, precise, and integrated than ever before. Yet, the fundamental question remains for many engineers, students, and maintenance professionals: How does a rotary encoder actually work?
This guide serves as a comprehensive resource, dissecting the electromechanical principles behind these devices, comparing the different technologies (Optical, Magnetic, Capacitive), and explaining the critical difference between incremental and absolute feedback. If you are looking to troubleshoot a Fanuc encoder or select a replacement for a custom build, you are in the right place.
What is a Rotary Encoder?
At its core, a rotary encoder (often called a shaft encoder) is an electro-mechanical device that converts the angular position or motion of a shaft or axle into an analog or digital signal. Think of it as a translator.
The motor speaks in “torque and rotation,” while the control system (PLC or CNC controller) speaks in “binary code and pulses.” The encoder bridges this gap, providing the controller with three critical pieces of information:
- Position: The specific angle of the shaft.
- Speed: How fast the shaft is turning (Velocity).
- Direction: Clockwise or Counter-Clockwise rotation.

The Physics of Detection: Optical vs. Magnetic vs. Capacitive
While the output function is the same, the internal method of detection varies. In 2026, the two most dominant technologies in the CNC world are Optical and Magnetic.
1. Optical Encoders: The Standard for Precision
Optical encoders are the industry standard for high-precision applications. If you open up a high-end Fanuc servo motor, you are likely to find an optical system.
How it works:
The heart of an optical encoder is a glass or plastic disc mounted to the shaft. This disc is chemically etched with thousands of microscopic transparent and opaque lines (like the bars on a jail cell).
A light source (LED) sits on one side of the disc, and a photodetector sits on the other. As the disc spins, the opaque lines block the light, and the transparent lines let it through. The photodetector sees this as a rapid flickering of light, which it converts into electrical pulses.
- Pros: Extremely high resolution and accuracy.
- Cons: Susceptible to dust, oil, and vibration (glass discs can shatter).
2. Magnetic Encoders: The Rugged Alternative
Magnetic encoders operate on the Hall Effect principle. Instead of a slotted disc, a magnetized wheel spins over a sensor chip. As the magnetic poles (North and South) pass the sensor, the change in the magnetic field is detected and converted into digital data.
- Pros: Extremely durable; immune to dust, oil, and moisture.
- Cons: Generally lower resolution than optical counterparts, though the gap is closing in 2026.

The Great Divide: Incremental vs. Absolute Encoders
Understanding the difference between these two output types is the most critical part of selecting or troubleshooting a rotary encoder.
Incremental Encoders: Relative Position
An incremental encoder outputs a continuous stream of pulses as the shaft rotates. The controller counts these pulses to determine how far the shaft has moved.
The Catch: It is relative. If the power goes out, the controller “forgets” where the motor is. Upon restarting, the machine must perform a “Homing” sequence (moving to a limit switch) to re-establish a zero point.
Output Signals: They typically use Quadrature Output (Channels A and B). By offsetting these two signals by 90 electrical degrees, the controller can determine direction. If A leads B, it’s clockwise; if B leads A, it’s counter-clockwise.
Absolute Encoders: True Position
An absolute encoder assigns a unique digital code to every distinct angle of the shaft. It’s like a clock face; even if the lights go out, the hands are still pointing at 3:00. When power is restored to the Siemens controller, it immediately reads the code “3:00” and knows exactly where it is.
Types of Absolute Encoders:
- Single-Turn: Repeats the codes every 360 degrees.
- Multi-Turn: Tracks the position within 360 degrees and counts the total number of full revolutions. This is vital for linear axes (like a CNC X-axis) that spin the screw thousands of times.
Technical Comparison: Selecting the Right Technology
To help you visualize the differences, here is a breakdown of the three main encoder architectures found in modern automation.
| Feature | Incremental Optical | Absolute Optical | Magnetic (Hall Effect) |
|---|---|---|---|
| Output Signal | Pulse Stream (A/B/Z) | Binary / Gray Code / Serial | Analog or Digital PWM |
| Power Loss Memory | Position Lost (Requires Homing) | Position Retained | Depends on Electronics |
| Environment | Clean, controlled areas | Clean, controlled areas | Dirty, oily, high vibration |
| Wiring Complexity | Low (4-6 wires) | High (Parallel) or Low (Serial) | Low |
| Cost | Low to Medium | High | Medium |
The Role of Encoders in Modern CNC Systems
In a CNC machine, the encoder is the feedback loop. When a command is sent to a Mitsubishi servo motor to move 10mm, the drive powers the motor, but it is the encoder that confirms “We have moved 10mm, stop now.”
Commutation Channels
Modern servo motors, especially those from Fanuc and Yaskawa, use encoders not just for position, but for commutation. This means the encoder tells the drive exactly where the rotor magnets are aligned relative to the stator coils. This allows the Fanuc drive to inject current into the correct coil at the exact microsecond required for smooth rotation.
This is why you cannot simply swap a generic encoder onto a CNC servo motor. The alignment of the encoder (zero point) must match the physical alignment of the motor’s rotor poles. This process is known as “phasing” or “zeroing” the encoder.
Cabling and Signal Transmission
An encoder is only as good as its connection. The signals generated are high-frequency, low-voltage pulses (often 5V DC). This makes them incredibly susceptible to Electrical Noise (EMI).
When routing encoder cables, it is imperative to keep them separated from high-voltage power cables. Most industrial systems use “Differential Signaling” (sending a signal and its inverse, A and A-not) to filter out noise. If you are experiencing “jittery” axis movement or random position errors, checking the integrity of your cable shielding and the condition of the drive-side connector is the first step in troubleshooting.

Troubleshooting Common Encoder Issues
Even the most robust components fail. Here are the most common symptoms of encoder failure and how to address them.
1. Alarm: Pulse Coder Disconnect (Fanuc Alarm 300/400 range)
This usually indicates a broken wire or a loose connection. Check the continuity of the cable, specifically in the drag chain (cable track) where constant bending occurs. Also, inspect the engine-side socket for coolant ingress, which can short the 5V power pins.
2. Following Error / Drift
If the machine axis lags behind the commanded position, the encoder coupling might be loose. The encoder shaft is slipping relative to the motor shaft. Tighten the set screws or clamp.
3. Jitter or Vibration at Standstill
This is often a “gain” issue, but it can also be caused by a dirty optical disc. If oil mist has penetrated the Mitsubishi encoder housing, it can obscure the lines on the disc, confusing the photodetector.
Frequently Asked Questions (FAQ)
Q: Can I replace an incremental encoder with an absolute one?
A: Not directly. The control system and the servo drive must be programmed to expect absolute data. The wiring and communication protocols (e.g., SSI, EnDat, Fanuc Serial) are completely different.
Q: How do I clean a dirty optical encoder?
A: It is risky. Manufacturers assemble them in clean rooms. Opening the housing usually voids the warranty and introduces more dust. If an encoder is contaminated with oil, replacement is usually the only reliable option.
Q: What is “Gray Code” and why do encoders use it?
A: Gray Code is a binary numeral system where two successive values differ by only one bit. Encoders use it to prevent reading errors during transition. In standard binary, changing from 3 to 4 involves changing three bits simultaneously, which can cause glitches if they don’t switch at the exact same nanosecond.
Q: My Fanuc machine lost its absolute position after battery failure. What now?
A: Absolute encoders rely on a battery backup to remember position when the machine is off. If the battery dies, you must replace the battery and perform a “Zero Return” or “Mastering” procedure to teach the machine its home position again.
Manual Pulse Generators (MPGs)
It is worth noting that not all encoders are inside motors. The MPG handwheel used by operators to manually jog the machine axis is also a rotary encoder. It is almost always a simple incremental optical encoder. When you turn the dial, it sends pulses to the controller to move the axis by a set increment (e.g., x1, x10, x100 microns).
Conclusion
The rotary encoder is a marvel of modern engineering, bridging the gap between physical motion and digital control. Whether you are dealing with the rugged simplicity of a magnetic sensor or the high-fidelity precision of a glass-disc optical unit, understanding how they work is key to maintaining efficient automation.
As we navigate the complexities of 2026’s industrial landscape, ensuring you have the right feedback devices—and keeping them well-maintained—is essential for minimizing downtime.
Diagnosing an Encoder Fault?
Don’t let a “Pulse Coder Invalid” alarm stop your shop floor. 24CNC stocks a vast range of replacement encoders for Fanuc, Mitsubishi, Siemens, and more, ready for immediate shipping.
Leave a comment
Your email address will not be published. Required fields are marked *