1. Basics of Encoder

Encoder is a kind of electromechanical equipment, which can be used to measure the movement of machinery or the target position of machinery. Most encoders use optical sensors to provide electrical signals in the form of pulse sequences, which can be converted into motion, direction or position information in turn.

1.1 Encoder Types

Classification Mode



Mechanical Movement Mode

Rotary Encoder

Linear Encoder


Read-out Mode

Contact Encoder

Non Contact Encoder


Principle of Operation

Incremental Encoder

Absolute Encoder

Table 1: Different types of encoders classified by different movement, read, and work principle.

1.2 Rotary Encoder vs. Linear Encoder

Rotary encoder can convert the rotation position or rotation amount into analog (such as analog quadrature signal) or digital (such as USB, 32-bit parallel signal or digital quadrature signal) electronic signal, which is generally installed on the rotating object, such as motor shaft.

Rotary encoder is a device that converts the shaft, or the angular position or movement of the shaft into analog code or digital code.

There are two types of rotary encoders as shown in the table below.

Types of Rotary Encoder





Absolute Rotary Encoder

* The absolute rotary encoder outputs a digital code corresponding to the rotation angle.

* There is no need to calculate pulses to know the position of the motor shaft. You only need to read the digital output of the encoder.




Incremental Rotary Encoder

* Incremental rotary encoders only output pulses when the motor is rotating.

* To use an incremental encoder to determine the axis position, you must know the starting position and use an external circuit to calculate the number of output pulses.

Table 2: Rotary encoders are divided into absolute encoders and incremental encoders.

The rotary encoder can be used to measure the rotational motion of the shaft. The figure below shows the basic components of the rotary encoder, including a light emitting diode (LED), a code disk and a light sensor on the back of the code disk.

The code disk is arranged on the rotating shaft, and the sector areas of opaque and transparent are arranged on the code disk according to a certain coding form. When the code disk rotates, the opaque sector can block light, while the transparent sector allows light to pass through. In this way, a square wave pulse is generated, which can be compiled into the corresponding position or motion information.

sketch of the structure of a rotary encoder

Figure 1: Rotary encoder is composed of light sensor, shaft, floating disk and code track.

A linear encoder is a sensor, transducer or reading-head linked to a scale that encodes position. The sensor reads the scale and converts position into an analog or digital signal that is transformed into a digital readout. Movement is determined from changes in position with time.

The encoder is usually divided into 100 to 6000 sectors per revolution. This shows that the 100 sector encoder can provide 3.6 degrees of accuracy, while the 6000 sector encoder can provide 0.06 degrees of accuracy.

2. Orthogonal Coding

2.1 Quadrature Output of Incremental Transmitter

Orthogonal coding is an incremental signal.

Here we can talk a little about what the incremental signal is.

Two kinds of square wave outputs A and B can be produced after the incremental encoder is rotated. These signals constitute the quadrature output of the incremental encoder.

For most encoders, these square waves A and B are out of phase by 90 degrees. By observing the changing state of a and B output, the direction of encoder can be determined. There are two channels: channel A and channel B.

waveforms of quadrature output

Figure 2: Sketch of the quadrature output of incremental encoder.

When the reader of channel a passes through the bright area on the encoder disk, it will generate square wave pulse on channel a. If the area on the encoder wheel or reader is slightly offset, the reader in channel B will detect pattern 90 °。

By reading the number of pulses and which channel is ahead of the other (called "preamble"), the encoder interface can determine how far the encoder has rotated and in which direction. Some encoders also have a third channel called index channel, which sends a pulse every time it completes a rotation.

This allows the encoder to know its actual position rather than its relative position without too much extra cost. You can check the data table of the encoder to see if it has an index channel. As shown in Figure 3, it is a typical encoder square wave output.

square wave output of encoder

Figure 3: Square wave output of typical encoder.

2.2 Resolution of Encoder

However, more information is needed to determine the travel distance or rotation speed of the encoder. To calculate this information, it is necessary to know the resolution of the encoder. You can imagine the resolution as the encoder granularity, or simply, how many blocks the encoder "pie" can be divided into per revolution.

Pulses Per Revolution (PPR)

The term PPR denotes the resolution of the encoder. PPR describes the number of high pulses appearing on the square wave output a or B of the encoder per revolution.

Once the resolution is known, it can be used to calculate the geometric angle of each pulse and period. As shown in Figure 4.

resolution calculation of encoder

Figure 4: Calculate encoder resolution in 360°

2.3 Coding Type

There are three basic coding types: X1, X2 and X4.

X1 Coding

As shown in Figure 5, it shows the number of addition and subtraction of count value under an orthogonal period and its corresponding X1 encoding type. When channel a guides channel B, the increment occurs on the rising edge of channel A. When channel B guides channel A, decrement occurs on the falling edge of channel A.

X1 coding of encoder

Figure 5: Waveforms of X1 encoding.

X2 Coding

X2 encoding is similar to the above process, except that whether the counter counts at each edge of channel a increase or decrease depends on which channel guides which channel. The value of the counter will increase or decrease by 2 in each cycle, as shown in Figure 6.

X2 coding of encoder

Figure 6: Waveforms of X2 encoding.

X4 Coding

By X4 encoding, the counter also increases or decreases on each edge of channels A and B. Whether the number of counters increases or decreases depends on which channel guides which channel. The number of counters increases or decreases by 4 in each cycle, as shown in Figure 7.

X4 coding of encoder

Figure 7: Waveforms of X4 encoding of encoder.

2.5 Count Per Revolution (CPR)

CPR most often represents counts per revolution and refers to the number of quadrature decoded states that exist between the outputs A and B. When A and B outputs are switched between high level and low level, two bits of information will appear, indicating four different states. The term orthogonal decoding describes A method of counting each state change using outputs A and B simultaneously. Using both A and B counts results in four times the number of counts per pulse or cycle. Therefore, the CPR of the encoder is the PPR of the encoder multiplied by 4.

Also note that some encoder manufacturers use the abbreviation CPR to denote cycles per revolution (cycles per revolution). The number of cycles per revolution represents the complete electrical cycle or time of any encoder output, and this value is equal to the number of pulses per revolution. Since the same abbreviation CPR is used for count per revolution and cycles per revolution, it is necessary to understand the definition of resolution carefully.

Figure 8 shows the waveform of common products.

Product waveform

Figure 8: Waveforms of common encoders.


The relationship between encoder CPR frequency and motor speed (RPM) is given by the following formula:
F = (cycle / revolution) * (revolution / second) / 1000 = kHz
Speed = revolutions per minute
CPR = cycles per revolution

Distance conversion:
(PPR) / (2 * pi * axis radius) = pulses per inch
(pulses per inch ^ - 1 = inches per pulse)

Purchase Quality Encoders on OKmarts

buy LS Mecapion encoder, KOYO encoder, Autonics encoder, LIKA encoder, Baumer encoder on okmarts

Related Info

Factors to Consider When Selecting Rotary Encoders

How to Use a Rotary Encoder

Maintenance of Absolute Encoders

When You Should Use an Absolute Encoder - Pros and Cons of Different Absolute Encoders

How to Install Encoders - Best Practices