Share this

The principle and application circuit of photoelectric encoders

2026-04-06 04:47:45 · · #1

1. Principle of photoelectric encoder

An optical encoder is a sensor that converts the displacement of a machine on its output shaft into pulses or digital signals through photoelectric conversion. It is currently the most widely used sensor. An optical encoder consists of a grating disk and a photoelectric detection device. The grating disk has a number of rectangular holes evenly distributed in a circular plate of a certain diameter. Because the photoelectric code disk is coaxial with the motor, when the motor rotates, the grating disk rotates at the same speed as the motor. The detection device, composed of electronic components such as light-emitting diodes, detects and outputs pulse signals. Its principle is illustrated in Figure 1; the number of pulses output per second by the optical encoder reflects the current speed of the motor.

Based on their detection principles, encoders can be classified into optical, magnetic, inductive, and capacitive types. According to their scale design and signal output pattern, they can be classified into incremental, absolute, and mixed 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, with one pulse per revolution for each phase, used for reference point positioning. Its advantages include a simple operating principle, a machine 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 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 a number of concentric tracks along the radial direction. Each track consists of alternating transparent and opaque sectors, with the number of sectors in adjacent tracks being double. The number of tracks on the code disk corresponds to 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 characteristic of this type of encoder is that it does not require a counter; a stable digital code corresponding to the position can be read at any position of the shaft. Obviously, the more tracks, the higher the resolution. For an encoder with an N-bit binary resolution, its code disk must have N tracks. Currently, 16-bit absolute encoder products are available in China.

Absolute encoders utilize natural binary or cyclic binary (Gray code) methods for photoelectric conversion. The difference between absolute encoders 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. Encoding schemes can employ binary code, cyclic code, binary complement code, etc. Its characteristics are:

1.2.1 The absolute value of the angle coordinate can be read directly;

1.2.2 No cumulative bias ;

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, that is, the precision depends on the number of bits, and there are now various types such as 10-bit and 14-bit.

1.3 Dense Absolute Value Encoder

The dense absolute encoder outputs two sets of information: one set is used to detect the magnetic pole position and has an 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 rate) detection device that converts the angle input to a shaft into corresponding electrical pulses or digital quantities using the photoelectric conversion principle. It features small size, high precision, reliable operation , and a digital interface. It is widely used in devices and configurations requiring angle detection, such as CNC machine tools, rotary tables, servo drives, robots, radar, and military target measurement.

2. Application circuit of photoelectric encoder

2. Application of the EPC-755A photoelectric encoder

The EPC-755A photoelectric encoder boasts excellent performance, exhibiting strong anti-interference capabilities in angle and displacement measurements, and providing a stable and reliable output pulse signal. This pulse signal, after counting, yields the measured digital signal. Therefore, in developing a car driving simulator, we selected the EPC-755A photoelectric encoder as the sensor for measuring directional rotation angles. Its output circuit uses an open-collector type, with an output resolution of 360 pulses/revolution. Considering that the car steering wheel rotates bidirectionally (clockwise and counterclockwise), it is necessary to phase-detect the encoder's output signal before counting. Figure 2 shows the phase-detection and bidirectional counting circuit used in the actual application of the photoelectric encoder. The phase-detection circuit consists of one D flip-flop and two NAND gates, while the counting circuit uses three 74LS193 chips.

When the photoelectric encoder rotates clockwise, the output waveform of channel A leads the output waveform of channel B by 90°. The D flip-flop outputs Q (waveform W1) are high and Q (waveform W2) are low. The upper NAND gate is open, and the counting pulse (waveform W3) is sent to the add pulse input terminal CU of the bidirectional counter 74LS193 for addition counting. At this time, the lower NAND gate is closed, and its output is high (waveform W4). When the photoelectric encoder rotates counterclockwise, the output waveform of channel A is delayed by 90° compared to the output waveform of channel B. The D flip-flop outputs Q (waveform W1) are low and Q (waveform W2) are high. The upper NAND gate is closed, and its output is high (waveform W3). At this time, the lower NAND gate is open, and the counting pulse (waveform W4) is sent to the subtract pulse input terminal CD of the bidirectional counter 74LS193 for subtraction counting.

When the car steering wheel rotates clockwise and counterclockwise, its maximum rotation angle is two and a half turns. An encoder with a resolution of 360 pulses/revolution is selected, and its maximum output pulse count is 900. The actual counting circuit used is composed of three 74LS193 chips. During system power-on initialization, it is first reset (CLR signal), and then its initial value is set to 800H, which is 2048 (LD signal). Thus, when the steering wheel rotates clockwise, the output range of the counting circuit is 2048 to 2948, and when the steering wheel rotates counterclockwise, the output range of the counting circuit is 2048 to 1148. The data outputs D0 to D11 of the counting circuit are sent to the data processing circuit.

