Industrial Rotary Encoder Guide: Working Principles, Types, Wiring and PLC Applications


Release date:

Nov 27,2026

Learn how industrial rotary encoders work, compare incremental and absolute encoders, understand A/B/Z phase signals, PNP/NPN outputs, and PLC wiring for reliable motion control applications.

How does a PLC know how far a servo motor has rotated? How can a motion controller determine whether a motor is rotating clockwise or counterclockwise?

The answer is the rotary encoder.

Rotary encoders are essential feedback devices in industrial automation, conveyor systems, AGVs, AMRs, and servo-driven equipment. They convert mechanical rotation into electrical signals that can be processed by PLCs and motion controllers.

However, encoder selection and installation can present several challenges. Incorrect PNP/NPN matching, reversed A/B phase wiring, or an unsuitable resolution can lead to incorrect counting, position errors, and even unexpected machine movement.

In this guide, Plutools explains the working principles of industrial rotary encoders, the differences between incremental and absolute encoders, common output types, A/B/Z phase signals, and practical PLC wiring considerations.

1. What Is a Rotary Encoder?

 

A rotary encoder is an electromechanical sensing device that converts the angular position or rotational movement of a shaft into electrical signals.

In simple terms, it acts as a bridge between mechanical motion and a control system. When a motor or shaft rotates, the encoder generates signals that a PLC or controller can interpret to determine position, speed, and direction.

A typical optical rotary encoder consists of four main components:

Light Source: Generates the optical signal.

Code Disc: Rotates with the shaft and contains patterned transparent and opaque sections.

Photoelectric Sensor: Detects changes in light as the disc rotates.

Signal Processing Circuit: Converts the detected signals into electrical outputs.

Encoders can generally be classified into rotary encoders and linear encoders.

Rotary encoders measure angular displacement and rotational speed, while linear encoders measure straight-line displacement.

1.1 Incremental Encoder

An incremental encoder generates periodic electrical pulses as its shaft rotates. A PLC or controller counts these pulses to calculate rotational movement, speed, and displacement.

Key characteristics include:

Generates periodic pulse signals, typically through A and B channels.

Uses pulse counting to determine displacement.

Uses the phase relationship between A and B signals to determine rotation direction.

Does not retain absolute position information after power loss.

Incremental encoders are widely used because of their relatively simple construction and cost-effective design.

Typical applications include conveyor systems, AGV drive wheels, servo motors, and general industrial automation equipment.

1.2 Absolute Encoder

An absolute encoder assigns a unique digital code to each measurable shaft position.

Instead of calculating position by accumulating pulses, the controller reads the encoder's digital output to obtain the current position directly.

Key characteristics include:

Provides direct position information.

Typically retains position information after power loss.

Does not require pulse accumulation to determine the current position after restart.

Available in single-turn and multi-turn configurations.

A single-turn absolute encoder measures position within one revolution, while a multi-turn absolute encoder can also record the number of revolutions.

The actual position-retention capability depends on the encoder's design and specifications.

1.3 Incremental vs. Absolute Encoder: Key Differences

ComparisonIncremental EncoderAbsolute Encoder
OutputPeriodic pulse signalsDigital position code
Position calculationPulse accumulationDirect position reading
Position retentionNo absolute position memoryTypically retains position
After power-upUsually requires homingUsually does not require pulse-based homing
CostGenerally lowerGenerally higher
Typical applicationsConveyors, speed measurement, general positioningPrecision positioning and applications requiring position retention

Which type should you choose?

An incremental encoder is usually a cost-effective option when the application only requires speed measurement, incremental displacement, or a homing operation at startup.

An absolute encoder is more suitable when the system needs to retain position information after power loss or minimize the need for repeated homing.

For AGV and AMR drive systems, encoder selection should also consider the navigation method, motor controller interface, and overall positioning architecture.

2. How Does an Incremental Encoder Work?

增量型编码器码盘结构

The operating principle of an incremental encoder is based on pulse counting.

As the encoder shaft rotates, its internal code disc moves with it. The photoelectric sensing system generates a series of electrical pulses, which are read by a PLC or motion controller.

By counting these pulses through a High-Speed Counter (HSC), the controller can calculate shaft displacement and rotational speed.

2.1 Why Does an Incremental Encoder Need Homing?

推挽输出与集电极开路输出电路

An incremental encoder does not store absolute position information.

