1. Introduction
Photoelectric encoders are commonly used in modern motor control systems to detect the position and speed of rotating shafts. They are high-precision angular position measurement sensors that convert the mechanical geometric displacement on the output shaft into pulse or digital quantities through photoelectric conversion. Due to their high resolution, fast response speed, and small size, they are widely used in motor control systems.
2. Fiber Optic Implementation of Signal Transmission for Absolute-Type Photoelectric Encoders
Encoders are classified into absolute encoders and incremental encoders according to their signal output form. Absolute photoelectric encoders have advantages such as direct interface with PLC modules, ARM or FPGA devices, and no cumulative error, but they are expensive, have complex manufacturing processes, and are not suitable for miniaturization. Absolute encoders come in two types: single-turn and multi-turn. A single-turn absolute encoder automatically returns to zero after one revolution; a multi-turn absolute encoder automatically returns to zero after reaching the maximum number of revolutions and the maximum count value. Absolute encoders generally use Gray code disks for encoding. Gray code changes only one bit when transitioning between any two adjacent numbers. Taking a 24-bit binary code disk with a resolution of 24 as an example, if the absolute encoder uses a binary 8421 code disk, as shown in Figure 1, one or more binary positions change between two sequential codes. For example, when two sequential binary codes change from 0111 to 1000, all bits of the binary code change their state. Readings obtained at the transition moments of state changes may be erroneous. That is, position synchronization and sampling become very difficult.
Using a binary Gray code disk, as shown in Figure 2, only one binary bit changes position between the two sequential codes, from the last bit to the first bit. This makes position synchronization and sampling accurate, simple, and feasible. For the conversion relationship between natural binary code and Gray code, please refer to relevant literature.
Absolute encoder signal outputs typically include parallel output, serial output, bus-type output, and integrated transmitter output. A brief introduction to these output methods follows.
2.1 Parallel Output
Absolute encoders output multi-bit digital codes (Gray code or pure binary code). Parallel output involves multiple high and low level outputs on the interface to represent 1 or 0 of the digital code. For absolute encoders with a low number of bits, this format is generally used to directly output the digital code, which can be directly connected to the I/O interface of a PLC or host computer. The output is instantaneous and the connection is simple. However, parallel output has the following problems:
① It must be Gray code, because if it is pure binary code, multiple bits may change when the data is refreshed, and the reading will cause errors in a short time.
② All interfaces must be properly connected, because if there is a single poorly connected point, the potential at that point will always be 0, causing an error code that cannot be determined.
③ The transmission distance should not be too far, generally one or two meters. For complex environments, isolation is best.
④ For a large number of bits, many core cables are required, and good connections must be ensured, which brings engineering difficulties. Similarly, for encoders, there are many node outputs at the same time, which increases the failure rate of the encoder.
2.2 Synchronous Serial (SSI) Output
Serial output refers to the sequential output of data according to a pre-defined time agreement. Physical connection methods include RS232, RS422 (TTL), and RS485. An SSI interface, such as RS422 mode, uses two data lines and two clock lines. The receiving device sends an interrupt clock pulse to the encoder, and the encoder outputs the absolute position value synchronously with the clock pulse to the receiving device. Triggered by a clock signal from the receiving device, the encoder begins outputting a serial signal synchronized with the clock signal. Serial output requires fewer connection lines, allows for longer transmission distances, and improves the reliability and protection of the encoder. High-bit absolute encoders generally use serial output.
2.3 Fieldbus-type output (asynchronous serial)
Fieldbus encoders consist of multiple encoders connected together with a pair of signal lines. By setting an address, signals are transmitted via communication. The receiving device only needs one interface to read signals from multiple encoders.
Bus-type encoder signals follow the RS485 physical format. Currently, there are various communication protocols, each with its own advantages, and no unified standard has been established. Commonly used communication protocols for encoders include: PROFIBUS-DP; CAN; DeviceNet, etc.
Bus-type encoders can save on connecting cables and receiving device interfaces, have a long transmission distance, and can also greatly reduce costs when multiple encoders are centrally controlled.
2.4 Integrated Transmitter Output
Its signal has been converted in the encoder and then directly transmitted and output. It has analog output of 4-20mA, RS485 digital output, 14-bit parallel output, etc.
For the common output signal form of absolute encoders, namely synchronous serial output (SSI), a fiber optic transmission method is proposed to improve the encoder signal's anti-interference capability and the convenience of construction and wiring. An industrial serial fiber optic modem directly modulates RS-232/422/485 electrical signals into optical signals for transmission over fiber optics, solving the problems of electromagnetic interference, ground loop interference, and lightning damage. This improves the reliability, security, and confidentiality of data communication, making it suitable for a control system with special requirements for electromagnetic interference environments. As shown in Figure 3, the synchronous serial RS-422 data signal output from the encoder is converted into a TTL signal by an interface conversion circuit, and then converted into an optical signal for transmission by an optoelectronic conversion device. Similarly, the RS-422 clock synchronization signal is converted by the receiving end in the same way, except that the wavelengths of the converted data signal and clock synchronization signal are not equal, and then propagated through multimode fiber.
3. Fiber Optic Implementation of Incremental Photoelectric Encoder Signal Transmission
Incremental photoelectric encoders do not have counting or interface circuits, are relatively inexpensive, and are commonly used in practical engineering.
An incremental photoelectric encoder mainly consists of a light source, a code disk, a detection grating, a photoelectric detection device, and a conversion circuit, as shown in Figure 4. The code disk has radially spaced light-transmitting slits with equal pitch, with each adjacent slit representing one incremental cycle. The detection grating has two corresponding light-transmitting slits, A and B, on the code disk, allowing light to pass between the light source and the code disk, thus enabling the photoelectric detection device to detect the light signal. The light-transmitting slits A and B are equal in pitch to those on the code disk, but they are offset by 1/4 pitch, resulting in a 90° electrical angle phase difference in the signals output by the photoelectric detection device. Two orthogonal square wave pulse trains, A and B, with a 90° phase difference, represent the rotation of the measured shaft by a certain angle. The phase relationship between A and B reflects the rotation direction of the measured shaft. That is, when phase A leads phase B by 90°, the rotation direction is forward; when phase B leads phase A by 90°, the rotation direction is reverse. The Z signal is a pulse signal representing the zero position, which can be used for zeroing, alignment, and resetting the counter.
The diagram is shown in Figure 5:
When the code disk rotates with the shaft being measured, the light source, aperture plate, and detection grating remain stationary. Light passes through the light-transmitting slits on the code disk and detection grating and illuminates the photoelectric detection device. The photoelectric detection device then outputs two sets of approximately sinusoidal electrical signals with a 90° phase difference. These sinusoidal signals are then compared to a square wave signal by a comparator. Generally, incremental encoders offer voltage output, complementary output, open-collector output, and driver output. The circuit diagrams for various transmission methods are shown in Figure 6.
Because our control system is located far from the encoder installation site, a driver output method is currently used. This driver output method improves signal anti-interference capabilities and is suitable for long-distance transmission. Three pulse signals, A, B, and Z, are input to the driver, inverted, and then output as mutually quadrature pulse signals (pulse amplitude approximately 3V) for long-distance transmission. The rotation angle or speed information of the measured shaft can be determined by detecting the number of pulses. The signal is shown in Figure 7.
The use of three mutually orthogonal pulse signals for long-distance transmission aims to improve signal anti-interference capabilities. However, encoder output signals generally require separate transmission from high-voltage power. In our specific application system, laying a separate encoder signal transmission circuit presents construction difficulties and increases wiring complexity. Therefore, we consider photoelectric conversion of the encoder output signal and transmission using plastic optical fiber (plastic optical fiber, used in industrial applications, is highly flexible and wear-resistant). This allows the optical fiber and high-voltage cable to be laid in the same cable tray, improving signal transmission anti-interference while saving wiring space and reducing overall costs. The output A, B, and Z three-phase pulse signals can be directly converted into optical signals (as shown in Figure 8), unifying the output mode of the photoelectric encoder to optical signals (voltage output, complementary output, driver output, and open-collector output can all use this method). At the receiving end, the optical signal is converted into an electrical signal by an optical fiber receiver (as shown in Figure 9) and enters the corresponding processing circuit for counting and other processing.
The HFBR-1523Z and HFBR-2523Z fiber optic transceivers (660nm) from Avago Technologies were selected. These transceivers have a maximum transmission rate of 40KBd, an operating temperature range of 0℃ to 70℃, a maximum operating current of 25mA, and use Ф1 plastic optical fiber. It's important to clarify the difference between baud rate and bit rate. Baud refers to the waveform of a signal's magnitude change. An encoder output baud rate of 1024ps means that 1024 waveform changes are transmitted per second. A signal waveform can contain one or more binary bits. For example, a single-bit signal with a transmission rate of 9600bit/s has a baud rate of 9600baud, meaning it can transmit 9600 binary pulses per second.
If the signal waveform consists of 2 binary bits, its baud rate is only 4800 baud when the transmission rate is 9600 bit/s. In the experiment, when the communication rate of the fiber optic transceiver is selected to be 40 Kbps, the HFBR-1523Z (transmitter) and HFBR-2523Z (receiver) fiber optic transceivers can meet the requirements. Figure 10 shows the waveform captured from the oscilloscope. The input DATE of the transmitter HFBR-1523Z is detected, and the waveform is as shown in the square wave above. After electro-optic conversion, it is transmitted through plastic optical fiber. The received signal waveform (below) detected on pin 1 of the receiver HFBR-2523Z realizes the fiber optic transmission of the encoder pulse signal.
4. Conclusion
In summary, by employing a fiber optic interface circuit, the input and output optical signals can meet the required communication rates, thus realizing fiber optic transmission of the encoder output signal. Using fiber optics as the transmission medium ensures good electrical isolation between the encoder and the control system, and also avoids the influence of the strong electromagnetic field environment generated during motor startup and operation on the weak pulse signal transmission of the encoder.