In actual use, the steering wheel is frequently turned clockwise and counterclockwise. Due to quantization deviation, after a long period of operation, the output of the counting circuit when the steering wheel returns to center is probably not 2048, but rather a few digits off. To solve this problem, we added a steering wheel centering detection circuit. After the system operates, when the simulator is in a non-controlled state, the system detects the centering detection circuit. If the steering wheel is in the centering state and the data output of the counting circuit is not 2048, the counting circuit can be reset and the initial value reconfigured.

2.2 Application of photoelectric encoders in gravity measuring instruments

A rotary photoelectric encoder is used, with its shaft connected to the compensation knob shaft in the gravity measuring instrument. The angular displacement of the compensation knob in the gravity measuring instrument is converted into a certain electrical signal. There are two types of rotary photoelectric encoders: absolute encoders and incremental encoders.

Incremental encoders, being sensors with pulse-patterned outputs, have code disks that are much larger and have higher resolution than absolute encoders. Normally, only three code tracks are needed; these tracks no longer have the same significance as those in an absolute encoder but instead generate counting pulses. The outer and central tracks of the code disk have a similar number of evenly distributed transparent and opaque sector areas (gratings), but the two sectors are offset by half a zone. When the code disk rotates, its output signal consists of A-phase and B-phase pulse signals with a 90° phase difference, plus a pulse signal generated by the third code track, which has only one transparent slit (serving as the reference position of the code disk and providing an initial zero-position signal for the counting system). The direction of rotation can be determined from the phase relationship (leading or lagging) of the A and B output signals. As shown in Figure 3(a), when the code disk rotates clockwise, the A-track pulse waveform leads the B-track pulse by π/2, while in reverse rotation, the A-track pulse lags the B-track pulse by π/2. Figure 3(b) shows a practical circuit where the lower edge of the A-channel shaping wave triggers a positive pulse generated by a monostable multivibrator, which is then ANDed with the B-channel shaping wave. When the code disk rotates forward, only the positive pulse is output; conversely, only the negative pulse is output. Therefore, the incremental encoder determines the rotation direction and relative angular displacement of the code disk based on the output pulse source and pulse count. Typically, if the encoder has N (code channels) output signals with a phase difference of π/N, the countable pulses are 2N times the number of gratings; in this case, N=2. A drawback of the circuit in Figure 3 is that it can occasionally produce miscounted pulses, causing deviations. This occurs when one signal is in a 'high' or 'low' level state, while another signal is fluctuating between 'high' and 'low'. In this case, although the code disk does not move, it will produce a unidirectional output pulse. For example, this can happen when the code disk jitters or when manually aligning (as seen below in gravimeter measurements).

Figure 4 shows a quadruple frequency subdivision circuit that can both prevent false pulses and improve resolution. Here, D-type flip-flops and a clock generation circuit with an impact factor are used. As shown in Figure 4, each channel has two D flip-flops connected in series. Thus, during the interval of the clock pulse, the two Q terminals (e.g., pins 2 and 7 of the 74LS175 corresponding to channel B) retain the input states of the previous two clock cycles. If they are the same, it indicates no change during the clock interval; otherwise, the direction of change can be determined based on their relationship, thereby generating a 'forward' or 'reverse' output pulse. When a channel oscillates between 'high' and 'low' due to vibration, it will alternately generate 'forward' and 'reverse' pulses. This can eliminate their influence when substituting the sum of the two counters (this will also be relevant to the instrument readings below). Therefore, the frequency of the clock generator should be greater than the approximate maximum value of the vibration frequency. Figure 4 also shows that four counting pulses are obtained within the original pulse signal period. For example, an encoder with 1000 pulses per revolution can generate 4000 pulses at 4 times the frequency, with a resolution of 0.09 °. In fact, modern sensor products package the amplification and shaping circuits of the photosensitive element's output signal with the sensing element, so by simply adding subdivision and counting circuits, an angular displacement measurement system can be formed (74159 is a 4-to-16 decoder).

Basic skill specifications

In the application of incremental photoelectric encoders, different requirements are usually put forward for their technical specifications. Among them, the most important are its resolution, accuracy, stability of output signal, response frequency, and signal output mode.

(1) Discrimination rate

