Encoder is the name of a piece that gives you a pulse at the output by rotating its shaft. More fully, an encoder is a sensor that is attached to the axis of a gear or motor and can measure the amount of rotation, and by measuring the amount of rotation, you can determine the "speed", acceleration, or angle of rotation.
Encoder is a very useful and important part of the industry, which is placed in the category of feedback sensors. It means an encoder that encodes the coordinates of the rotary or linear screen and sends it electrically to the corresponding controller. Encoder is used in various industries to get position feedback from the environment and it can be used to create a closed-loop system.

Encoders are usually optical and an infrared transmitter and receiver are placed on both sides of a rotating mechanical object (grooved disc) and produce electrical pulses.
Important criteria for encoder selection
output
Desired Resolution (CPR)
Noise and cable length
Index channel
Encoder types
Encoders are divided into different categories in terms of appearance, signal output type, function type, and internal structure:
Types of encoders in terms of performance and appearance
Rotary encoder:
A rotary encoder, also known as a shaft encoder, is actually an electromechanical device that converts the position or angular movement of a shaft or an axis into an analog or digital code. This type of encoder usually uses one or two pairs of transmitter and receiver LEDs and a graduated disc (black and white or blank and full).
The calibrated disc is located between the transmitter and receiver sensors and this set is located on the rotating axis of the device. When the shaft rotates, the graduated disk rotates with the shaft, and the transmitter and receiver sensors remain fixed. In this way, the signal that is sent from the transmitter to the receiver is cut off and connected successively by the rotation of the disc. In this way, we will have a train of consecutive logical zero and one pulse at the output of the receiver.

These pulses are the same codes that the encoder produces and in order to be converted into the position or the number of shaft revolutions, they are given to the input of a decoder and according to the program given to the decoder, these pulses are converted into position. The more black and white dots on the graduated disk, the more logical zeros and ones in a 360-degree cycle, and thus the measurement accuracy. Rotary encoders are divided into two categories, shaft and hollow shaft, whose output can be found in the market in the form of sockets and cables.
Linear encoder:
As its name suggests, this type of encoder is used to measure linear movement. In terms of construction, it is made in optical, magnetic, and resistance types. The optical model linear encoder has a digital output and the magnetic and resistive model linear encoder has an analog output. These encoders are used for automation circuits in devices such as presses to measure the longitudinal movement of jack pistons and rollers to measure the longitudinal distance between roller hubs.

Encoder types in terms of signal output type and function type
Incremental encoder:
Incremental signals do not represent a specific position and only represent a change in position. As long as the encoder is moving, we have pulses and signals in the output, and to measure the speed and position, the number of these pulses must be counted in the controller, but if the controller is reset (its power is cut off and turned on again), the encoder's previous position He forgets and needs to get new information again by counting encoder pulses. One of the disadvantages of incremental encoders is that it is impossible to understand the previous and real position of the encoder, which has made this model of encoders cheaper. These encoders are mostly used in elevators, motors, gearboxes, and industries. The accuracy of these encoders is a pulse.
Absolute encoder:
Absolute encoders mean that at any point and position, the signal it sends to the controller at the output represents the same place. In fact, absolute encoders have a unique number for each angle of the encoder, which pulses when placed at that point. And its code appears in the output. These encoders are more expensive than incremental encoders because they do not need to be re-aligned, and the position of the encoder shaft is not forgotten after resetting the controller every time.
Encoder types in terms of encoder function
Relative encoder:
In this way, an infrared receiver and transmitter are placed on both sides of the slotted wheel. In this type of encoder, only the relative position of the rotating object is measured compared to the initial position, and the direction of rotation cannot be determined. It should be noted that the higher the number of grooves, the higher the accuracy of the encoder.
Incremental encoder:
In this type of encoder, two infrared transmitters and receivers are used on both sides of the grooved wheel with a certain distance, so when the wheel rotates, we have two output pulses that have a phase difference from each other, and based on that, the direction of rotation can also be determined. For example, if this encoder is used in a robot and the power is cut off for a moment, after reconnecting the power, the robot must start again from the zero point.
Encoder types in terms of the internal structure of the encoder
Encoders use a variety of technologies to generate signals, including mechanical, magnetic, resistive, and optical, which are the most common technologies.
Optical: Optical encoders are the most accurate type of encoders. When we choose an optical encoder. It is very important that said encoder has additional protections to prevent contamination from dust, vibration, and other common industrial conditions.
Magnetic: Although magnetic encoders are more resistant than optical encoders and are often used in environments exposed to pollution, steam, vibration, and other types of environmental interference, the resolution or accuracy of optical encoders is higher.
Capacitive: Compared to the previous two models, capacitive encoders are new arrivals in the world of industry. Capacitive encoders are similar to magnetic models in terms of strength, but the resolving power of optical encoders is higher than capacitive encoders. Of course, regardless of the type of technology used, capacitive encoders have the ability to detect movement and convert it into standard signals common in the industry.
Wheeled encoders: Wheeled encoders, known by other names such as carriage encoders and wheel encoders, can have one or two wheels depending on where they are used. The application of these encoders is to measure the length or speed of a continuously moving target. For example, these encoders measure the length of materials such as paper, cloth, plastic, etc. in environments such as production lines.
Application of encoders
Encoders are usually installed in automation and control systems in a part that can send feedback to the controller and specify the following parameters:
Speed Measurement
Position Measurement
Angle Measurement (Angel Measurement)

Measuring the direction of shaft movement (Direction Detection)
Counts
CNC machines
Printing machines
In all types of electric motors such as servo motors and step motors
Elevator
Industrial robots
Packaging machines
Steel factories
Textile machines
Wood-cutting machines and CNC
Ceramic tile production machines
Cement factories