For example, an encoder generating 1,000 pulses per revolution allows a controller to determine that the shaft has rotated half a revolution after counting 500 pulses.

However, if the machine loses power and the shaft moves during the shutdown period, the PLC cannot determine the actual absolute shaft position simply by reading the incremental pulse count.

This is why many industrial machines use a reference point or homing procedure.

When the machine starts, a home sensor or the encoder's Z-phase index signal can be used to establish a reference position. The controller then resets the counter or assigns a predefined position value.

For equipment requiring repeatable positioning, a reliable homing procedure is essential.

2.2 Encoder Resolution: PPR and Quadrature Multiplication

Encoder resolution is commonly specified in PPR (Pulses Per Revolution) or CPR (Counts Per Revolution). The exact definition should always be checked in the manufacturer's datasheet.

For example, an incremental encoder generating 1,000 pulses per revolution can provide different counting resolutions depending on the controller's counting mode.

The A and B channels have a 90-degree phase difference. This allows the controller to use quadrature decoding:

1X Counting: Counts one edge of the A channel.

2X Counting: Counts both rising and falling edges of the A channel.

4X Counting: Counts all rising and falling edges of both A and B channels.

For a 1,000 PPR encoder, 4X decoding provides 4,000 counts per revolution.

The theoretical angular resolution is:

Angular Resolution = 360° ÷ Counts Per Revolution

Therefore, a 4,000 CPR configuration provides a theoretical counting resolution of 0.09°.

However, counting resolution is not the same as actual positioning accuracy. Mechanical backlash, installation tolerances, signal quality, and controller performance can all affect the final positioning result.

3. Rotary Encoder Output Types: PNP, NPN and Push-Pull

编码器在输送带上的应用示意

Encoder output type is another important factor when selecting an industrial rotary encoder.

Common output configurations include NPN open collector, PNP open collector, and Push-Pull.

3.1 NPN Open Collector Output

An NPN open collector encoder uses an internal NPN transistor to pull the output signal toward 0V when activated.

Key characteristics:

The output is pulled low when the internal transistor conducts.

An external pull-up resistor or compatible input circuit is generally required.

The output must be matched with the PLC input circuit.

3.2 PNP Open Collector Output

A PNP open collector encoder uses an internal PNP transistor to connect the output signal to the positive supply voltage.

Key characteristics:

The output switches high when the internal transistor conducts.

It is commonly used with compatible sourcing-type PLC input circuits.

The PLC input voltage and current requirements must be checked.

3.3 Push-Pull Output

A Push-Pull encoder actively drives both high and low output states.

Key characteristics:

Actively provides high and low voltage levels.

Generally does not require an external pull-up resistor.

Suitable for higher-frequency pulse transmission.

Requires voltage and current compatibility with the receiving device.

3.4 PNP vs. NPN vs. Push-Pull

ComparisonNPN Open CollectorPNP Open CollectorPush-Pull
Output behaviorPulls signal toward 0VDrives signal toward positive supplyActively drives high and low
External pull-upGenerally requiredGenerally not requiredGenerally not required
PLC compatibilityRequires compatible input circuitRequires compatible input circuitRequires compatible voltage and input circuit
Typical applicationsIndustrial sensors and encodersIndustrial automationHigher-frequency pulse transmission

Important: PLC compatibility

For Siemens S7-1200 and S7-1500 systems, many standard 24V DC digital input modules use sourcing-type input configurations and are commonly paired with PNP output devices.

However, input configurations vary depending on the CPU and digital input module. It is not correct to assume that every Siemens PLC can only work with PNP encoders.

If an NPN encoder is used, check whether the PLC input module supports the required sinking-type configuration. A signal converter or dedicated interface module may be necessary.

Plutools recommends checking the PLC input configuration, encoder output type, operating voltage, pulse frequency, and cable distance before purchasing an encoder.

4. A/B/Z Phase Signals: How Does a PLC Detect Rotation Direction?

Incremental rotary encoders commonly provide three output signals: A, B, and Z.

The A and B channels have an approximately 90-degree phase difference. This phase relationship allows the controller to determine the direction of rotation.

4.1 A/B Phase Relationship

During forward rotation, the A channel may lead the B channel by 90 degrees.

During reverse rotation, the B channel leads the A channel by 90 degrees.

By monitoring the sequence of the two signals, the PLC can determine whether the shaft is rotating forward or backward.

If the A and B signal connections are reversed, the controller may interpret the rotation direction incorrectly.

