Working principle: When the shaft of the photoelectric encoder rotates, both lines A and B generate pulse outputs. The A and B phase pulses differ by a 90-degree phase angle, thus allowing the measurement of the photoelectric encoder's rotation direction and the motor speed. If the A phase pulse leads the B phase pulse, the photoelectric encoder is rotating forward; otherwise, it is rotating in reverse. The Z line is the zero-pulse line, generating one pulse per revolution of the photoelectric encoder. It is mainly used for counting. Line A is used to measure the number of pulses, and line B, in conjunction with line A, can measure the rotation direction.
N is the motor speed.
Δn = ND_measure - ND_theory
For example: Our car's speed is 1.5 m/s, the wheel diameter is 220 mm, C = D * Pi, the motor speed is controlled at 21.7 rpm, and according to the servo system specifications, assuming the motor speed is 1500 rpm, we can calculate that when ND = 21.7 * 60 = 130 rpm, the number of pulses output per second by the optical encoder is:
PD = 130 × 600 / 60 = 1300 pulses
When the measured number of pulses deviates from the calculated standard value, the incremental voltage ΔU output to the servo system can be calculated based on the correspondence between voltage and pulse count. After D/A conversion, the incremental pulse count is calculated and then subtracted.
As the running time and route length increase, the deviation from our pre-designed route also increases. At this point, the system starts the position loop, continuously measuring the number of pulses output per second by the photoelectric encoder and comparing it with the standard value PD (ideal value). It calculates the increment ΔP and converts it into the corresponding D/A output digital quantity. The controller then reduces the number of pulses input to the motor, subtracting the increment from the original output voltage, forcing the motor speed to decrease. When the measured ΔP is approximately zero, the adjustment stops. This ensures that the motor speed is always controlled within the allowable range.
Based on their detection principles, encoders can be classified into optical, magnetic, inductive, and capacitive types. Based on their calibration methods and signal output formats, they can be classified into incremental, absolute, and hybrid types.
1.1 Incremental Encoder
Incremental encoders directly utilize the photoelectric conversion principle to output three sets of square wave pulses, A, B, and Z phases. The A and B pulses have a 90° phase difference, and each phase outputs one pulse per revolution, used for reference point positioning. Its advantages include simple principle and construction, an average mechanical lifespan exceeding tens of thousands of hours, strong anti-interference capability, high reliability, and suitability for long-distance transmission. Its disadvantage is that it cannot output the absolute position information of the shaft rotation.
1.2 Absolute Encoder
An absolute encoder is a sensor that directly outputs digital values. Its circular code disk has several concentric tracks radially, each track consisting of alternating transparent and opaque sectors. The number of sectors in adjacent tracks is double the number of bits in its binary code. A light source is located on one side of the code disk, and a photosensitive element corresponds to each track on the other side. When the code disk is in different positions, each photosensitive element converts the light source into a corresponding voltage level signal, forming a binary number. The key feature of this type of encoder is that it does not require a counter; a fixed digital code corresponding to the position can be read from any position of the shaft. Obviously, the more tracks, the higher the resolution. For an encoder with N-bit binary resolution, its code disk must have N tracks. Currently, 16-bit absolute encoders are available in China.
Absolute encoders utilize natural binary or cyclic binary (Gray code) methods for photoelectric conversion. The difference between absolute and incremental encoders lies in the translucent and opaque lines on the code disk. Absolute encoders can have multiple codes, and the absolute position is detected by reading the codes on the code disk. The code design can employ binary code, cyclic code, binary complement code, etc. Its characteristics are:
1.2.1 The absolute value of the angular coordinates can be read directly;
1.2.2 No cumulative error;
1.2.3 Position information is not lost after power is cut off. However, the resolution is determined by the number of bits in the binary representation, meaning the precision depends on the number of bits, currently including 10-bit, 14-bit, and other types.
1.3 Hybrid Absolute Encoder
The hybrid absolute encoder outputs two sets of information: one set is used to detect the magnetic pole position and has absolute information function; the other set is exactly the same as the output information of the incremental encoder.
An optical encoder is an angle (angular velocity) detection device that converts the angle input to a shaft into corresponding electrical pulses or digital signals using the photoelectric conversion principle. It features small size, high precision, reliable operation, and a digital interface. It is widely used in CNC machine tools, rotary tables, servo drives, robots, radar, military target measurement, and other devices and equipment requiring angle detection.