The resolution of a photoelectric encoder is expressed as the number of output signal cycles generated by one revolution of the encoder shaft, i.e., pulses per revolution (PPR). The number of light-transmitting defects on the code disk is the encoder's resolution; the more defects engraved on the code disk, the higher the encoder's resolution. In industrial electrical drives, depending on the application, incremental photoelectric encoders with resolutions typically ranging from 500 to 6000 PPR can be selected, with some reaching tens of thousands of PPR. In AC servo motor control systems, encoders with a resolution of 2500 PPR are commonly used. Furthermore, by performing logical processing on the photoelectric conversion signal, a 2x or 4x frequency pulse signal can be obtained, thereby further improving the resolution.

(2) Precision

The accuracy of an incremental photoelectric encoder is completely unrelated to its resolution; these are two different concepts. Accuracy is a measure of the ability to determine the position of any pulse relative to another pulse within a selected range of resolution. Accuracy is usually expressed in angles, arcminutes, or arcseconds. The accuracy of an encoder is related to the manufacturing quality of the code disk's light transmission defects, the manufacturing precision of the code disk's rotating environment, and also to the installation technique.

(3) Stability of output signal

The stability of an encoder's output signal refers to its ability to retain the accuracy of the code under actual operating conditions. Key factors affecting the stability of the encoder's output signal include temperature-induced drift in electronic components, external deformation forces applied to the encoder, and changes in the characteristics of the light source. Due to the influence of temperature and power supply variations, the encoder's electronic circuitry cannot retain the output characteristics of the code; therefore, this must be carefully considered in design and application.

(4) Corresponding frequency

The output frequency of an encoder depends on the response speed of the photoelectric sensor and the electronic processing circuitry. When the encoder rotates at high speed, if its resolution is high, the output signal frequency will be very high. If the operating speed of the photoelectric sensor and electronic components is not compatible, the output waveform may be severely distorted, or even pulse loss may occur. In this case, the output signal will not accurately reflect the shaft position information. Therefore, for each encoder with a given resolution, its maximum speed is also fixed; that is, its response frequency is limited. For the relationship between the maximum response frequency, resolution, and maximum speed of an encoder, please refer to other materials.

(5) Signal output pattern

In most environments, the signal level directly obtained from the encoder's photoelectric detection device is low and the waveform is irregular, which is not suitable for the requirements of control, signal processing, and remote transmission interruption. Therefore, it is necessary to amplify and shape this signal within the encoder. The processed output signal is usually similar to a sine wave or a square wave. Because square wave output signals are easy to digitally process, this type of output signal is widely used in positioning control. Using a sine wave output signal basically eliminates the oscillation phenomenon during positioning interruption and easily achieves high resolution with low cost through electronic interpolation.

The signal output types of incremental photoelectric encoders include: open collector output, voltage output, line driver output, complementary output, and push-pull output.

Open-collector output is a method that utilizes the NPN transistor on the encoder output side. The transistor's emitter is connected to 0V, while the collector is disconnected from the +Vcc terminal, making the collector the output terminal. This type of output circuit is recommended when the encoder's power supply voltage and the signal receiving device's voltage differ. The output circuit is shown in Figure 1-3. Major applications include elevators, textile machinery, oiling machines, automated equipment, cutting machines, printing machines, packaging machines, and knitting machines.

This voltage output method utilizes the NPN transistor on the encoder output side. The transistor's emitter is connected to 0V, and its collector is connected to +Vcc and the load resistor, serving as the output terminal. This type of output circuit is recommended when the encoder's power supply voltage and the signal receiving device's voltage are the same. Major applications include elevators, textile machinery, oiling machines, automated equipment, cutting machines, printing machines, packaging machines, and knitting machines.

Line-driven output utilizes a dedicated line-driven IC chip (26LS31) in the encoder output circuit. Its high-speed response and excellent noise immunity make it suitable for long-distance transmission. Key applications include servo motors, robots, and CNC machining machines.

Complementary output consists of two transistors, one PNP and the other NPN. When one transistor is on, the other is off. This output type features high input impedance and low output impedance, allowing it to provide a wide power range even in low-impedance environments. Because the input and output signals are in phase and have a wide frequency range, it is suitable for long-distance transmission. It is primarily used in elevator applications and other specialized fields.

The push-pull output method consists of two NPN transistors, one on and one off. When one transistor is on, the other is off. Current flows through the two transistors on the output side in both directions, constantly outputting current. Therefore, it has low impedance and is less affected by noise and distortion waves. Important applications include elevators, textile machinery, oiling machines, automated systems, cutting machines, printing machines, packaging machines, and knitting machines.

Read next

CATDOLL 135CM Nanako (TPE Body with Hard Silicone Head)

Height: 135cm Weight: 24.5kg Shoulder Width: 33cm Bust/Waist/Hip: 62/57/69cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm An...

Articles 2026-02-22