Therefore, always follow the encoder wiring diagram when connecting the A and B channels.

4.2 What Is the Z-Phase Signal?

The Z-phase signal is also known as the index pulse.

It typically generates one reference pulse per revolution and can be used for:

Establishing a single-turn reference position.

Supporting machine homing procedures.

Calibrating incremental pulse counts.

Identifying a reference position on the rotating shaft.

The Z signal provides a reference point; it does not give an incremental encoder absolute position memory.

5. Rotary Encoder Wiring: E6B2-CWZ5B Example

Let's use the E6B2-CWZ5B as an example.

This encoder configuration is commonly specified with a PNP open collector output and a DC12–24V power supply.

The typical wire color assignments are as follows:

Wire ColorTerminal / SignalFunction
Brown+VccPositive supply, DC12–24V
BlueGND (0V)Power ground
BlackPhase AA-channel pulse output
WhitePhase BB-channel pulse output
OrangePhase ZIndex pulse output
ShieldShield GroundHelps reduce electrical interference

Important: These are typical wiring assignments for the specified configuration. Always verify the exact model suffix, product label, and manufacturer's datasheet before installation. Different E6B2 series versions may have different output circuits and wiring definitions.

E6B2 编码器线色与输出对应

5.1 Important Encoder Wiring Considerations

1. Check the supply voltage

Confirm the encoder's rated operating voltage before connecting the power supply. Incorrect voltage can damage the internal electronics.

2. Match the output type with the PLC

PNP, NPN, and Push-Pull outputs should not be interchanged without checking the electrical specifications and PLC input configuration.

3. Do not reverse the A/B channels

Reversing the A and B signals can cause incorrect rotation direction detection and position counting errors.

4. Use proper cable shielding and grounding

Encoder signals can be affected by electromagnetic interference from motors, inverters, solenoid valves, and other electrical equipment.

Use shielded cables and follow the system's EMC grounding requirements. Single-ended shield grounding at the control cabinet is a common approach, but the final grounding method should follow the overall system design.

5. Check the PLC high-speed counting capability

The encoder's output frequency must remain within the supported frequency range of the PLC's High-Speed Counter (HSC) or dedicated interface module.

Standard digital inputs may not reliably process high-frequency encoder pulses.

6. Common Rotary Encoder Selection and Installation Mistakes

In industrial automation and AGV/AMR drive applications, the following issues should be carefully considered.

1. Selecting the wrong encoder type

Choose an absolute encoder when the application requires position retention after power loss. An incremental encoder is suitable for applications involving speed measurement, incremental movement, or repeatable homing.

2. Forgetting the homing procedure

Incremental encoders do not retain absolute position. If the shaft moves while power is off, the machine must re-establish its reference position after startup.

3. Mismatching PNP/NPN outputs and PLC inputs

Check whether the PLC input module supports the encoder's output configuration before purchasing.

4. Reversing A/B signal connections

The phase sequence determines rotation direction. Reversed connections can cause incorrect direction detection.

5. Choosing an unsuitable encoder resolution

Insufficient resolution may not meet positioning requirements, while excessively high resolution may exceed the PLC's counting capability. Calculate the required resolution and maximum pulse frequency before selection.

6. Ignoring electromagnetic interference

Motor drives, inverters, and high-power electrical equipment can interfere with encoder signals. Proper cable routing, shielding, and grounding are essential.

7. Overlooking controller interface compatibility

In addition to output type, verify supply voltage, signal frequency, electrical specifications, and supported communication interfaces.

7. Conclusion: Choosing the Right Rotary Encoder for Reliable Motion Control

 

Although a rotary encoder is a relatively small component, it plays an important role in industrial automation by providing speed feedback, position measurement, and motion control signals.

From choosing between incremental and absolute encoders to matching PNP/NPN outputs, interpreting A/B/Z phase signals, and configuring PLC high-speed counters, every detail contributes to the reliability of the overall system.

For AGV, AMR, and other mobile robot applications, proper encoder selection and feedback configuration are also important for achieving stable drive performance and accurate motion control.

Plutools specializes in AGV/AMR drive wheels, servo motors, servo drives, and motion control products, providing drive components and customized solutions for mobile robots and industrial automation equipment.

Looking for reliable drive components or motion control solutions for your AGV, AMR, or industrial automation project? Contact Plutools to discuss your application requirements and explore our product range.